idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
653,344 | private Mono<StreamResponse> downloadActivationWithResponseAsync(String onPremiseIotSensorName) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (onPremiseIotSensorName == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>final String apiVersion = "2020-08-06-preview";<NEW_LINE>final String accept = "application/zip";<NEW_LINE>return FluxUtil.withContext(context -> service.downloadActivation(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), onPremiseIotSensorName, accept, context)).contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));<NEW_LINE>} | error(new IllegalArgumentException("Parameter onPremiseIotSensorName is required and cannot be null.")); |
740,281 | protected RefactoringStatus verifyDestination(IJavaElement destination, int location) throws JavaModelException {<NEW_LINE>IJavaElement[] elements = getJavaElements();<NEW_LINE>for (int i = 0; i < elements.length; i++) {<NEW_LINE>IJavaElement parent = destination.getParent();<NEW_LINE>while (parent != null) {<NEW_LINE>if (parent.equals(elements[i])) {<NEW_LINE>return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.ReorgPolicyFactory_cannot);<NEW_LINE>}<NEW_LINE>parent = parent.getParent();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>RefactoringStatus superStatus = super.verifyDestination(destination, location);<NEW_LINE>if (superStatus.hasFatalError()) {<NEW_LINE>return superStatus;<NEW_LINE>}<NEW_LINE>if (location == IReorgDestination.LOCATION_ON) {<NEW_LINE>Object commonParent = new ParentChecker(new IResource[0], getJavaElements()).getCommonParent();<NEW_LINE>if (destination.equals(commonParent) || Arrays.asList(getJavaElements()).contains(destination)) {<NEW_LINE>return <MASK><NEW_LINE>}<NEW_LINE>return superStatus;<NEW_LINE>} else {<NEW_LINE>if (contains(elements, destination)) {<NEW_LINE>return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.ReorgPolicyFactory_cannot);<NEW_LINE>}<NEW_LINE>IJavaElement parent = destination.getParent();<NEW_LINE>if (!(parent instanceof IType)) {<NEW_LINE>return superStatus;<NEW_LINE>}<NEW_LINE>if (!allInSameParent(elements, parent)) {<NEW_LINE>return superStatus;<NEW_LINE>}<NEW_LINE>ArrayList<IJavaElement> sortedChildren = getSortedChildren((IType) parent);<NEW_LINE>int destinationIndex = sortedChildren.indexOf(destination);<NEW_LINE>for (int i = 0; i < elements.length; i++) {<NEW_LINE>int elementIndex = sortedChildren.indexOf(elements[i]);<NEW_LINE>if (location == IReorgDestination.LOCATION_AFTER && elementIndex == destinationIndex + 1) {<NEW_LINE>return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.ReorgPolicyFactory_cannot);<NEW_LINE>}<NEW_LINE>if (location == IReorgDestination.LOCATION_BEFORE && elementIndex == destinationIndex - 1) {<NEW_LINE>return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.ReorgPolicyFactory_cannot);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return superStatus;<NEW_LINE>}<NEW_LINE>} | RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.ReorgPolicyFactory_element2parent); |
348,409 | private static void preTestBackUp(LibertyClient client) throws Exception {<NEW_LINE>final String METHOD = "preTestBackUp";<NEW_LINE>Machine m = client.getMachine();<NEW_LINE>LocalFile backup = getClientBackupZip(client);<NEW_LINE>// Client is in the build.image/wlp/usr/clients dir<NEW_LINE>// should be /wlp/usr/clients<NEW_LINE>RemoteFile usrclientsDir = new RemoteFile(m, client.getClientRoot()).getParentFile();<NEW_LINE>if (backup.exists()) {<NEW_LINE>Log.<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Log.info(c, METHOD, "Backing up Client: " + client.getClientName() + " to zip file: " + backup.getAbsolutePath());<NEW_LINE>String workDir = usrclientsDir.getAbsolutePath();<NEW_LINE>String command = client.getMachineJavaJarCommandPath();<NEW_LINE>String[] param = { "cMf", backup.getAbsolutePath(), client.getClientName() };<NEW_LINE>ProgramOutput o = m.execute(command, param, workDir);<NEW_LINE>if (o.getReturnCode() == 0) {<NEW_LINE>Log.info(c, METHOD, "Successfully backed up client: " + client.getClientName() + " to zip file: " + backup.getAbsolutePath());<NEW_LINE>} else {<NEW_LINE>Log.warning(c, "Backup jar process failed with return code " + o.getReturnCode());<NEW_LINE>Log.warning(c, "Backup jar process failed with error " + o.getStderr());<NEW_LINE>Log.warning(c, "Backup jar process failed with output " + o.getStdout());<NEW_LINE>}<NEW_LINE>} | info(c, METHOD, "Backup file already exists... skipping backup"); |
19,200 | public void bindView(ParentHolder holder) {<NEW_LINE>holder.bind(this);<NEW_LINE>Drawable arrowDrawable = DrawableCompat.wrap(ContextCompat.getDrawable(holder.itemView.getContext(), holder.isExpanded() ? R.drawable.ic_arrow_up_24dp : R.drawable.ic_arrow_down_24dp));<NEW_LINE>DrawableCompat.setTint(arrowDrawable, Aesthetic.get(holder.itemView.getContext()).textColorSecondary().blockingFirst());<NEW_LINE>holder.expandableIcon.setImageDrawable(arrowDrawable);<NEW_LINE>holder.expandableIcon.setVisibility(getChildList().isEmpty() ? View.GONE : View.VISIBLE);<NEW_LINE>holder.icon.setImageResource(iconResId);<NEW_LINE>if (iconResId != -1) {<NEW_LINE>holder.icon.setVisibility(View.VISIBLE);<NEW_LINE>} else {<NEW_LINE>holder.icon.setVisibility(View.GONE);<NEW_LINE>}<NEW_LINE>if (titleResId != -1) {<NEW_LINE>holder.lineOne.setText(holder.itemView.getResources().getString(titleResId));<NEW_LINE>holder.lineOne.setTypeface(TypefaceManager.getInstance().getTypeface(holder.itemView.getContext(), TypefaceManager.SANS_SERIF_MEDIUM));<NEW_LINE>}<NEW_LINE>if (isSelected) {<NEW_LINE>holder.itemView.setActivated(true);<NEW_LINE>} else {<NEW_LINE>holder.itemView.setActivated(false);<NEW_LINE>holder.icon.setAlpha(0.6f);<NEW_LINE>}<NEW_LINE>if (type == DrawerParent.Type.FOLDERS && !ShuttleUtils.isUpgraded((ShuttleApplication) holder.itemView.getContext().getApplicationContext(), settingsManager)) {<NEW_LINE>holder.itemView.setAlpha(0.4f);<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (type == DrawerParent.Type.PLAYLISTS) {<NEW_LINE>holder.itemView.setAlpha(getChildList().isEmpty() ? 0.4f : 1.0f);<NEW_LINE>holder.itemView.setEnabled(!getChildList().isEmpty());<NEW_LINE>}<NEW_LINE>if (type == Type.SLEEP_TIMER) {<NEW_LINE>holder.timeRemaining.setVisibility(timerActive ? View.VISIBLE : View.GONE);<NEW_LINE>holder.timeRemaining.setText(StringUtils.makeTimeString(holder.itemView.getContext(), timeRemaining));<NEW_LINE>} else {<NEW_LINE>holder.timeRemaining.setVisibility(View.GONE);<NEW_LINE>}<NEW_LINE>} | holder.itemView.setAlpha(1.0f); |
267,673 | protected int createOutstandingEntries(long modelId, ContentValues modelSetValues) {<NEW_LINE>Long tagDataId = modelSetValues.getAsLong(TagMetadata.TAG_ID.name);<NEW_LINE>String memberId = modelSetValues.getAsString(TagMemberMetadata.USER_UUID.name);<NEW_LINE>Long deletionDate = modelSetValues.getAsLong(TagMetadata.DELETION_DATE.name);<NEW_LINE>if (tagDataId == null || tagDataId == AbstractModel.NO_ID || RemoteModel.isUuidEmpty(memberId))<NEW_LINE>return -1;<NEW_LINE>TagOutstanding to = new TagOutstanding();<NEW_LINE>to.setValue(OutstandingEntry.ENTITY_ID_PROPERTY, tagDataId);<NEW_LINE>to.setValue(OutstandingEntry.CREATED_AT_PROPERTY, DateUtilities.now());<NEW_LINE>String addedOrRemoved = NameMaps.MEMBER_ADDED_COLUMN;<NEW_LINE>if (deletionDate != null && deletionDate > 0)<NEW_LINE>addedOrRemoved = NameMaps.MEMBER_REMOVED_COLUMN;<NEW_LINE>to.setValue(OutstandingEntry.COLUMN_STRING_PROPERTY, addedOrRemoved);<NEW_LINE>to.<MASK><NEW_LINE>database.insert(outstandingTable.name, null, to.getSetValues());<NEW_LINE>ActFmSyncThread.getInstance().enqueueMessage(new ChangesHappened<TagData, TagOutstanding>(tagDataId, TagData.class, PluginServices.getTagDataDao(), PluginServices.getTagOutstandingDao()), null);<NEW_LINE>return 1;<NEW_LINE>} | setValue(OutstandingEntry.VALUE_STRING_PROPERTY, memberId); |
1,638,794 | public String changePassword(final HttpServletRequest request, final Model model, @RequestParam("id") final long id, @RequestParam("token") final String token) {<NEW_LINE>final Locale locale = request.getLocale();<NEW_LINE>final PasswordResetToken passToken = userService.getPasswordResetToken(token);<NEW_LINE>if (passToken == null || passToken.getUser().getId() != id) {<NEW_LINE>final String message = messages.getMessage("auth.message.invalidToken", null, locale);<NEW_LINE>model.addAttribute("message", message);<NEW_LINE>return "redirect:/login.html?lang=" + locale.getLanguage();<NEW_LINE>}<NEW_LINE>final Calendar cal = Calendar.getInstance();<NEW_LINE>if ((passToken.getExpiryDate().getTime() - cal.getTime().getTime()) <= 0) {<NEW_LINE>model.addAttribute("message", messages.getMessage("auth.message.expired", null, locale));<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>final Authentication auth = new UsernamePasswordAuthenticationToken(passToken.getUser(), null, userDetailsService.loadUserByUsername(passToken.getUser().getEmail()).getAuthorities());<NEW_LINE>SecurityContextHolder.getContext().setAuthentication(auth);<NEW_LINE>return "redirect:/updatePassword.html?lang=" + locale.getLanguage();<NEW_LINE>} | return "redirect:/login.html?lang=" + locale.getLanguage(); |
1,065,610 | private boolean killLinux(Runtime rt) {<NEW_LINE>try {<NEW_LINE>String getPidCommand = getJps() + " | egrep -i \"jboss-modules\" | awk '{ print $1; }'";<NEW_LINE>// get a jstack of all the processes<NEW_LINE>Process process = rt.exec(new String[] { "/bin/sh", "-c", getPidCommand });<NEW_LINE><MASK><NEW_LINE>String processTable = readString(in);<NEW_LINE>readString(process.getErrorStream());<NEW_LINE>if (!processTable.isEmpty()) {<NEW_LINE>readString(rt.exec(new String[] { "/bin/sh", "-c", getJps() + " | egrep -i \"jboss-modules\" | awk '{ print $1; }' | xargs --no-run-if-empty kill -9" }).getInputStream());<NEW_LINE>errorProcessTable = processTable;<NEW_LINE>}<NEW_LINE>long end = System.currentTimeMillis() + 5000;<NEW_LINE>while (System.currentTimeMillis() < end) {<NEW_LINE>String running = readString(rt.exec(new String[] { "/bin/sh", "-c", getPidCommand }).getInputStream());<NEW_LINE>if (running.isEmpty()) {<NEW_LINE>return true;<NEW_LINE>} else {<NEW_LINE>Thread.sleep(100);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} | InputStream in = process.getInputStream(); |
1,362,216 | public DomainJoinInfo unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>DomainJoinInfo domainJoinInfo = new DomainJoinInfo();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("DirectoryName", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>domainJoinInfo.setDirectoryName(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("OrganizationalUnitDistinguishedName", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>domainJoinInfo.setOrganizationalUnitDistinguishedName(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 domainJoinInfo;<NEW_LINE>} | JsonToken token = context.getCurrentToken(); |
1,758,756 | private void convertMutations(TabletServerMutations<QCMutation> mutations, Map<Long, CMK> cmidToCm, MutableLong cmid, Map<TKeyExtent, List<TConditionalMutation>> tmutations, CompressedIterators compressedIters) {<NEW_LINE>mutations.getMutations().forEach((keyExtent, mutationList) -> {<NEW_LINE>var tcondMutaions <MASK><NEW_LINE>for (var cm : mutationList) {<NEW_LINE>TMutation tm = cm.toThrift();<NEW_LINE>List<TCondition> conditions = convertConditions(cm, compressedIters);<NEW_LINE>cmidToCm.put(cmid.longValue(), new CMK(keyExtent, cm));<NEW_LINE>TConditionalMutation tcm = new TConditionalMutation(conditions, tm, cmid.longValue());<NEW_LINE>cmid.increment();<NEW_LINE>tcondMutaions.add(tcm);<NEW_LINE>}<NEW_LINE>tmutations.put(keyExtent.toThrift(), tcondMutaions);<NEW_LINE>});<NEW_LINE>} | = new ArrayList<TConditionalMutation>(); |
144,907 | public LenskitRecommenderEngine loadEngine() throws RecommenderBuildException, IOException {<NEW_LINE>File modelFile = options.get("model_file");<NEW_LINE>if (modelFile == null) {<NEW_LINE>logger.info("creating fresh recommender");<NEW_LINE>LenskitRecommenderEngineBuilder builder = LenskitRecommenderEngine.newBuilder();<NEW_LINE>for (LenskitConfiguration config : environment.loadConfigurations(getConfigFiles())) {<NEW_LINE>builder.addConfiguration(config);<NEW_LINE>}<NEW_LINE>Stopwatch timer = Stopwatch.createStarted();<NEW_LINE>LenskitRecommenderEngine engine = builder.build(input.getDAO());<NEW_LINE>timer.stop();<NEW_LINE>logger.info("built recommender in {}", timer);<NEW_LINE>return engine;<NEW_LINE>} else {<NEW_LINE>logger.info("loading recommender from {}", modelFile);<NEW_LINE>LenskitRecommenderEngineLoader loader = LenskitRecommenderEngine.newLoader();<NEW_LINE>loader.<MASK><NEW_LINE>for (LenskitConfiguration config : environment.loadConfigurations(getConfigFiles())) {<NEW_LINE>loader.addConfiguration(config);<NEW_LINE>}<NEW_LINE>Stopwatch timer = Stopwatch.createStarted();<NEW_LINE>LenskitRecommenderEngine engine;<NEW_LINE>InputStream input = new FileInputStream(modelFile);<NEW_LINE>try {<NEW_LINE>input = CompressionMode.autodetect(modelFile).wrapInput(input);<NEW_LINE>engine = loader.load(input);<NEW_LINE>} finally {<NEW_LINE>input.close();<NEW_LINE>}<NEW_LINE>timer.stop();<NEW_LINE>logger.info("loaded recommender in {}", timer);<NEW_LINE>return engine;<NEW_LINE>}<NEW_LINE>} | setClassLoader(environment.getClassLoader()); |
1,680,802 | public UserVm restoreVirtualMachine(final long vmId, final Long newTemplateId) throws ResourceUnavailableException, InsufficientCapacityException {<NEW_LINE>final AsyncJobExecutionContext jobContext = AsyncJobExecutionContext.getCurrentExecutionContext();<NEW_LINE>if (jobContext.isJobDispatchedBy(VmWorkConstants.VM_WORK_JOB_DISPATCHER)) {<NEW_LINE>VmWorkJobVO placeHolder = null;<NEW_LINE>placeHolder = createPlaceHolderWork(vmId);<NEW_LINE>try {<NEW_LINE>return orchestrateRestoreVirtualMachine(vmId, newTemplateId);<NEW_LINE>} finally {<NEW_LINE>if (placeHolder != null) {<NEW_LINE>_workJobDao.expunge(placeHolder.getId());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>final Outcome<VirtualMachine> outcome = restoreVirtualMachineThroughJobQueue(vmId, newTemplateId);<NEW_LINE>retrieveVmFromJobOutcome(outcome, String.valueOf(vmId), "restoreVirtualMachine");<NEW_LINE>Object jobResult = retrieveResultFromJobOutcomeAndThrowExceptionIfNeeded(outcome);<NEW_LINE>if (jobResult != null && jobResult instanceof HashMap) {<NEW_LINE>HashMap<Long, String> passwordMap = (HashMap<Long, String>) jobResult;<NEW_LINE>UserVmVO <MASK><NEW_LINE>userVm.setPassword(passwordMap.get(vmId));<NEW_LINE>return userVm;<NEW_LINE>}<NEW_LINE>throw new RuntimeException("Unexpected job execution result");<NEW_LINE>}<NEW_LINE>} | userVm = _userVmDao.findById(vmId); |
988,205 | public void induceFeatures(InstanceList ilist, boolean withFeatureShrinkage, boolean inducePerClassFeatures) {<NEW_LINE>if (inducePerClassFeatures) {<NEW_LINE>int numClasses = ilist.getTargetAlphabet().size();<NEW_LINE>// int numFeatures = ilist.getDataAlphabet().size();<NEW_LINE>FeatureSelection[] pcfs = new FeatureSelection[numClasses];<NEW_LINE>for (int j = 0; j < numClasses; j++) pcfs[j] = (FeatureSelection) ilist.getPerLabelFeatureSelection()[j].clone();<NEW_LINE>for (int i = 0; i < ilist.size(); i++) {<NEW_LINE>Object data = ilist.get(i).getData();<NEW_LINE>AugmentableFeatureVector afv = (AugmentableFeatureVector) data;<NEW_LINE>root.induceFeatures(afv, null, pcfs, ilist.getFeatureSelection(), ilist.getPerLabelFeatureSelection(<MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new UnsupportedOperationException("Not yet implemented");<NEW_LINE>}<NEW_LINE>} | ), withFeatureShrinkage, inducePerClassFeatures, addFeaturesClassEntropyThreshold); |
35,670 | public com.amazonaws.services.applicationautoscaling.model.FailedResourceAccessException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.applicationautoscaling.model.FailedResourceAccessException failedResourceAccessException = new com.amazonaws.services.applicationautoscaling.model.FailedResourceAccessException(null);<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>} 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 failedResourceAccessException;<NEW_LINE>} | JsonToken token = context.getCurrentToken(); |
515,178 | protected void unlockMessage(JsMessageWrapper jsMsg, boolean bumpRedeliveryCount) throws SIResourceException {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.entry(tc, "unlockMessage", new Object[] { jsMsg, Boolean.valueOf(bumpRedeliveryCount) });<NEW_LINE>try {<NEW_LINE>SIMPMessage msg = (SIMPMessage) jsMsg;<NEW_LINE>if (msg != null) {<NEW_LINE>try {<NEW_LINE>msg.unlockMsg(msg.getLockID(), null, bumpRedeliveryCount);<NEW_LINE>} catch (NotInMessageStore e) {<NEW_LINE>// No FFDC code needed<NEW_LINE>SibTr.exception(tc, e);<NEW_LINE>// See defect 387591<NEW_LINE>// We should only get this exception if the message was deleted via<NEW_LINE>// the controllable objects i.e. the admin console. If we are here for<NEW_LINE>// another reason that we have a real error.<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (MessageStoreException e) {<NEW_LINE>// MessageStoreException shouldn't occur so FFDC.<NEW_LINE>FFDCFilter.processException(e, "com.ibm.ws.sib.processor.impl.JSLockedMessageEnumeration.unlockMessage", "1:540:1.8.1.10", this);<NEW_LINE><MASK><NEW_LINE>SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0002", new Object[] { "com.ibm.ws.sib.processor.impl.JSLockedMessageEnumeration", "1:547:1.8.1.10", e });<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.exit(tc, "unlockMessage", e);<NEW_LINE>throw new SIResourceException(nls.getFormattedMessage("INTERNAL_MESSAGING_ERROR_CWSIP0002", new Object[] { "com.ibm.ws.sib.processor.impl.JSLockedMessageEnumeration", "1:558:1.8.1.10", e }, null), e);<NEW_LINE>}<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.exit(tc, "unlockMessage", this);<NEW_LINE>} | SibTr.exception(tc, e); |
674,840 | private static void toSlime(Cursor summaryObject, ConvergenceSummary summary) {<NEW_LINE>summaryObject.setLong(<MASK><NEW_LINE>summaryObject.setLong("down", summary.down());<NEW_LINE>summaryObject.setLong("needPlatformUpgrade", summary.needPlatformUpgrade());<NEW_LINE>summaryObject.setLong("upgrading", summary.upgradingPlatform());<NEW_LINE>summaryObject.setLong("needReboot", summary.needReboot());<NEW_LINE>summaryObject.setLong("rebooting", summary.rebooting());<NEW_LINE>summaryObject.setLong("needRestart", summary.needRestart());<NEW_LINE>summaryObject.setLong("restarting", summary.restarting());<NEW_LINE>summaryObject.setLong("upgradingOs", summary.upgradingOs());<NEW_LINE>summaryObject.setLong("upgradingFirmware", summary.upgradingFirmware());<NEW_LINE>summaryObject.setLong("services", summary.services());<NEW_LINE>summaryObject.setLong("needNewConfig", summary.needNewConfig());<NEW_LINE>summaryObject.setLong("retiring", summary.retiring());<NEW_LINE>} | "nodes", summary.nodes()); |
1,442,002 | public static void main(String[] args) throws Exception {<NEW_LINE>// Process the command-line options<NEW_LINE>CommandOption.setSummary(WordEmbeddings.class, "Train continuous word embeddings using the skip-gram method with negative sampling.");<NEW_LINE>CommandOption.process(WordEmbeddings.class, args);<NEW_LINE>InstanceList instances = InstanceList.load(new File(inputFile.value));<NEW_LINE>WordEmbeddings matrix = new WordEmbeddings(instances.getDataAlphabet(), numDimensions.value, windowSizeOption.value);<NEW_LINE>matrix.queryWord = exampleWord.value;<NEW_LINE>matrix.setNumIterations(numIterationsOption.value);<NEW_LINE>matrix.<MASK><NEW_LINE>if (orderingOption.value != null) {<NEW_LINE>if (orderingOption.value.startsWith("s")) {<NEW_LINE>matrix.orderingStrategy = SHUFFLED_ORDERING;<NEW_LINE>} else if (orderingOption.value.startsWith("l")) {<NEW_LINE>matrix.orderingStrategy = LINEAR_ORDERING;<NEW_LINE>} else if (orderingOption.value.startsWith("r")) {<NEW_LINE>matrix.orderingStrategy = RANDOM_ORDERING;<NEW_LINE>} else {<NEW_LINE>System.err.println("Unrecognized ordering: " + orderingOption.value + ", using linear.");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>matrix.train(instances, numThreads.value, numSamples.value);<NEW_LINE>PrintWriter out = new PrintWriter(outputFile.value, Charset.defaultCharset().name());<NEW_LINE>if (outputStatsLine.value) {<NEW_LINE>out.write(matrix.numWords + " " + matrix.numColumns + "\n");<NEW_LINE>}<NEW_LINE>matrix.write(out);<NEW_LINE>out.close();<NEW_LINE>if (outputContextFile.value != null) {<NEW_LINE>out = new PrintWriter(outputContextFile.value, Charset.defaultCharset().name());<NEW_LINE>if (outputStatsLine.value) {<NEW_LINE>out.write(matrix.numWords + " " + matrix.numColumns + "\n");<NEW_LINE>}<NEW_LINE>matrix.writeContext(out);<NEW_LINE>out.close();<NEW_LINE>}<NEW_LINE>} | countWords(instances, samplingFactorOption.value); |
1,698,416 | private TypeNameMatch findCandidateTypes(final String typeName, final int typeStart, final IProgressMonitor monitor) throws CoreException {<NEW_LINE>boolean isAnnotation = ('@' == compilationUnit.getContents()[Math.max(0, typeStart - 1)]);<NEW_LINE>UnresolvedTypeData typeData = new UnresolvedTypeData(typeName, isAnnotation, new SourceRange(typeStart, typeName.length()));<NEW_LINE>new TypeSearch().searchForTypes(compilationUnit, Collections.singletonMap(typeName, typeData), monitor);<NEW_LINE>List<TypeNameMatch> typesFound = typeData.getFoundInfos();<NEW_LINE>if (typesFound.isEmpty()) {<NEW_LINE>fStatus = JavaUIStatus.createError(IStatus.ERROR, CodeGenerationMessages.bind(CodeGenerationMessages.AddImportsOperation_error_notresolved_message, BasicElementLabels.getJavaElementName(typeName)), null);<NEW_LINE>throw new OperationCanceledException();<NEW_LINE>}<NEW_LINE>TypeNameMatch choice = typeQuery.chooseImport(typesFound.toArray(new TypeNameMatch[typesFound.<MASK><NEW_LINE>if (choice == null)<NEW_LINE>throw new OperationCanceledException();<NEW_LINE>return choice;<NEW_LINE>} | size()]), typeName); |
609,904 | public void deleteById(String id) {<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 serverName = Utils.getValueFromIdByName(id, "servers");<NEW_LINE>if (serverName == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'servers'.", id)));<NEW_LINE>}<NEW_LINE>String virtualNetworkRuleName = Utils.getValueFromIdByName(id, "virtualNetworkRules");<NEW_LINE>if (virtualNetworkRuleName == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'virtualNetworkRules'.", id)));<NEW_LINE>}<NEW_LINE>this.delete(resourceGroupName, <MASK><NEW_LINE>} | serverName, virtualNetworkRuleName, Context.NONE); |
16,796 | private void initializeButtons() {<NEW_LINE>SVGGlyph full = new SVGGlyph(0, "FULLSCREEN", "M598 214h212v212h-84v-128h-128v-84zM726 726v-128h84v212h-212v-84h128zM214 426v-212h212v84h-128v128h-84zM298 598v128h128v84h-212v-212h84z", Color.WHITE);<NEW_LINE>full.setSize(16, 16);<NEW_LINE>SVGGlyph minus = new SVGGlyph(0, "MINUS", "M804.571 420.571v109.714q0 22.857-16 38.857t-38.857 16h-694.857q-22.857 0-38.857-16t-16-38.857v-109.714q0-22.857 16-38.857t38.857-16h694.857q22.857 0 38.857 16t16 38.857z", Color.WHITE);<NEW_LINE>minus.setSize(12, 2);<NEW_LINE>minus.setTranslateY(4);<NEW_LINE>SVGGlyph resizeMax = new SVGGlyph(0, "RESIZE_MAX", "M726 810v-596h-428v596h428zM726 44q34 0 59 25t25 59v768q0 34-25 60t-59 26h-428q-34 0-59-26t-25-60v-768q0-34 25-60t59-26z", Color.WHITE);<NEW_LINE>resizeMax.setSize(12, 12);<NEW_LINE>SVGGlyph resizeMin = new SVGGlyph(0, "RESIZE_MIN", "M80.842 943.158v-377.264h565.894v377.264h-565.894zM0 404.21v619.79h727.578v-619.79h-727.578zM377.264 161.684h565.894v377.264h-134.736v80.842h215.578v-619.79h-727.578v323.37h80.842v-161.686z", Color.WHITE);<NEW_LINE>resizeMin.setSize(12, 12);<NEW_LINE>SVGGlyph close = new SVGGlyph(0, <MASK><NEW_LINE>close.setSize(12, 12);<NEW_LINE>btnFull = new JFXButton();<NEW_LINE>btnFull.getStyleClass().add("jfx-decorator-button");<NEW_LINE>btnFull.setCursor(Cursor.HAND);<NEW_LINE>btnFull.setOnAction((action) -> primaryStage.setFullScreen(!primaryStage.isFullScreen()));<NEW_LINE>btnFull.setGraphic(full);<NEW_LINE>btnFull.setTranslateX(-30);<NEW_LINE>btnFull.setRipplerFill(Color.WHITE);<NEW_LINE>btnClose = new JFXButton();<NEW_LINE>btnClose.getStyleClass().add("jfx-decorator-button");<NEW_LINE>btnClose.setCursor(Cursor.HAND);<NEW_LINE>btnClose.setOnAction((action) -> onCloseButtonAction.get().run());<NEW_LINE>btnClose.setGraphic(close);<NEW_LINE>btnClose.setRipplerFill(Color.WHITE);<NEW_LINE>btnMin = new JFXButton();<NEW_LINE>btnMin.getStyleClass().add("jfx-decorator-button");<NEW_LINE>btnMin.setCursor(Cursor.HAND);<NEW_LINE>btnMin.setOnAction((action) -> primaryStage.setIconified(true));<NEW_LINE>btnMin.setGraphic(minus);<NEW_LINE>btnMin.setRipplerFill(Color.WHITE);<NEW_LINE>btnMax = new JFXButton();<NEW_LINE>btnMax.getStyleClass().add("jfx-decorator-button");<NEW_LINE>btnMax.setCursor(Cursor.HAND);<NEW_LINE>btnMax.setRipplerFill(Color.WHITE);<NEW_LINE>btnMax.setOnAction((action) -> maximize(resizeMin, resizeMax));<NEW_LINE>btnMax.setGraphic(resizeMax);<NEW_LINE>} | "CLOSE", "M810 274l-238 238 238 238-60 60-238-238-238 238-60-60 238-238-238-238 60-60 238 238 238-238z", Color.WHITE); |
1,328,836 | public PresentationMLPackage createSmartArtPkg(SlideSizesWellKnown sz, boolean landscape, Document xml) throws Exception {<NEW_LINE>// Create skeletal package, including a MainPresentationPart and a SlideLayoutPart<NEW_LINE>PresentationMLPackage pMLPackage = PresentationMLPackage.createPackage(sz, landscape);<NEW_LINE>// Need references to these parts to create a slide<NEW_LINE>// Please note that these parts *already exist* - they are<NEW_LINE>// created by createPackage() above. See that method<NEW_LINE>// for instruction on how to create and add a part.<NEW_LINE>MainPresentationPart pp = (MainPresentationPart) pMLPackage.getParts().getParts().get(new PartName("/ppt/presentation.xml"));<NEW_LINE>SlideLayoutPart layoutPart = (SlideLayoutPart) pMLPackage.getParts().getParts().get(new PartName("/ppt/slideLayouts/slideLayout1.xml"));<NEW_LINE>// OK, now we can create a slide<NEW_LINE>SlidePart slidePart = pMLPackage.createSlidePart(pp, layoutPart, new PartName("/ppt/slides/slide1.xml"));<NEW_LINE>// Layout part<NEW_LINE>DiagramLayoutPart layout = new DiagramLayoutPart(new PartName("/ppt/diagrams.layout1.xml"));<NEW_LINE>layout.setJaxbElement(diagramLayoutObj);<NEW_LINE>DiagramColorsPart colors = new DiagramColorsPart(new PartName("/ppt/diagrams.colors1.xml"));<NEW_LINE>colors.unmarshal("colorsDef-accent1_2.xml");<NEW_LINE>// colors.CreateMinimalContent("mycolors");<NEW_LINE>DiagramStylePart style = new DiagramStylePart(new PartName("/ppt/diagrams.quickStyle1.xml"));<NEW_LINE>style.unmarshal("quickStyle-simple1.xml");<NEW_LINE>// style.CreateMinimalContent("mystyle");<NEW_LINE>// DiagramDataPart<NEW_LINE>DiagramDataPart data = new <MASK><NEW_LINE>// otherwise we need to pass pkg around<NEW_LINE>data.setPackage(pMLPackage);<NEW_LINE>data.setJaxbElement(createDiagramData(data, xml));<NEW_LINE>String layoutRelId = slidePart.addTargetPart(layout).getId();<NEW_LINE>String dataRelId = slidePart.addTargetPart(data).getId();<NEW_LINE>String colorsRelId = slidePart.addTargetPart(colors).getId();<NEW_LINE>String styleRelId = slidePart.addTargetPart(style).getId();<NEW_LINE>// Create and add graphicFrame for SmartArt<NEW_LINE>Presentation.SldSz tmpSldSz = pMLPackage.getMainPresentationPart().getJaxbElement().getSldSz();<NEW_LINE>CTGraphicalObjectFrame graphicFrame = createSmartArt(layoutRelId, dataRelId, colorsRelId, styleRelId, "" + (tmpSldSz.getCx() - 200000), "" + (tmpSldSz.getCy() - 1000000));<NEW_LINE>// A bit smaller, so we can have a margin around the edge<NEW_LINE>slidePart.getJaxbElement().getCSld().getSpTree().getSpOrGrpSpOrGraphicFrame().add(graphicFrame);<NEW_LINE>return pMLPackage;<NEW_LINE>} | DiagramDataPart(new PartName("/ppt/diagrams.data1.xml")); |
419,971 | private CompletionStage<Void> createHistoryRecords(int startingSegmentNumber, CreateStreamResponse createStreamResponse, OperationContext context) {<NEW_LINE>Preconditions.checkNotNull(context, "operation context cannot be null");<NEW_LINE>final int numSegments = createStreamResponse.getConfiguration().getScalingPolicy().getMinNumSegments();<NEW_LINE>// create epoch 0 record<NEW_LINE>final double keyRangeChunk = 1.0 / numSegments;<NEW_LINE>long creationTime = createStreamResponse.getTimestamp();<NEW_LINE>final ImmutableList.Builder<StreamSegmentRecord> builder = ImmutableList.builder();<NEW_LINE>IntStream.range(0, numSegments).boxed().forEach(x -> builder.add(newSegmentRecord(0, startingSegmentNumber + x, creationTime, x * keyRangeChunk, (x + 1) * keyRangeChunk)));<NEW_LINE>EpochRecord epoch0 = new EpochRecord(0, 0, builder.build(<MASK><NEW_LINE>return createEpochRecord(epoch0, context).thenCompose(r -> createHistoryChunk(epoch0, context)).thenCompose(r -> createSealedSegmentSizeMapShardIfAbsent(0, context)).thenCompose(r -> createRetentionSetDataIfAbsent(new RetentionSet(ImmutableList.of()), context)).thenCompose(r -> createCurrentEpochRecordDataIfAbsent(epoch0, context));<NEW_LINE>} | ), creationTime, 0L, 0L); |
998,062 | /*<NEW_LINE>* pushContextData - save all the current context data and ClassLoader into the current servlet's ServiceWrapper.<NEW_LINE>* These will be transferred to the next dispatch/Runnable servlet's ServiceWrapper<NEW_LINE>*/<NEW_LINE>@SuppressWarnings("deprecation")<NEW_LINE>public void pushContextData() {<NEW_LINE>if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINEST)) {<NEW_LINE>logger.entering(CLASS_NAME, "pushContextData", this);<NEW_LINE>}<NEW_LINE>// will want to run on the calling thread's class loader<NEW_LINE>this.newCL = AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public ClassLoader run() {<NEW_LINE>ClassLoader old = Thread.currentThread().getContextClassLoader();<NEW_LINE>return old;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINEST)) {<NEW_LINE>logger.logp(Level.FINEST, CLASS_NAME, "pushContextData", "thread context class loader [" + this.newCL + "]");<NEW_LINE>}<NEW_LINE>this.contextData = new HashMap();<NEW_LINE>// push data for other components that we already have hooks into<NEW_LINE>ComponentMetaDataAccessorImpl cmdai = ComponentMetaDataAccessorImpl.getComponentMetaDataAccessor();<NEW_LINE>ComponentMetaData cmd = cmdai.getComponentMetaData();<NEW_LINE>if (cmd != null) {<NEW_LINE>this.contextData.put(ComponentMetaData, cmd);<NEW_LINE>}<NEW_LINE>// each producer service of the Transfer service is accessed in order to get the thread context data<NEW_LINE>Iterator<ITransferContextService> TransferIterator = com.ibm.ws.webcontainer<MASK><NEW_LINE>if (TransferIterator != null) {<NEW_LINE>while (TransferIterator.hasNext()) {<NEW_LINE>ITransferContextService tcs = TransferIterator.next();<NEW_LINE>if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINEST)) {<NEW_LINE>logger.logp(Level.FINEST, CLASS_NAME, "pushContextData", "calling storeState on: " + tcs);<NEW_LINE>}<NEW_LINE>tcs.storeState(this.contextData);<NEW_LINE>asyncContext.storeStateCtxData = this.contextData;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINEST)) {<NEW_LINE>logger.logp(Level.FINEST, CLASS_NAME, "pushContextData", "no implmenting services found");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINEST)) {<NEW_LINE>logger.exiting(CLASS_NAME, "pushContextData", this);<NEW_LINE>}<NEW_LINE>} | .osgi.WebContainer.getITransferContextServices(); |
61,585 | public int read(byte[] b, int off, int len) throws IOException {<NEW_LINE>int r = 0;<NEW_LINE>if (patch != null && streamPos < patchPos + patch.length) {<NEW_LINE>if (streamPos < patchPos) {<NEW_LINE>r = iis.read(b, off, (int) Math.min(patchPos - streamPos, len));<NEW_LINE>if (r < 0)<NEW_LINE>return r;<NEW_LINE>streamPos += r;<NEW_LINE>if (streamPos < patchPos)<NEW_LINE>return r;<NEW_LINE>off += r;<NEW_LINE>len -= r;<NEW_LINE>}<NEW_LINE>int index = (int) (patchPos - streamPos);<NEW_LINE>int r2 = (int) Math.min(<MASK><NEW_LINE>System.arraycopy(patch, index, b, off, r2);<NEW_LINE>streamPos += r2;<NEW_LINE>r += r2;<NEW_LINE>off += r2;<NEW_LINE>len -= r2;<NEW_LINE>}<NEW_LINE>if (len > 0) {<NEW_LINE>int r3 = iis.read(b, off, len);<NEW_LINE>if (r3 < 0)<NEW_LINE>return r3;<NEW_LINE>streamPos += r3;<NEW_LINE>r += r3;<NEW_LINE>}<NEW_LINE>return r;<NEW_LINE>} | patch.length - index, len); |
710,667 | public void actionPerformed(final ActionEvent e) {<NEW_LINE>final FilterController filterController = FilterController.getCurrentFilterController();<NEW_LINE>final Controller controller = Controller.getCurrentController();<NEW_LINE>IMapSelection selection = controller.getSelection();<NEW_LINE>final NodeModel start = selection.getSelected();<NEW_LINE>final IMapViewManager mapViewManager = controller.getMapViewManager();<NEW_LINE>Filter filter = selection.getFilter();<NEW_LINE>final NodeModel next = filterController.findNext(start, null, direction, null, filter);<NEW_LINE>if (next != null) {<NEW_LINE>final MapController mapController = Controller.getCurrentModeController().getMapController();<NEW_LINE>if (!next.hasVisibleContent(filter)) {<NEW_LINE>filter.getFilterInfo(next).reset();<NEW_LINE>mapController.nodeRefresh(next);<NEW_LINE>}<NEW_LINE>final NodeModel[] path = next.getPathToRoot();<NEW_LINE>for (int i = 1; i < path.length; i++) {<NEW_LINE>final NodeModel nodeOnPath = path[i];<NEW_LINE>final <MASK><NEW_LINE>if (parentNode.isFolded())<NEW_LINE>mapController.showNextChild(parentNode);<NEW_LINE>else {<NEW_LINE>if (mapViewManager.isChildHidden(nodeOnPath)) {<NEW_LINE>mapController.showNextChild(parentNode);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Controller.getCurrentController().getSelection().selectAsTheOnlyOneSelected(next);<NEW_LINE>}<NEW_LINE>} | NodeModel parentNode = nodeOnPath.getParentNode(); |
1,003,181 | public static void main(String[] args) throws XGBoostError {<NEW_LINE>// this is the only difference, add a # followed by a cache prefix name<NEW_LINE>// several cache file with the prefix will be generated<NEW_LINE>// currently only support convert from libsvm file<NEW_LINE>DMatrix trainMat = new DMatrix("../../demo/data/agaricus.txt.train#dtrain.cache");<NEW_LINE>DMatrix testMat = new DMatrix("../../demo/data/agaricus.txt.test#dtest.cache");<NEW_LINE>// specify parameters<NEW_LINE>HashMap<String, Object> params = new HashMap<String, Object>();<NEW_LINE>params.put("eta", 1.0);<NEW_LINE>params.put("max_depth", 2);<NEW_LINE>params.put("silent", 1);<NEW_LINE>params.put("objective", "binary:logistic");<NEW_LINE>// performance notice: set nthread to be the number of your real cpu<NEW_LINE>// some cpu offer two threads per core, for example, a 4 core cpu with 8 threads, in such case<NEW_LINE>// set nthread=4<NEW_LINE>// param.put("nthread", num_real_cpu);<NEW_LINE>// specify watchList<NEW_LINE>HashMap<String, DMatrix> watches = new HashMap<String, DMatrix>();<NEW_LINE><MASK><NEW_LINE>watches.put("test", testMat);<NEW_LINE>// set round<NEW_LINE>int round = 2;<NEW_LINE>// train a boost model<NEW_LINE>Booster booster = XGBoost.train(trainMat, params, round, watches, null, null);<NEW_LINE>} | watches.put("train", trainMat); |
1,385,236 | final ListTagsForResourceResult executeListTagsForResource(ListTagsForResourceRequest listTagsForResourceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listTagsForResourceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListTagsForResourceRequest> request = null;<NEW_LINE>Response<ListTagsForResourceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListTagsForResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listTagsForResourceRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "MediaTailor");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListTagsForResource");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListTagsForResourceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListTagsForResourceResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden()); |
33,378 | private static JSStackTraceElement processJSFrame(RootNode rootNode, Node node, Object thisObj, JSFunctionObject functionObj, boolean inStrictMode, boolean inNashornMode, boolean async, int promiseIndex) {<NEW_LINE>Node callNode = node;<NEW_LINE>while (callNode.getSourceSection() == null) {<NEW_LINE>callNode = callNode.getParent();<NEW_LINE>}<NEW_LINE>SourceSection callNodeSourceSection = callNode.getSourceSection();<NEW_LINE>Source source = callNodeSourceSection.getSource();<NEW_LINE>TruffleString fileName = getFileName(source);<NEW_LINE>TruffleString functionName;<NEW_LINE>if (JSFunction.isBuiltin(functionObj)) {<NEW_LINE>functionName = JSFunction.getName(functionObj);<NEW_LINE>} else if (rootNode instanceof FunctionRootNode) {<NEW_LINE>functionName = ((<MASK><NEW_LINE>} else {<NEW_LINE>functionName = Strings.fromJavaString(rootNode.getName());<NEW_LINE>}<NEW_LINE>boolean eval = false;<NEW_LINE>if (isEvalSource(source)) {<NEW_LINE>functionName = Strings.EVAL;<NEW_LINE>eval = true;<NEW_LINE>} else if (functionName == null || isInternalFunctionName(functionName)) {<NEW_LINE>functionName = Strings.EMPTY_STRING;<NEW_LINE>}<NEW_LINE>SourceSection targetSourceSection = null;<NEW_LINE>if (!inNashornMode) {<NEW_LINE>// for V8<NEW_LINE>if (callNode instanceof JavaScriptFunctionCallNode) {<NEW_LINE>Node target = ((JavaScriptFunctionCallNode) callNode).getTarget();<NEW_LINE>targetSourceSection = target == null ? null : target.getSourceSection();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>boolean global = (JSRuntime.isNullOrUndefined(thisObj) && !JSFunction.isStrict(functionObj)) || isGlobalObject(thisObj, JSFunction.getRealm(functionObj));<NEW_LINE>return new JSStackTraceElement(fileName, functionName, callNodeSourceSection, thisObj, functionObj, targetSourceSection, inStrictMode, eval, global, inNashornMode, async, promiseIndex);<NEW_LINE>} | FunctionRootNode) rootNode).getNameTString(); |
524,515 | private void initTransient() {<NEW_LINE>if (isInitialized) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>SdkComponents components = SdkComponents.create();<NEW_LINE>pipelineOptions = new SerializablePipelineOptions(serializedOptions).get();<NEW_LINE>DoFnWithExecutionInformation doFnWithExecutionInformation = (DoFnWithExecutionInformation) SerializableUtils.deserializeFromByteArray(doFnwithExBytes, "Custom Coder Bytes");<NEW_LINE>this.doFn = (DoFn<InputT, OutputT>) doFnWithExecutionInformation.getDoFn();<NEW_LINE>this.mainOutput = (TupleTag<OutputT>) doFnWithExecutionInformation.getMainOutputTag();<NEW_LINE>this.sideInputMapping = doFnWithExecutionInformation.getSideInputMapping();<NEW_LINE>this.doFnSchemaInformation = doFnWithExecutionInformation.getSchemaInformation();<NEW_LINE>inputCoder = (Coder<InputT>) SerializableUtils.deserializeFromByteArray(coderBytes, "Custom Coder Bytes");<NEW_LINE>windowStrategyProto = RunnerApi.MessageWithComponents.parseFrom(windowBytes);<NEW_LINE>windowingStrategy = (WindowingStrategy<?, ?>) WindowingStrategyTranslation.fromProto(windowStrategyProto.getWindowingStrategy(), RehydratedComponents.forComponents(components.toComponents()));<NEW_LINE>sideInputs = new HashMap<>();<NEW_LINE>for (Map.Entry<String, byte[]> entry : sideInputBytes.entrySet()) {<NEW_LINE>windowStrategyProto = RunnerApi.MessageWithComponents.parseFrom(entry.getValue());<NEW_LINE>sideInputs.put(new TupleTag<>(entry.getKey()), WindowingStrategyTranslation.fromProto(windowStrategyProto.getWindowingStrategy(), RehydratedComponents.forComponents(components.toComponents())));<NEW_LINE>}<NEW_LINE>} catch (InvalidProtocolBufferException e) {<NEW_LINE>LOG.<MASK><NEW_LINE>}<NEW_LINE>outputCoders = new HashMap<>();<NEW_LINE>for (Map.Entry<String, byte[]> entry : outputCodersBytes.entrySet()) {<NEW_LINE>outputCoders.put(new TupleTag<>(entry.getKey()), (Coder<?>) SerializableUtils.deserializeFromByteArray(entry.getValue(), "Custom Coder Bytes"));<NEW_LINE>}<NEW_LINE>sideOutputs = new ArrayList<>();<NEW_LINE>for (String sideOutput : serializedSideOutputs) {<NEW_LINE>sideOutputs.add(new TupleTag<>(sideOutput));<NEW_LINE>}<NEW_LINE>outputMap = new HashMap<>();<NEW_LINE>for (Map.Entry<String, Integer> entry : serializedOutputMap.entrySet()) {<NEW_LINE>outputMap.put(new TupleTag<>(entry.getKey()), entry.getValue());<NEW_LINE>}<NEW_LINE>outputManager = new DoFnOutputManager(this.outputMap);<NEW_LINE>this.isInitialized = true;<NEW_LINE>} | info(e.getMessage()); |
1,163,172 | private static BlockEntry readEntry(SliceInput data, BlockEntry previousEntry) {<NEW_LINE>requireNonNull(data, "data is null");<NEW_LINE>// read entry header<NEW_LINE>int sharedKeyLength = VariableLengthQuantity.readVariableLengthInt(data);<NEW_LINE>int nonSharedKeyLength = VariableLengthQuantity.readVariableLengthInt(data);<NEW_LINE>int valueLength = VariableLengthQuantity.readVariableLengthInt(data);<NEW_LINE>// read key<NEW_LINE>final Slice key;<NEW_LINE>if (sharedKeyLength > 0) {<NEW_LINE>key = Slices.allocate(sharedKeyLength + nonSharedKeyLength);<NEW_LINE>SliceOutput sliceOutput = key.output();<NEW_LINE>checkState(previousEntry != null, "Entry has a shared key but no previous entry was provided");<NEW_LINE>sliceOutput.writeBytes(previousEntry.getKey(), 0, sharedKeyLength);<NEW_LINE>sliceOutput.writeBytes(data, nonSharedKeyLength);<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>// read value<NEW_LINE>Slice value = data.readSlice(valueLength);<NEW_LINE>return new BlockEntry(key, value);<NEW_LINE>} | key = data.readSlice(nonSharedKeyLength); |
736,721 | public static boolean writeConfiguration(ApdConfiguration apdConfiguration) throws IOException {<NEW_LINE>Common.logger.add(new LogEntry(LogEntry.PB_LOG_DEBUG, "Start"));<NEW_LINE>if (apdConfiguration == null) {<NEW_LINE>Common.logger.add(new LogEntry(LogEntry.PB_LOG_ERROR, "apdConfiguration not valid"));<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>FileWriter apdConfigFileWriter = null;<NEW_LINE>BufferedWriter fileBufferedWriter = null;<NEW_LINE>// Carry out some sanity check on the configuration passed as parameter<NEW_LINE>if ((apdConfiguration.getFormatPath() == null) || (apdConfiguration.getFormatPath().length() == 0))<NEW_LINE>apdConfiguration.setFormatPath(ApdEngine.DEFAULT_FORMAT_PATH);<NEW_LINE>if ((apdConfiguration.getTemplatePath() == null) || (apdConfiguration.getTemplatePath().length() == 0))<NEW_LINE><MASK><NEW_LINE>if ((apdConfiguration.getLabelIdPath() == null) || (apdConfiguration.getLabelIdPath().length() == 0))<NEW_LINE>apdConfiguration.setTemplatePath(ApdEngine.DEFAULT_ID_PATH);<NEW_LINE>File apdConfigFile = new File(APD_CONFIGURATION_FILE);<NEW_LINE>apdConfigFile.delete();<NEW_LINE>apdConfigFileWriter = new FileWriter(apdConfigFile);<NEW_LINE>fileBufferedWriter = new BufferedWriter(apdConfigFileWriter);<NEW_LINE>fileBufferedWriter.write("<apdconfiguration>\r\n");<NEW_LINE>fileBufferedWriter.write("\t<path ");<NEW_LINE>fileBufferedWriter.write("formats=\"" + (apdConfiguration.getFormatPath() == null ? "" : apdConfiguration.getFormatPath()) + "\"\r\n");<NEW_LINE>fileBufferedWriter.write("\t\ttemplates=\"" + (apdConfiguration.getTemplatePath() == null ? "" : apdConfiguration.getTemplatePath()) + "\"\r\n");<NEW_LINE>fileBufferedWriter.write("\t\tidlabels=\"" + (apdConfiguration.getLabelIdPath() == null ? "" : apdConfiguration.getLabelIdPath()) + "\" />\r\n");<NEW_LINE>fileBufferedWriter.write("\t<printer ");<NEW_LINE>fileBufferedWriter.write("bluetooth=\"" + (apdConfiguration.getBtMac() == null ? "" : apdConfiguration.getBtMac()) + "\"\r\n");<NEW_LINE>fileBufferedWriter.write("\tid=\"" + apdConfiguration.getId() + "\"\r\n");<NEW_LINE>fileBufferedWriter.write("\tipaddress=\"" + (apdConfiguration.getIpAddress() == null ? "" : apdConfiguration.getIpAddress()) + "\"\r\n");<NEW_LINE>fileBufferedWriter.write("\tipport=\"" + apdConfiguration.getIpPort() + "\"\r\n");<NEW_LINE>fileBufferedWriter.write(// 65 = ASCII code of 'A'<NEW_LINE>"\tlanguage=\"" + (apdConfiguration.getLanguage() == null ? "" : String.valueOf((char) (apdConfiguration.getLanguage().ordinal() + 65)) + "\"\r\n"));<NEW_LINE>fileBufferedWriter.write("\tmessage=\"" + apdConfiguration.getMessage() + "\"\r\n");<NEW_LINE>fileBufferedWriter.write("\tmodel=\"" + apdConfiguration.getModel() + "\"\r\n");<NEW_LINE>fileBufferedWriter.write("\ttransport=\"" + apdConfiguration.getTransport().ordinal() + "\"/>\r\n");<NEW_LINE>fileBufferedWriter.write("</apdconfiguration>\r\n");<NEW_LINE>fileBufferedWriter.flush();<NEW_LINE>fileBufferedWriter.close();<NEW_LINE>Common.logger.add(new LogEntry(LogEntry.PB_LOG_INFO, "apdconfig.xml written succesfully"));<NEW_LINE>Common.logger.add(new LogEntry(LogEntry.PB_LOG_DEBUG, "End"));<NEW_LINE>return true;<NEW_LINE>} | apdConfiguration.setTemplatePath(ApdEngine.DEFAULT_TEMPLATE_PATH); |
1,702,508 | private void mapTierBulksMapped(final int upToBulkIndex) throws IOException {<NEW_LINE>final int firstBulkToMapIndex = tierBulkOffsets.size();<NEW_LINE>final int bulksToMap = upToBulkIndex + 1 - firstBulkToMapIndex;<NEW_LINE>long mapSize = bulksToMap * tierBulkSizeInBytes;<NEW_LINE>final long mappingOffsetInFile, firstBulkToMapOffsetWithinMapping;<NEW_LINE>final long firstBulkToMapOffset = bulkOffset(firstBulkToMapIndex);<NEW_LINE>if (OS.mapAlign(firstBulkToMapOffset) == firstBulkToMapOffset) {<NEW_LINE>mappingOffsetInFile = firstBulkToMapOffset;<NEW_LINE>firstBulkToMapOffsetWithinMapping = 0;<NEW_LINE>} else {<NEW_LINE>// If the bulk was allocated on OS with 4K mapping granularity (linux) and we<NEW_LINE>// are mapping it in OS with 64K mapping granularity (windows), we might need to<NEW_LINE>// start the mapping earlier than the first tier to map actually starts<NEW_LINE>mappingOffsetInFile = OS.mapAlign(firstBulkToMapOffset) - OS.mapAlignment();<NEW_LINE>firstBulkToMapOffsetWithinMapping = firstBulkToMapOffset - mappingOffsetInFile;<NEW_LINE>// Now might need to have bigger mapSize<NEW_LINE>mapSize += firstBulkToMapOffsetWithinMapping;<NEW_LINE>}<NEW_LINE>// mapping by hand, because MappedFile/MappedBytesStore doesn't allow to create a BS<NEW_LINE>// which starts not from the beginning of the file, but has start() of 0<NEW_LINE>final BytesStore extraStore = map(mapSize, mappingOffsetInFile);<NEW_LINE>appendBulkData(<MASK><NEW_LINE>} | firstBulkToMapIndex, upToBulkIndex, extraStore, firstBulkToMapOffsetWithinMapping); |
1,628,395 | public boolean continueSearching(Usericon icon) {<NEW_LINE>// Addon icons should always be ignored (inserted afterwards)<NEW_LINE>if (icon.type == Usericon.Type.ADDON) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>// No required badge type defined, so just check Usericon type<NEW_LINE>if (this.reqBadgeType.isEmpty()) {<NEW_LINE>return icon.type == this.reqType;<NEW_LINE>}<NEW_LINE>// Icon doesn't have a badge type, so might be e.g. a fallback icon<NEW_LINE>// that's not of type TWITCH, so check type according to id<NEW_LINE>if (icon.badgeType.isEmpty()) {<NEW_LINE>return icon.type == Usericon.typeFromBadgeId(reqBadgeType.id);<NEW_LINE>}<NEW_LINE>if (icon.type == Usericon.Type.TWITCH || icon.type == Usericon.Type.OTHER) {<NEW_LINE>return reqType == icon.type && <MASK><NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | reqBadgeType.matchesLenient(icon.badgeType); |
1,252,483 | public ListOriginEndpointsResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ListOriginEndpointsResult listOriginEndpointsResult = new ListOriginEndpointsResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return listOriginEndpointsResult;<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("nextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listOriginEndpointsResult.setNextToken(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("originEndpoints", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listOriginEndpointsResult.setOriginEndpoints(new ListUnmarshaller<OriginEndpoint>(OriginEndpointJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return listOriginEndpointsResult;<NEW_LINE>} | JsonToken token = context.getCurrentToken(); |
667,520 | static void encryptDataForMessaging() throws UnsupportedEncodingException, NullArgumentException, SecureMessageWrapException {<NEW_LINE>String message = "hello from alice to bob";<NEW_LINE>System.out.println("Running SecureMessage example");<NEW_LINE>Keypair alice = KeypairGenerator.generateKeypair(AsymmetricKey.KEYTYPE_EC);<NEW_LINE>PrivateKey alicePrivateKey = alice.getPrivateKey();<NEW_LINE>PublicKey alicePublicKey = alice.getPublicKey();<NEW_LINE>Keypair bob = KeypairGenerator.generateKeypair(AsymmetricKey.KEYTYPE_EC);<NEW_LINE>PrivateKey bobPrivateKey = bob.getPrivateKey();<NEW_LINE>PublicKey bobPublicKey = bob.getPublicKey();<NEW_LINE>System.out.println("alicePrivateKey = " + Arrays.toString(alicePrivateKey.toByteArray()));<NEW_LINE>System.out.println("alicePublicKey = " + Arrays.toString<MASK><NEW_LINE>System.out.println("bobPrivateKey = " + Arrays.toString(bobPrivateKey.toByteArray()));<NEW_LINE>System.out.println("bobPublicKey = " + Arrays.toString(bobPublicKey.toByteArray()));<NEW_LINE>final SecureMessage aliceSM = new SecureMessage(alicePrivateKey, bobPublicKey);<NEW_LINE>byte[] wrappedMessage = aliceSM.wrap(message.getBytes(charset));<NEW_LINE>String encodedMessage = Base64.getEncoder().encodeToString(wrappedMessage);<NEW_LINE>System.out.println("EncodedMessage = " + encodedMessage);<NEW_LINE>final SecureMessage bobSM = new SecureMessage(bobPrivateKey, alicePublicKey);<NEW_LINE>byte[] wrappedMessageFromB64 = Base64.getDecoder().decode(encodedMessage);<NEW_LINE>String decodedMessage = new String(bobSM.unwrap(wrappedMessageFromB64), charset);<NEW_LINE>System.out.println("DecodedMessage = " + decodedMessage);<NEW_LINE>} | (alicePublicKey.toByteArray())); |
1,457,748 | final CreateTapeWithBarcodeResult executeCreateTapeWithBarcode(CreateTapeWithBarcodeRequest createTapeWithBarcodeRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createTapeWithBarcodeRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateTapeWithBarcodeRequest> request = null;<NEW_LINE>Response<CreateTapeWithBarcodeResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateTapeWithBarcodeRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createTapeWithBarcodeRequest));<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, "Storage Gateway");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateTapeWithBarcode");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateTapeWithBarcodeResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateTapeWithBarcodeResultJsonUnmarshaller());<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); |
923,645 | public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {<NEW_LINE>super.onCreateContextMenu(menu, v, menuInfo);<NEW_LINE>final ListView list = (ListView) v;<NEW_LINE>final AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo) menuInfo;<NEW_LINE>final int position = info.position;<NEW_LINE>final Object object = list.getAdapter().getItem(position);<NEW_LINE>menu.add(R.string.load_file);<NEW_LINE>menu.add(R.string.share_file);<NEW_LINE>menu.add(R.string.delete_file);<NEW_LINE>menu.add(R.string.delete_all);<NEW_LINE>MenuItem.OnMenuItemClickListener listener = new MenuItem.OnMenuItemClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean onMenuItemClick(MenuItem item) {<NEW_LINE>contextItemSelected(item, (object == null) ? null : object.toString());<NEW_LINE>if (mLoadFileDialog != null && mLoadFileDialog.isShowing()) {<NEW_LINE>mLoadFileDialog.dismiss();<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>for (int i = 0, n = menu.size(); i < n; i++) menu.getItem<MASK><NEW_LINE>} | (i).setOnMenuItemClickListener(listener); |
1,043,306 | private String findPropertyName(Object bean, String key) {<NEW_LINE>if (bean == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Class<?> cls = bean.getClass();<NEW_LINE>int index = PropertyAccessorUtils.getFirstNestedPropertySeparatorIndex(key);<NEW_LINE>String prefix;<NEW_LINE>String suffix;<NEW_LINE>// If the property name is nested recurse down through the properties<NEW_LINE>// looking for a match.<NEW_LINE>if (index > 0) {<NEW_LINE>prefix = key.substring(0, index);<NEW_LINE>suffix = key.substring(index + 1, key.length());<NEW_LINE>String nestedName = findPropertyName(bean, prefix);<NEW_LINE>if (nestedName == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Object nestedValue = getPropertyValue(bean, nestedName);<NEW_LINE>String nestedPropertyName = findPropertyName(nestedValue, suffix);<NEW_LINE>return nestedPropertyName == null ? null : nestedName + "." + nestedPropertyName;<NEW_LINE>}<NEW_LINE>String name = null;<NEW_LINE>int distance = 0;<NEW_LINE>index = key.indexOf(PropertyAccessor.PROPERTY_KEY_PREFIX_CHAR);<NEW_LINE>if (index > 0) {<NEW_LINE>prefix = key.substring(0, index);<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>prefix = key;<NEW_LINE>suffix = "";<NEW_LINE>}<NEW_LINE>while (name == null && distance <= distanceLimit) {<NEW_LINE>String[] candidates = PropertyMatches.forProperty(prefix, cls, distance).getPossibleMatches();<NEW_LINE>// If we find precisely one match, then use that one...<NEW_LINE>if (candidates.length == 1) {<NEW_LINE>String candidate = candidates[0];<NEW_LINE>if (candidate.equals(prefix)) {<NEW_LINE>// if it's the same don't<NEW_LINE>// replace it...<NEW_LINE>name = key;<NEW_LINE>} else {<NEW_LINE>name = candidate + suffix;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>distance++;<NEW_LINE>}<NEW_LINE>return name;<NEW_LINE>} | suffix = key.substring(index); |
508,165 | private static void importTfOnnxSameDiff(OnnxFrameworkImporter onnxFrameworkImporter, TensorflowFrameworkImporter tensorflowFrameworkImporter, Framework framework, File inputFile, String inputFileNameMinusFormat, String format, File saveModelDir) throws IOException {<NEW_LINE>SameDiff sameDiff = null;<NEW_LINE>switch(framework) {<NEW_LINE>case ONNX:<NEW_LINE>case PYTORCH:<NEW_LINE>// filter out invalid files<NEW_LINE>if (format.equals("onnx"))<NEW_LINE>sameDiff = onnxFrameworkImporter.runImport(inputFile.getAbsolutePath(), Collections.emptyMap(), true);<NEW_LINE>break;<NEW_LINE>case TENSORFLOW:<NEW_LINE>if (format.equals("pb"))<NEW_LINE>sameDiff = tensorflowFrameworkImporter.runImport(inputFile.getAbsolutePath(), <MASK><NEW_LINE>break;<NEW_LINE>}<NEW_LINE>// reuse the same model name but with the samediff format<NEW_LINE>File saveModel = new File(saveModelDir, inputFileNameMinusFormat + ".fb");<NEW_LINE>if (sameDiff != null)<NEW_LINE>sameDiff.asFlatFile(saveModel, true);<NEW_LINE>else {<NEW_LINE>System.err.println("Skipping model " + inputFile.getAbsolutePath());<NEW_LINE>}<NEW_LINE>} | Collections.emptyMap(), true); |
1,837,157 | private void appendChildOrNull(ColumnBuilder childBuilder, Object listElement) {<NEW_LINE>if (listElement == null) {<NEW_LINE>childBuilder.appendNull();<NEW_LINE>} else if (listElement instanceof Integer) {<NEW_LINE>childBuilder.append((Integer) listElement);<NEW_LINE>} else if (listElement instanceof String) {<NEW_LINE>childBuilder.append((String) listElement);<NEW_LINE>} else if (listElement instanceof Double) {<NEW_LINE>childBuilder.append((Double) listElement);<NEW_LINE>} else if (listElement instanceof Float) {<NEW_LINE>childBuilder.append((Float) listElement);<NEW_LINE>} else if (listElement instanceof Boolean) {<NEW_LINE>childBuilder.append((Boolean) listElement);<NEW_LINE>} else if (listElement instanceof Long) {<NEW_LINE>childBuilder<MASK><NEW_LINE>} else if (listElement instanceof Byte) {<NEW_LINE>childBuilder.append((Byte) listElement);<NEW_LINE>} else if (listElement instanceof Short) {<NEW_LINE>childBuilder.append((Short) listElement);<NEW_LINE>} else if (listElement instanceof BigDecimal) {<NEW_LINE>childBuilder.append((BigDecimal) listElement);<NEW_LINE>} else if (listElement instanceof BigInteger) {<NEW_LINE>childBuilder.append((BigInteger) listElement);<NEW_LINE>} else if (listElement instanceof List) {<NEW_LINE>childBuilder.append((List<?>) listElement);<NEW_LINE>} else if (listElement instanceof StructData) {<NEW_LINE>childBuilder.append((StructData) listElement);<NEW_LINE>} else if (listElement instanceof byte[]) {<NEW_LINE>childBuilder.appendUTF8String((byte[]) listElement);<NEW_LINE>} else {<NEW_LINE>throw new IllegalStateException("Unexpected element type: " + listElement.getClass());<NEW_LINE>}<NEW_LINE>} | .append((Long) listElement); |
1,757,451 | public CreateThingResult createThing(CreateThingRequest createThingRequest) throws AmazonServiceException, AmazonClientException {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createThingRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateThingRequest> request = null;<NEW_LINE>Response<CreateThingResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateThingRequestMarshaller().marshall(createThingRequest);<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>Unmarshaller<CreateThingResult, JsonUnmarshallerContext> unmarshaller = new CreateThingResultJsonUnmarshaller();<NEW_LINE>JsonResponseHandler<CreateThingResult> responseHandler = new JsonResponseHandler<CreateThingResult>(unmarshaller);<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.ClientExecuteTime);<NEW_LINE>endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.endEvent(Field.RequestMarshallTime); |
760,724 | private String extractLockOwnerStackTrace(Lock lock) {<NEW_LINE>try {<NEW_LINE>Field syncField = lock.getClass().getDeclaredField("sync");<NEW_LINE>syncField.setAccessible(true);<NEW_LINE>Object sync = syncField.get(lock);<NEW_LINE>Method getOwner = sync.getClass().getSuperclass().getDeclaredMethod("getOwner");<NEW_LINE>getOwner.setAccessible(true);<NEW_LINE>final Thread owner = (Thread) getOwner.invoke(sync);<NEW_LINE>if (owner == null)<NEW_LINE>return null;<NEW_LINE>StringWriter stringWriter = new StringWriter();<NEW_LINE>PrintWriter printWriter = new PrintWriter(stringWriter);<NEW_LINE>printWriter.append("Owner thread : ").append(owner.toString()).append("\n");<NEW_LINE>StackTraceElement[<MASK><NEW_LINE>for (StackTraceElement traceElement : stackTrace) printWriter.println("\tat " + traceElement);<NEW_LINE>printWriter.flush();<NEW_LINE>return stringWriter.toString();<NEW_LINE>} catch (RuntimeException | NoSuchFieldException | IllegalAccessException | NoSuchMethodException | InvocationTargetException ignore) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} | ] stackTrace = owner.getStackTrace(); |
1,287,197 | protected Tuple3<Boolean, Double, Map<String, String>> detect(SlicedSelectedSample selection) throws Exception {<NEW_LINE>double[] data = new double[this.model.nx];<NEW_LINE>if (isVector) {<NEW_LINE>Vector vector = VectorUtil.getVector(selection.get(featureIdxs[0]));<NEW_LINE>if (vector instanceof SparseVector) {<NEW_LINE>SparseVector feature = (SparseVector) vector;<NEW_LINE>for (int i = 0; i < feature.getIndices().length; i++) {<NEW_LINE>data[feature.getIndices()[i]] = feature.getValues()[i];<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>Vector feature = (DenseVector) vector;<NEW_LINE>for (int i = 0; i < feature.size(); i++) {<NEW_LINE>data[i] = feature.get(i);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>for (int i = 0; i < this.featureIdxs.length; ++i) {<NEW_LINE>data[i] = ((Number) selection.get(this.featureIdxs[i])).doubleValue();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>double[] dataNe;<NEW_LINE>if (model.idxNonEqual.length != data.length) {<NEW_LINE>Integer[] indices = model.idxNonEqual;<NEW_LINE>dataNe = new double[indices.length];<NEW_LINE>for (int i = 0; i < indices.length; i++) {<NEW_LINE>if (Math.abs(model.stddevs[i]) > 1e-12) {<NEW_LINE>int idx = indices[i];<NEW_LINE>dataNe[i] = (data[idx] - model.means[i]<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>for (int i = 0; i < data.length; i++) {<NEW_LINE>if (Math.abs(model.stddevs[i]) > 1e-12) {<NEW_LINE>data[i] = (data[i] - model.means[i]) / model.stddevs[i];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>dataNe = data;<NEW_LINE>}<NEW_LINE>// predict the score.<NEW_LINE>double score = 0.;<NEW_LINE>for (int k = 0; k < model.p; ++k) {<NEW_LINE>double localScore = 0.;<NEW_LINE>for (int i = 0; i < dataNe.length; ++i) {<NEW_LINE>localScore += dataNe[i] * model.coef[k][i];<NEW_LINE>}<NEW_LINE>double temp = Math.pow(localScore, 2);<NEW_LINE>score += temp / model.lambda[k];<NEW_LINE>}<NEW_LINE>// result.set(0, new DenseVector(new double[] {score}));<NEW_LINE>double prob = 0;<NEW_LINE>return Tuple3.of(prob > threshold, prob, null);<NEW_LINE>} | ) / model.stddevs[i]; |
408,290 | private static void categorizeTreeRules(List<Pair<POMErrorFixBase, FileObject>> rules, FileObject rootFolder, DefaultMutableTreeNode rootNode) {<NEW_LINE>Map<FileObject, DefaultMutableTreeNode> dir2node = new HashMap<FileObject, DefaultMutableTreeNode>();<NEW_LINE><MASK><NEW_LINE>for (Pair<POMErrorFixBase, FileObject> pair : rules) {<NEW_LINE>POMErrorFixBase rule = pair.first();<NEW_LINE>FileObject fo = pair.second();<NEW_LINE>Object nonGuiObject = fo.getAttribute(NON_GUI);<NEW_LINE>boolean toGui = true;<NEW_LINE>if (nonGuiObject != null && nonGuiObject instanceof Boolean && ((Boolean) nonGuiObject).booleanValue()) {<NEW_LINE>toGui = false;<NEW_LINE>}<NEW_LINE>FileObject parent = fo.getParent();<NEW_LINE>DefaultMutableTreeNode category = dir2node.get(parent);<NEW_LINE>if (category == null) {<NEW_LINE>category = new DefaultMutableTreeNode(parent);<NEW_LINE>rootNode.add(category);<NEW_LINE>dir2node.put(parent, category);<NEW_LINE>}<NEW_LINE>if (toGui) {<NEW_LINE>category.add(new DefaultMutableTreeNode(rule, false));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | dir2node.put(rootFolder, rootNode); |
292,301 | private boolean deleteMissingMigrations() {<NEW_LINE>boolean removed = false;<NEW_LINE>for (MigrationInfo migrationInfo : migrationInfoService.all()) {<NEW_LINE>MigrationInfoImpl migrationInfoImpl = (MigrationInfoImpl) migrationInfo;<NEW_LINE>if (migrationInfo.getType().isSynthetic()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>AppliedMigration applied = migrationInfoImpl.getAppliedMigration();<NEW_LINE>MigrationState state = migrationInfoImpl.getState();<NEW_LINE>boolean isMigrationMissing = state == MigrationState.MISSING_SUCCESS || state == MigrationState.MISSING_FAILED || state == MigrationState.FUTURE_SUCCESS || state == MigrationState.FUTURE_FAILED;<NEW_LINE>boolean isMigrationIgnored = Arrays.stream(configuration.getIgnoreMigrationPatterns()).anyMatch(p -> p.matchesMigration(migrationInfoImpl.getVersion<MASK><NEW_LINE>if (isMigrationMissing && !isMigrationIgnored) {<NEW_LINE>schemaHistory.delete(applied);<NEW_LINE>removed = true;<NEW_LINE>repairResult.migrationsDeleted.add(CommandResultFactory.createRepairOutput(migrationInfo));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return removed;<NEW_LINE>} | () != null, state)); |
90,149 | public static Automaton repeat(Automaton a, int min, int max) {<NEW_LINE>if (min > max) {<NEW_LINE>return Automata.makeEmpty();<NEW_LINE>}<NEW_LINE>Automaton b;<NEW_LINE>if (min == 0) {<NEW_LINE>b = Automata.makeEmptyString();<NEW_LINE>} else if (min == 1) {<NEW_LINE>b = new Automaton();<NEW_LINE>b.copy(a);<NEW_LINE>} else {<NEW_LINE>List<Automaton> as = new ArrayList<>();<NEW_LINE>for (int i = 0; i < min; i++) {<NEW_LINE>as.add(a);<NEW_LINE>}<NEW_LINE>b = concatenate(as);<NEW_LINE>}<NEW_LINE>Set<Integer> prevAcceptStates = toSet(b, 0);<NEW_LINE>Automaton.Builder builder = new Automaton.Builder();<NEW_LINE>builder.copy(b);<NEW_LINE>for (int i = min; i < max; i++) {<NEW_LINE>int numStates = builder.getNumStates();<NEW_LINE>builder.copy(a);<NEW_LINE>for (int s : prevAcceptStates) {<NEW_LINE>builder.addEpsilon(s, numStates);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>return builder.finish();<NEW_LINE>} | prevAcceptStates = toSet(a, numStates); |
91,652 | static <// / @Generated("This method was generated using jOOQ-tools")<NEW_LINE>T1, T2, T3, T4, T5, T6, T7, T8, T9> Seq<Tuple9<T1, T2, T3, T4, T5, T6, T7, T8, T9>> crossJoin(Iterable<? extends T1> i1, Iterable<? extends T2> i2, Iterable<? extends T3> i3, Iterable<? extends T4> i4, Iterable<? extends T5> i5, Iterable<? extends T6> i6, Iterable<? extends T7> i7, Iterable<? extends T8> i8, Iterable<? extends T9> i9) {<NEW_LINE>return crossJoin(seq(i1), seq(i2), seq(i3), seq(i4), seq(i5), seq(i6), seq(i7), seq(<MASK><NEW_LINE>} | i8), seq(i9)); |
46,328 | public String order(Properties ctx, int WindowNo, GridTab mTab, GridField mField, Object value) {<NEW_LINE>Integer C_Order_ID = (Integer) value;<NEW_LINE>if (C_Order_ID == null || C_Order_ID.intValue() == 0)<NEW_LINE>return "";<NEW_LINE>// No Callout Active to fire dependent values<NEW_LINE>if (// prevent recursive<NEW_LINE>isCalloutActive())<NEW_LINE>return "";<NEW_LINE>// Get Details<NEW_LINE>MOrder order = new MOrder(ctx, C_Order_ID.intValue(), null);<NEW_LINE>if (order.get_ID() != 0) {<NEW_LINE>mTab.setValue("DateOrdered", order.getDateOrdered());<NEW_LINE>mTab.setValue("POReference", order.getPOReference());<NEW_LINE>mTab.setValue("AD_Org_ID", new Integer(order.getAD_Org_ID()));<NEW_LINE>mTab.setValue("AD_OrgTrx_ID", new Integer(order.getAD_OrgTrx_ID()));<NEW_LINE>mTab.setValue("C_Activity_ID", new Integer(order.getC_Activity_ID()));<NEW_LINE>mTab.setValue("C_Campaign_ID", new Integer(order.getC_Campaign_ID()));<NEW_LINE>mTab.setValue("C_Project_ID", new Integer(order.getC_Project_ID()));<NEW_LINE>mTab.setValue("User1_ID", new Integer(order.getUser1_ID()));<NEW_LINE>mTab.setValue("User2_ID", new Integer(order.getUser2_ID()));<NEW_LINE>mTab.setValue("User3_ID", new Integer(order.getUser3_ID()));<NEW_LINE>mTab.setValue("User4_ID", new Integer(order.getUser4_ID()));<NEW_LINE>mTab.setValue("M_Warehouse_ID", new Integer(order.getM_Warehouse_ID()));<NEW_LINE>//<NEW_LINE>mTab.setValue("DeliveryRule", order.getDeliveryRule());<NEW_LINE>mTab.setValue(<MASK><NEW_LINE>mTab.setValue("M_Shipper_ID", new Integer(order.getM_Shipper_ID()));<NEW_LINE>mTab.setValue("FreightCostRule", order.getFreightCostRule());<NEW_LINE>mTab.setValue("FreightAmt", order.getFreightAmt());<NEW_LINE>mTab.setValue("C_BPartner_ID", new Integer(order.getC_BPartner_ID()));<NEW_LINE>// [ 1867464 ]<NEW_LINE>mTab.setValue("C_BPartner_Location_ID", new Integer(order.getC_BPartner_Location_ID()));<NEW_LINE>if (order.getAD_User_ID() > 0)<NEW_LINE>mTab.setValue("AD_User_ID", new Integer(order.getAD_User_ID()));<NEW_LINE>else<NEW_LINE>mTab.setValue("AD_User_ID", null);<NEW_LINE>}<NEW_LINE>return "";<NEW_LINE>} | "DeliveryViaRule", order.getDeliveryViaRule()); |
1,458,920 | public Xml visitTag(Xml.Tag tag, ExecutionContext ctx) {<NEW_LINE>if (isManagedDependencyTag(oldGroupId, oldArtifactId)) {<NEW_LINE>Optional<Xml.Tag> groupIdTag = tag.getChild("groupId");<NEW_LINE>boolean changed = false;<NEW_LINE>if (groupIdTag.isPresent() && !newGroupId.equals(groupIdTag.get().getValue().orElse(null))) {<NEW_LINE>doAfterVisit(new ChangeTagValueVisitor<>(groupIdTag.get(), newGroupId));<NEW_LINE>changed = true;<NEW_LINE>}<NEW_LINE>Optional<Xml.Tag> artifactIdTag = tag.getChild("artifactId");<NEW_LINE>if (artifactIdTag.isPresent() && !newArtifactId.equals(artifactIdTag.get().getValue().orElse(null))) {<NEW_LINE>doAfterVisit(new ChangeTagValueVisitor<>(artifactIdTag.get(), newArtifactId));<NEW_LINE>changed = true;<NEW_LINE>}<NEW_LINE>if (newVersion != null) {<NEW_LINE>Optional<Xml.Tag> versionTag = tag.getChild("version");<NEW_LINE>if (versionTag.isPresent() && !newVersion.equals(versionTag.get().getValue().orElse(null))) {<NEW_LINE>doAfterVisit(new ChangeTagValueVisitor<>(versionTag.get(), newVersion));<NEW_LINE>changed = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (changed) {<NEW_LINE>maybeUpdateModel();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return <MASK><NEW_LINE>} | super.visitTag(tag, ctx); |
113,318 | public String saveEntity(HttpServletRequest request, HttpServletResponse response, Model model, @PathVariable Map<String, String> pathVars, @PathVariable(value = "id") String id, @ModelAttribute(value = "entityForm") EntityForm entityForm, BindingResult result, RedirectAttributes ra) throws Exception {<NEW_LINE>String sectionKey = getSectionKey(pathVars);<NEW_LINE>String sectionClassName = getClassNameForSection(sectionKey);<NEW_LINE>List<SectionCrumb> sectionCrumbs = getSectionCrumbs(request, sectionKey, id);<NEW_LINE>PersistencePackageRequest ppr = getSectionPersistencePackageRequest(sectionClassName, sectionCrumbs, pathVars);<NEW_LINE>ClassMetadata cmd = service.getClassMetadata(ppr).getDynamicResultSet().getClassMetaData();<NEW_LINE>extractDynamicFormFields(cmd, entityForm);<NEW_LINE>String[] sectionCriteria = customCriteriaService.mergeSectionCustomCriteria(sectionClassName, getSectionCustomCriteria());<NEW_LINE>Entity entity = service.updateEntity(entityForm, sectionCriteria, sectionCrumbs).getEntity();<NEW_LINE>entityFormValidator.validate(entityForm, entity, result);<NEW_LINE>if (result.hasErrors()) {<NEW_LINE>model.addAttribute("headerFlash", "save.unsuccessful");<NEW_LINE><MASK><NEW_LINE>Map<String, DynamicResultSet> subRecordsMap = service.getRecordsForAllSubCollections(ppr, entity, sectionCrumbs);<NEW_LINE>entityForm.clearFieldsMap();<NEW_LINE>formService.populateEntityForm(cmd, entity, subRecordsMap, entityForm, sectionCrumbs);<NEW_LINE>modifyEntityForm(entity, entityForm, pathVars);<NEW_LINE>model.addAttribute("entity", entity);<NEW_LINE>model.addAttribute("currentUrl", request.getRequestURL().toString());<NEW_LINE>setModelAttributes(model, sectionKey);<NEW_LINE>return resolveAppropriateEntityView(request, model, entityForm);<NEW_LINE>}<NEW_LINE>ra.addFlashAttribute("headerFlash", "save.successful");<NEW_LINE>return "redirect:/" + sectionKey + "/" + id;<NEW_LINE>} | model.addAttribute("headerFlashAlert", true); |
662,298 | public void initTransactionProperties() {<NEW_LINE>if (serviceLocator != null) {<NEW_LINE>txnService = serviceLocator.getService(TransactionService.class, ServerEnvironment.DEFAULT_INSTANCE_NAME);<NEW_LINE>if (txnService != null) {<NEW_LINE>String <MASK><NEW_LINE>if (value != null && "false".equals(value)) {<NEW_LINE>setUseLAO(false);<NEW_LINE>if (_logger.isLoggable(Level.FINE))<NEW_LINE>_logger.log(Level.FINE, "TM: LAO is disabled");<NEW_LINE>}<NEW_LINE>value = txnService.getPropertyValue("oracle-xa-recovery-workaround");<NEW_LINE>if (value == null || "true".equals(value)) {<NEW_LINE>xaresourcewrappers.put("oracle.jdbc.xa.client.OracleXADataSource", new OracleXAResource());<NEW_LINE>}<NEW_LINE>if (Boolean.parseBoolean(txnService.getPropertyValue("sybase-xa-recovery-workaround"))) {<NEW_LINE>xaresourcewrappers.put("com.sybase.jdbc2.jdbc.SybXADataSource", new SybaseXAResource());<NEW_LINE>}<NEW_LINE>if (Boolean.parseBoolean(txnService.getAutomaticRecovery())) {<NEW_LINE>// If recovery on server startup is set, initialize other properties as well<NEW_LINE>Properties props = TransactionServiceProperties.getJTSProperties(serviceLocator, false);<NEW_LINE>DefaultTransactionService.setServerName(props);<NEW_LINE>if (Boolean.parseBoolean(txnService.getPropertyValue("delegated-recovery"))) {<NEW_LINE>_logger.warning("delegated-recovery is no longer supported!!");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | value = txnService.getPropertyValue("use-last-agent-optimization"); |
835,195 | public Flux<ByteBuf> completeMessages(Flux<ByteBuf> payloads) {<NEW_LINE>return payloads.windowUntil(windowPredicate).flatMap(Flux::collectList).map(list -> {<NEW_LINE>final ByteBuf buf;<NEW_LINE>if (list.size() == 1) {<NEW_LINE>buf = list.get(0);<NEW_LINE>} else {<NEW_LINE>CompositeByteBuf composite = allocator.compositeBuffer(list.size());<NEW_LINE>for (ByteBuf component : list) {<NEW_LINE>composite.addComponent(true, component);<NEW_LINE>}<NEW_LINE>buf = composite;<NEW_LINE>}<NEW_LINE>ByteArrayOutputStream out = new ByteArrayOutputStream();<NEW_LINE>try (InflaterOutputStream inflater = new InflaterOutputStream(out, context)) {<NEW_LINE>inflater.write(ByteBufUtil.getBytes(buf, buf.readerIndex(), buf.readableBytes(), false));<NEW_LINE>ByteBuf outBuffer = unpooled ? Unpooled.buffer<MASK><NEW_LINE>return outBuffer.writeBytes(out.toByteArray()).asReadOnly();<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw Exceptions.propagate(e);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | () : allocator.buffer(); |
455,256 | private Mono<PagedResponse<RemediationDeploymentInner>> listDeploymentsAtSubscriptionNextSinglePageAsync(String nextLink) {<NEW_LINE>if (nextLink == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>return FluxUtil.withContext(context -> service.listDeploymentsAtSubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)).<PagedResponse<RemediationDeploymentInner>>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)).contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext(<MASK><NEW_LINE>} | )).readOnly())); |
286,101 | public static void main(String[] args) throws Exception {<NEW_LINE>dataLocalPath = DownloaderUtility.MODELIMPORT.Download() + "/tensorflow";<NEW_LINE>final String FROZEN_MLP = new File(dataLocalPath, "frozen_model.pb").getAbsolutePath();<NEW_LINE>// Load placeholder inputs and corresponding predictions generated from tensorflow<NEW_LINE>List<Pair<INDArray, INDArray>> inputoutputPairs = readPlaceholdersAndPredictions();<NEW_LINE>// Load the graph into samediff<NEW_LINE>SameDiff graph = TFGraphMapper.importGraph(new File(FROZEN_MLP));<NEW_LINE>// libnd4j executor<NEW_LINE>// running with input_a array expecting to get prediction_a<NEW_LINE>INDArray placeholderValue = inputoutputPairs.get(0).getFirst();<NEW_LINE>INDArray TFPrediction = inputoutputPairs.get(0).getSecond();<NEW_LINE>graph.associateArrayWithVariable(placeholderValue, graph.variableMap().get("input"));<NEW_LINE>NativeGraphExecutioner executioner = new NativeGraphExecutioner();<NEW_LINE>// returns an array of the outputs<NEW_LINE>INDArray[] results = executioner.executeGraph(graph);<NEW_LINE>INDArray libnd4jPrediction = results[0];<NEW_LINE>System.out.println("LIBND4J exec prediction for input_a:\n" + libnd4jPrediction);<NEW_LINE>if (libnd4jPrediction.equals(TFPrediction)) {<NEW_LINE>// this is true and therefore predictions are equal<NEW_LINE>System.out.println("Predictions are equal to tensorflow");<NEW_LINE>} else {<NEW_LINE>throw new RuntimeException("Predictions don't match!");<NEW_LINE>}<NEW_LINE>// Now to run with the samediff executor, with input_b array expecting to get prediction_b<NEW_LINE>// Reimport graph here, necessary for the 1.0 alpha release<NEW_LINE>SameDiff graphSD = TFGraphMapper.importGraph(new File(FROZEN_MLP));<NEW_LINE>// INDArray samediffPred = graphSD.output(inputsPredictions, "prediction_a").get("prediction_a");<NEW_LINE>placeholderValue = inputoutputPairs.get(1).getFirst();<NEW_LINE>TFPrediction = inputoutputPairs.get(1).getSecond();<NEW_LINE>graphSD.associateArrayWithVariable(placeholderValue, "input");<NEW_LINE>INDArray samediffPred = graphSD.<MASK><NEW_LINE>System.out.println("SameDiff exec prediction for input_b:\n" + samediffPred);<NEW_LINE>if (samediffPred.equals(TFPrediction)) {<NEW_LINE>// this is true and therefore predictions are equal<NEW_LINE>System.out.println("Predictions are equal to tensorflow");<NEW_LINE>}<NEW_LINE>// add to graph to demonstrate pytorch like capability<NEW_LINE>System.out.println("Adding new op to graph..");<NEW_LINE>SDVariable linspaceConstant = graphSD.var("linspace", Nd4j.linspace(1, 10, 10));<NEW_LINE>SDVariable totalOutput = graphSD.getVariable("output").add(linspaceConstant);<NEW_LINE>INDArray totalOutputArr = totalOutput.eval();<NEW_LINE>System.out.println(totalOutputArr);<NEW_LINE>} | getVariable("output").eval(); |
112,538 | private static boolean checkResource(ArtifactEntry e, FileSystem f, PrintWriter out) {<NEW_LINE>boolean result = true;<NEW_LINE>String resource = f.getResource();<NEW_LINE>// added the .equals("null") to tolerate idiotic test data.<NEW_LINE>if (resource != null && !resource.equals("null")) {<NEW_LINE>URL u = e.getResource();<NEW_LINE>if (TEST_RESOURCE_URL_NOT_NULL) {<NEW_LINE>result &= check(u != null, e, f, out, "Resource was null for path " + f.getDebugPath() + " when expected value of " + resource);<NEW_LINE>}<NEW_LINE>if (TEST_RESOURCE_URL_CONTENT) {<NEW_LINE>if (u != null) {<NEW_LINE>String[] resparts = resource.split("#");<NEW_LINE>result &= check(u.toString().startsWith(resparts[0]) && u.toString().endsWith(resparts[1]), e, f, out, "Unable to validate resource " + u.toString() + " for path " + f.getDebugPath() + " expected value was " + resource);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (TEST_RESOURCE_URL_IS_NULL) {<NEW_LINE>result &= check(e.getResource() == null, e, f, out, "Resource was not null, when expected to be for path " + f.getDebugPath() + <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | " got value of " + e.getResource()); |
1,370,962 | public static DataTcpWebServer start(DataServer dataServer) throws Exception {<NEW_LINE>File dataBaseDir = new File(Config.base(), "local/repository/data");<NEW_LINE>FileUtils.forceMkdir(dataBaseDir);<NEW_LINE>Server tcpServer = null;<NEW_LINE>Server webServer = null;<NEW_LINE>String password = Config.token().getPassword();<NEW_LINE>String[] tcps = new String[9];<NEW_LINE>tcps[0] = "-tcp";<NEW_LINE>tcps[1] = "-tcpAllowOthers";<NEW_LINE>tcps[2] = "-tcpPort";<NEW_LINE>tcps[3] = dataServer.getTcpPort().toString();<NEW_LINE>tcps[4] = "-baseDir";<NEW_LINE>tcps[5] = dataBaseDir.getAbsolutePath();<NEW_LINE>tcps[6] = "-tcpPassword";<NEW_LINE>tcps[7] = password;<NEW_LINE>tcps[8] = "-ifNotExists";<NEW_LINE>tcpServer = Server.createTcpServer(tcps).start();<NEW_LINE>Integer webPort = dataServer.getWebPort();<NEW_LINE>if ((null != webPort) && (webPort > 0)) {<NEW_LINE>String[] webs = new String[4];<NEW_LINE>webs[0] = "-web";<NEW_LINE>webs[1] = "-webAllowOthers";<NEW_LINE>webs[2] = "-webPort";<NEW_LINE>webs[<MASK><NEW_LINE>webServer = Server.createWebServer(webs).start();<NEW_LINE>}<NEW_LINE>System.out.println("****************************************");<NEW_LINE>System.out.println("* data server start completed.");<NEW_LINE>System.out.println("* port: " + dataServer.getTcpPort() + ".");<NEW_LINE>System.out.println("* web console port: " + dataServer.getWebPort() + ".");<NEW_LINE>System.out.println("****************************************");<NEW_LINE>return new DataTcpWebServer(tcpServer, webServer);<NEW_LINE>} | 3] = webPort.toString(); |
1,724,567 | public static Collection<RegressionExecution> executions() {<NEW_LINE>ArrayList<RegressionExecution> execs = new ArrayList<>();<NEW_LINE>execs.add(new ViewSizeSceneOne());<NEW_LINE>execs.add(new ViewSizeSceneTwo());<NEW_LINE>execs.add(new ViewSizeAddProps());<NEW_LINE>execs.add(new ViewDerivedAll());<NEW_LINE>execs.add(new ViewDerivedLengthWUniSceneOne());<NEW_LINE>execs.add(new ViewDerivedLengthWUniSceneTwo());<NEW_LINE>execs.add(new ViewDerivedLengthWUniSceneThree());<NEW_LINE>execs.add(new ViewDerivedLengthWWeightedAvgSceneOne());<NEW_LINE>execs.add(new ViewDerivedLengthWWeightedAvgSceneTwo());<NEW_LINE>execs.add(new ViewDerivedLengthWRegressionLinestSceneOne());<NEW_LINE>execs<MASK><NEW_LINE>execs.add(new ViewDerivedLengthWCorrelation());<NEW_LINE>return execs;<NEW_LINE>} | .add(new ViewDerivedLengthWRegressionLinestSceneTwo()); |
924,038 | private PromptDialogWidget confirmPrompt(@NonNull PromptData promptData) {<NEW_LINE>if (mConfirmDialog == null) {<NEW_LINE>mConfirmDialog = new PromptDialogWidget(getContext());<NEW_LINE>mConfirmDialog.setButtons(new int[] { R.string.cancel_button, R.string.ok_button });<NEW_LINE>mConfirmDialog.setCheckboxVisible(false);<NEW_LINE>mConfirmDialog.setDescriptionVisible(false);<NEW_LINE>}<NEW_LINE>mConfirmDialog.setTitle(promptData.getTitle());<NEW_LINE>mConfirmDialog.setBody(promptData.getBody());<NEW_LINE>if (promptData.getBodyGravity() != Gravity.NO_GRAVITY) {<NEW_LINE>mConfirmDialog.setBodyGravity(promptData.getBodyGravity());<NEW_LINE>}<NEW_LINE>mConfirmDialog.setButtons(promptData.getBtnMsg());<NEW_LINE>mConfirmDialog.setButtonsDelegate((index, isChecked) -> {<NEW_LINE>mConfirmDialog.hide(REMOVE_WIDGET);<NEW_LINE>if (promptData.getCallback() != null) {<NEW_LINE>promptData.getCallback().onButtonClicked(index, isChecked);<NEW_LINE>}<NEW_LINE>mConfirmDialog.releaseWidget();<NEW_LINE>mConfirmDialog = null;<NEW_LINE>});<NEW_LINE>if (promptData.getCheckboxText() != null) {<NEW_LINE>mConfirmDialog.setCheckboxVisible(true);<NEW_LINE>mConfirmDialog.setCheckboxText(promptData.getCheckboxText());<NEW_LINE>} else {<NEW_LINE>mConfirmDialog.setCheckboxVisible(false);<NEW_LINE>}<NEW_LINE>if (promptData.getIconType() == PromptData.RES) {<NEW_LINE>mConfirmDialog.<MASK><NEW_LINE>} else if (promptData.getIconType() == PromptData.URL) {<NEW_LINE>mConfirmDialog.setIcon(promptData.getIconUrl());<NEW_LINE>}<NEW_LINE>mConfirmDialog.setLinkDelegate((widget, url) -> {<NEW_LINE>mWidgetManager.openNewTabForeground(url);<NEW_LINE>mConfirmDialog.hide(REMOVE_WIDGET);<NEW_LINE>mConfirmDialog.releaseWidget();<NEW_LINE>mConfirmDialog = null;<NEW_LINE>});<NEW_LINE>return mConfirmDialog;<NEW_LINE>} | setIcon(promptData.getIconRes()); |
504,712 | public void extractKeyParts(CacheKeyBuilder keyBuilder, Object targetObject, Object[] params) {<NEW_LINE>//<NEW_LINE>// include specified property values into the key<NEW_LINE>for (final String keyProp : keyProperties) {<NEW_LINE>if (targetObject instanceof PO) {<NEW_LINE>final PO po = (PO) targetObject;<NEW_LINE>if (po.get_ColumnIndex(keyProp) < 0) {<NEW_LINE>final String msg = // + "." + constructorOrMethod.getName()<NEW_LINE>"Invalid keyProperty '" + keyProp + "' for cached method " + targetObject.getClass() + ". Target PO has no such column; PO=" + po;<NEW_LINE>throw new RuntimeException(msg);<NEW_LINE>}<NEW_LINE>final Object <MASK><NEW_LINE>keyBuilder.add(keyValue);<NEW_LINE>} else {<NEW_LINE>final StringBuilder getMethodName = new StringBuilder("get");<NEW_LINE>getMethodName.append(keyProp.substring(0, 1).toUpperCase());<NEW_LINE>getMethodName.append(keyProp.substring(1));<NEW_LINE>try {<NEW_LINE>final Method method = targetObject.getClass().getMethod(getMethodName.toString());<NEW_LINE>final Object keyValue = method.invoke(targetObject);<NEW_LINE>keyBuilder.add(keyValue);<NEW_LINE>} catch (Exception e) {<NEW_LINE>final String msg = // + "." + constructorOrMethod.getName()<NEW_LINE>"Invalid keyProperty '" + keyProp + "' for cached method " + targetObject.getClass().getName() + ". Can't access getter method get" + keyProp + ". Exception " + e + "; message: " + e.getMessage();<NEW_LINE>throw new RuntimeException(msg, e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | keyValue = po.get_Value(keyProp); |
689,649 | private void showInfoAboutRoot() {<NEW_LINE>boolean rootIsAvailable = preferenceRepository.get().getBoolPreference(ROOT_IS_AVAILABLE);<NEW_LINE>boolean busyBoxIsAvailable = preferenceRepository.get().getBoolPreference("bbOK");<NEW_LINE>boolean mitmDetected = ArpScanner.getArpAttackDetected() || ArpScanner.getDhcpGatewayAttackDetected();<NEW_LINE>if (mitmDetected) {<NEW_LINE>DialogFragment commandResult = NotificationDialogFragment.newInstance(getString(R.string.notification_mitm));<NEW_LINE>commandResult.<MASK><NEW_LINE>} else if (rootIsAvailable) {<NEW_LINE>DialogFragment commandResult;<NEW_LINE>if (busyBoxIsAvailable) {<NEW_LINE>commandResult = NotificationDialogFragment.newInstance(TopFragment.verSU + "\n\t\n" + TopFragment.verBB);<NEW_LINE>} else {<NEW_LINE>commandResult = NotificationDialogFragment.newInstance(TopFragment.verSU);<NEW_LINE>}<NEW_LINE>commandResult.show(getSupportFragmentManager(), "NotificationDialogFragment");<NEW_LINE>} else {<NEW_LINE>DialogFragment commandResult;<NEW_LINE>if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {<NEW_LINE>commandResult = NotificationDialogFragment.newInstance(R.string.message_no_root_used);<NEW_LINE>} else {<NEW_LINE>commandResult = NotificationDialogFragment.newInstance(R.string.message_no_root_used_kitkat);<NEW_LINE>}<NEW_LINE>commandResult.show(getSupportFragmentManager(), "NotificationDialogFragment");<NEW_LINE>}<NEW_LINE>} | show(getSupportFragmentManager(), "NotificationDialogFragment"); |
936,777 | private String foldHeaderValue(String input) {<NEW_LINE>int inputLength = input.length();<NEW_LINE>int endOfFirstLine = MAX_LINE_LENGTH - FIRST_LINE_EXTRA_LENGTH;<NEW_LINE>if (inputLength <= endOfFirstLine) {<NEW_LINE>return input;<NEW_LINE>}<NEW_LINE>int extraLines = (inputLength - endOfFirstLine - 1) / (MAX_LINE_LENGTH - 1) + 1;<NEW_LINE>int builderSize = inputLength + extraLines * 3;<NEW_LINE>StringBuilder headerValue = new StringBuilder(builderSize);<NEW_LINE>headerValue.append(input, 0, endOfFirstLine);<NEW_LINE>int start = endOfFirstLine;<NEW_LINE>while (start < inputLength) {<NEW_LINE>headerValue.append("\r\n ");<NEW_LINE>int end = start + Math.min(MAX_LINE_LENGTH - 1, inputLength - start);<NEW_LINE>headerValue.<MASK><NEW_LINE>start = end;<NEW_LINE>}<NEW_LINE>return headerValue.toString();<NEW_LINE>} | append(input, start, end); |
252,366 | public com.amazonaws.services.ecs.model.BlockedException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.ecs.model.BlockedException blockedException = new com.amazonaws.services.ecs.model.BlockedException(null);<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>} 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 blockedException;<NEW_LINE>} | JsonToken token = context.getCurrentToken(); |
985,801 | private static boolean handleDurabilityLoss(@NotNull Set<BlockState> treeFellerBlocks, @NotNull ItemStack inHand, @NotNull Player player) {<NEW_LINE>// Treat the NBT tag for unbreakable and the durability enchant differently<NEW_LINE>ItemMeta meta = inHand.getItemMeta();<NEW_LINE>if (meta != null && meta.isUnbreakable()) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>int durabilityLoss = 0;<NEW_LINE>Material type = inHand.getType();<NEW_LINE>for (BlockState blockState : treeFellerBlocks) {<NEW_LINE>if (BlockUtils.hasWoodcuttingXP(blockState)) {<NEW_LINE>durabilityLoss += mcMMO.p.getGeneralConfig().getAbilityToolDamage();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Call PlayerItemDamageEvent first to make sure it's not cancelled<NEW_LINE>// TODO: Put this event stuff in handleDurabilityChange<NEW_LINE>final PlayerItemDamageEvent event = new PlayerItemDamageEvent(player, inHand, durabilityLoss);<NEW_LINE>Bukkit.<MASK><NEW_LINE>if (event.isCancelled()) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>SkillUtils.handleDurabilityChange(inHand, durabilityLoss);<NEW_LINE>int durability = meta instanceof Damageable ? ((Damageable) meta).getDamage() : 0;<NEW_LINE>return (durability < (mcMMO.getRepairableManager().isRepairable(type) ? mcMMO.getRepairableManager().getRepairable(type).getMaximumDurability() : type.getMaxDurability()));<NEW_LINE>} | getPluginManager().callEvent(event); |
1,562,720 | private void saveCookiesAndFinish() {<NEW_LINE>// try to get cookies of unclosed page<NEW_LINE>handleCookiesFromUrl(recaptchaBinding.reCaptchaWebView.getUrl());<NEW_LINE>if (MainActivity.DEBUG) {<NEW_LINE>Log.<MASK><NEW_LINE>}<NEW_LINE>if (!foundCookies.isEmpty()) {<NEW_LINE>// save cookies to preferences<NEW_LINE>final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());<NEW_LINE>final String key = getApplicationContext().getString(R.string.recaptcha_cookies_key);<NEW_LINE>prefs.edit().putString(key, foundCookies).apply();<NEW_LINE>// give cookies to Downloader class<NEW_LINE>DownloaderImpl.getInstance().setCookie(RECAPTCHA_COOKIES_KEY, foundCookies);<NEW_LINE>setResult(RESULT_OK);<NEW_LINE>}<NEW_LINE>// Navigate to blank page (unloads youtube to prevent background playback)<NEW_LINE>recaptchaBinding.reCaptchaWebView.loadUrl("about:blank");<NEW_LINE>final Intent intent = new Intent(this, org.schabi.newpipe.MainActivity.class);<NEW_LINE>intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);<NEW_LINE>NavUtils.navigateUpTo(this, intent);<NEW_LINE>} | d(TAG, "saveCookiesAndFinish: foundCookies=" + foundCookies); |
705,850 | public static ListSecretVersionIdsResponse unmarshall(ListSecretVersionIdsResponse listSecretVersionIdsResponse, UnmarshallerContext _ctx) {<NEW_LINE>listSecretVersionIdsResponse.setRequestId<MASK><NEW_LINE>listSecretVersionIdsResponse.setPageNumber(_ctx.integerValue("ListSecretVersionIdsResponse.PageNumber"));<NEW_LINE>listSecretVersionIdsResponse.setPageSize(_ctx.integerValue("ListSecretVersionIdsResponse.PageSize"));<NEW_LINE>listSecretVersionIdsResponse.setSecretName(_ctx.stringValue("ListSecretVersionIdsResponse.SecretName"));<NEW_LINE>listSecretVersionIdsResponse.setTotalCount(_ctx.integerValue("ListSecretVersionIdsResponse.TotalCount"));<NEW_LINE>List<VersionId> versionIds = new ArrayList<VersionId>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListSecretVersionIdsResponse.VersionIds.Length"); i++) {<NEW_LINE>VersionId versionId = new VersionId();<NEW_LINE>versionId.setCreateTime(_ctx.stringValue("ListSecretVersionIdsResponse.VersionIds[" + i + "].CreateTime"));<NEW_LINE>versionId.setVersionId(_ctx.stringValue("ListSecretVersionIdsResponse.VersionIds[" + i + "].VersionId"));<NEW_LINE>List<String> versionStages = new ArrayList<String>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("ListSecretVersionIdsResponse.VersionIds[" + i + "].VersionStages.Length"); j++) {<NEW_LINE>versionStages.add(_ctx.stringValue("ListSecretVersionIdsResponse.VersionIds[" + i + "].VersionStages[" + j + "]"));<NEW_LINE>}<NEW_LINE>versionId.setVersionStages(versionStages);<NEW_LINE>versionIds.add(versionId);<NEW_LINE>}<NEW_LINE>listSecretVersionIdsResponse.setVersionIds(versionIds);<NEW_LINE>return listSecretVersionIdsResponse;<NEW_LINE>} | (_ctx.stringValue("ListSecretVersionIdsResponse.RequestId")); |
752,699 | public static QueryProfileShardResult fromXContent(XContentParser parser) throws IOException {<NEW_LINE>XContentParser.<MASK><NEW_LINE>ensureExpectedToken(XContentParser.Token.START_OBJECT, token, parser);<NEW_LINE>String currentFieldName = null;<NEW_LINE>List<ProfileResult> queryProfileResults = new ArrayList<>();<NEW_LINE>long rewriteTime = 0;<NEW_LINE>CollectorResult collector = null;<NEW_LINE>while ((token = parser.nextToken()) != XContentParser.Token.END_OBJECT) {<NEW_LINE>if (token == XContentParser.Token.FIELD_NAME) {<NEW_LINE>currentFieldName = parser.currentName();<NEW_LINE>} else if (token.isValue()) {<NEW_LINE>if (REWRITE_TIME.equals(currentFieldName)) {<NEW_LINE>rewriteTime = parser.longValue();<NEW_LINE>} else {<NEW_LINE>parser.skipChildren();<NEW_LINE>}<NEW_LINE>} else if (token == XContentParser.Token.START_ARRAY) {<NEW_LINE>if (QUERY_ARRAY.equals(currentFieldName)) {<NEW_LINE>while ((token = parser.nextToken()) != XContentParser.Token.END_ARRAY) {<NEW_LINE>queryProfileResults.add(ProfileResult.fromXContent(parser));<NEW_LINE>}<NEW_LINE>} else if (COLLECTOR.equals(currentFieldName)) {<NEW_LINE>while ((token = parser.nextToken()) != XContentParser.Token.END_ARRAY) {<NEW_LINE>collector = CollectorResult.fromXContent(parser);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>parser.skipChildren();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>parser.skipChildren();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new QueryProfileShardResult(queryProfileResults, rewriteTime, collector);<NEW_LINE>} | Token token = parser.currentToken(); |
1,672,236 | private void loadStyleData(int workspaceTheme) {<NEW_LINE>TypedArray styles;<NEW_LINE>if (workspaceTheme != 0) {<NEW_LINE>styles = mContext.obtainStyledAttributes(workspaceTheme, R.styleable.BlocklyVertical);<NEW_LINE>} else {<NEW_LINE>styles = mContext.obtainStyledAttributes(R.styleable.BlocklyVertical);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>mUseHats = styles.getBoolean(R.styleable.BlocklyVertical_blockHat, false);<NEW_LINE>setFieldLayout(Field.TYPE_DROPDOWN, R.layout.default_field_dropdown);<NEW_LINE>setFieldLayout(Field.<MASK><NEW_LINE>setFieldLayout(Field.TYPE_CHECKBOX, R.layout.default_field_checkbox);<NEW_LINE>setFieldLayout(Field.TYPE_DATE, R.layout.default_field_date);<NEW_LINE>setFieldLayout(Field.TYPE_ANGLE, R.layout.default_field_angle);<NEW_LINE>setFieldLayout(Field.TYPE_NUMBER, R.layout.default_field_number);<NEW_LINE>setFieldLayout(Field.TYPE_COLOR, R.layout.default_field_color);<NEW_LINE>setFieldLayout(Field.TYPE_INPUT, R.layout.default_field_input);<NEW_LINE>setFieldLayout(Field.TYPE_VARIABLE, R.layout.default_field_variable);<NEW_LINE>} finally {<NEW_LINE>styles.recycle();<NEW_LINE>}<NEW_LINE>} | TYPE_LABEL, R.layout.default_field_label); |
393,917 | protected void okPressed() {<NEW_LINE>copySettings.setCopyHeader(copyHeaderCheck.getSelection());<NEW_LINE>copySettings.setCopyRowNumbers(copyRowsCheck.getSelection());<NEW_LINE>copySettings.setQuoteCells(quoteCellsCheck.getSelection());<NEW_LINE>copySettings.setForceQuotes(forceQuoteCheck.getSelection());<NEW_LINE>copySettings.setCopyHTML(copyHtmlCheck.getSelection());<NEW_LINE>copySettings.<MASK><NEW_LINE>settings.put(PARAM_COPY_HEADER, copySettings.isCopyHeader());<NEW_LINE>settings.put(PARAM_COPY_ROWS, copySettings.isCopyRowNumbers());<NEW_LINE>settings.put(PARAM_QUOTE_CELLS, copySettings.isQuoteCells());<NEW_LINE>settings.put(PARAM_FORCE_QUOTES, copySettings.isForceQuotes());<NEW_LINE>settings.put(PARAM_COPY_HTML, copySettings.isCopyHTML());<NEW_LINE>settings.put(PARAM_FORMAT, copySettings.getFormat().name());<NEW_LINE>super.okPressed();<NEW_LINE>} | setFormat(formatSelector.getSelection()); |
1,766,263 | public Invoice generate() throws AxelorException {<NEW_LINE>LOG.debug("Creating a refund for invoice {}", invoice.getInvoiceId());<NEW_LINE>Invoice refund = JPA.copy(invoice, true);<NEW_LINE>InvoiceToolService.resetInvoiceStatusOnCopy(refund);<NEW_LINE>refund.setOperationTypeSelect(this.inverseOperationType<MASK><NEW_LINE>List<InvoiceLine> refundLines = new ArrayList<>();<NEW_LINE>if (refund.getInvoiceLineList() != null) {<NEW_LINE>refundLines.addAll(refund.getInvoiceLineList());<NEW_LINE>}<NEW_LINE>populate(refund, refundLines);<NEW_LINE>// Payment mode should not be the invoice payment mode. It must come<NEW_LINE>// from the partner or the company, or be null.<NEW_LINE>refund.setPaymentMode(InvoiceToolService.getPaymentMode(refund));<NEW_LINE>if (refund.getPaymentMode() == null) {<NEW_LINE>throw new AxelorException(TraceBackRepository.CATEGORY_MISSING_FIELD, I18n.get(IExceptionMessage.REFUND_INVOICE_1), I18n.get(com.axelor.apps.base.exceptions.IExceptionMessage.EXCEPTION));<NEW_LINE>}<NEW_LINE>return refund;<NEW_LINE>} | (refund.getOperationTypeSelect())); |
889,002 | private void createRangeIndexForColumn(SegmentDirectory.Writer segmentWriter, ColumnMetadata columnMetadata, RangeIndexCreatorProvider indexCreatorProvider) throws IOException {<NEW_LINE>File indexDir = _segmentMetadata.getIndexDir();<NEW_LINE>String segmentName = _segmentMetadata.getName();<NEW_LINE>String columnName = columnMetadata.getColumnName();<NEW_LINE>File inProgress = new File(indexDir, columnName + ".range.inprogress");<NEW_LINE>File rangeIndexFile = new File(indexDir, columnName + V1Constants.Indexes.BITMAP_RANGE_INDEX_FILE_EXTENSION);<NEW_LINE>if (!inProgress.exists()) {<NEW_LINE>// Marker file does not exist, which means last run ended normally.<NEW_LINE>// Create a marker file.<NEW_LINE>FileUtils.touch(inProgress);<NEW_LINE>} else {<NEW_LINE>// Marker file exists, which means last run gets interrupted.<NEW_LINE>// Remove range index if exists.<NEW_LINE>// For v1 and v2, it's the actual range index. For v3, it's the temporary range index.<NEW_LINE>FileUtils.deleteQuietly(rangeIndexFile);<NEW_LINE>}<NEW_LINE>// Create new range index for the column.<NEW_LINE>LOGGER.info("Creating new range index for segment: {}, column: {}", segmentName, columnName);<NEW_LINE>if (columnMetadata.hasDictionary()) {<NEW_LINE>handleDictionaryBasedColumn(segmentWriter, columnMetadata, indexCreatorProvider);<NEW_LINE>} else {<NEW_LINE>handleNonDictionaryBasedColumn(segmentWriter, columnMetadata, indexCreatorProvider);<NEW_LINE>}<NEW_LINE>// For v3, write the generated range index file into the single file and remove it.<NEW_LINE>if (_segmentMetadata.getVersion() == SegmentVersion.v3) {<NEW_LINE>LoaderUtils.writeIndexToV3Format(segmentWriter, columnName, rangeIndexFile, ColumnIndexType.RANGE_INDEX);<NEW_LINE>}<NEW_LINE>// Delete the marker file.<NEW_LINE>FileUtils.deleteQuietly(inProgress);<NEW_LINE>LOGGER.<MASK><NEW_LINE>} | info("Created range index for segment: {}, column: {}", segmentName, columnName); |
490,580 | protected final static Number coerceToNumber(final Number number, final Class<?> type) throws ELException {<NEW_LINE>if (Long.TYPE == type || Long.class.equals(type)) {<NEW_LINE>return new Long(number.longValue());<NEW_LINE>}<NEW_LINE>if (Double.TYPE == type || Double.class.equals(type)) {<NEW_LINE>return new Double(number.doubleValue());<NEW_LINE>}<NEW_LINE>if (Integer.TYPE == type || Integer.class.equals(type)) {<NEW_LINE>return new Integer(number.intValue());<NEW_LINE>}<NEW_LINE>if (BigInteger.class.equals(type)) {<NEW_LINE>if (number instanceof BigDecimal) {<NEW_LINE>return ((BigDecimal) number).toBigInteger();<NEW_LINE>}<NEW_LINE>if (number instanceof BigInteger) {<NEW_LINE>return number;<NEW_LINE>}<NEW_LINE>return BigInteger.valueOf(number.longValue());<NEW_LINE>}<NEW_LINE>if (BigDecimal.class.equals(type)) {<NEW_LINE>if (number instanceof BigDecimal) {<NEW_LINE>return number;<NEW_LINE>}<NEW_LINE>if (number instanceof BigInteger) {<NEW_LINE>return new BigDecimal((BigInteger) number);<NEW_LINE>}<NEW_LINE>return new BigDecimal(number.doubleValue());<NEW_LINE>}<NEW_LINE>if (Byte.TYPE == type || Byte.class.equals(type)) {<NEW_LINE>return new Byte(number.byteValue());<NEW_LINE>}<NEW_LINE>if (Short.TYPE == type || Short.class.equals(type)) {<NEW_LINE>return new <MASK><NEW_LINE>}<NEW_LINE>if (Float.TYPE == type || Float.class.equals(type)) {<NEW_LINE>return new Float(number.floatValue());<NEW_LINE>}<NEW_LINE>if (Number.class.equals(type)) {<NEW_LINE>return number;<NEW_LINE>}<NEW_LINE>throw new ELException(MessageFactory.get("error.convert", number, number.getClass(), type));<NEW_LINE>} | Short(number.shortValue()); |
385,716 | public void performChange() {<NEW_LINE>try {<NEW_LINE>FileObject fo = RefactoringUtils.getOrCreateFolder(refactoring.getTarget().lookup(URL.class));<NEW_LINE>FileObject source = refactoring.getRefactoringSource().lookup(FileObject.class);<NEW_LINE>String oldPackage = RefactoringUtils.getPackageName(source.getParent());<NEW_LINE>FileObject newOne = refactoring.getContext().lookup(FileObject.class);<NEW_LINE>if (newOne == null) {<NEW_LINE>// no copy exist<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final Collection<ModificationResult> results = processFiles(Collections.singleton(newOne), new UpdateReferences(!fo.equals(source.getParent()) && FileOwnerQuery.getOwner(fo).equals(FileOwnerQuery.getOwner(source)), oldPackage, source.getName()));<NEW_LINE>for (ModificationResult result : results) {<NEW_LINE>result.commit();<NEW_LINE>}<NEW_LINE>DataObject dobj = DataObject.find(newOne);<NEW_LINE>EditorCookie editor = dobj.getLookup().lookup(EditorCookie.class);<NEW_LINE>if (editor != null) {<NEW_LINE>editor.open();<NEW_LINE>}<NEW_LINE>} catch (Exception ioe) {<NEW_LINE>ErrorManager.<MASK><NEW_LINE>}<NEW_LINE>} | getDefault().notify(ioe); |
1,431,629 | public static BigLong shru(BigLong a, int n) {<NEW_LINE>n &= 63;<NEW_LINE>int res0, res1, res2;<NEW_LINE>int a2 = getH(a) & MASK_2;<NEW_LINE>if (n < BITS) {<NEW_LINE>res2 = a2 >>> n;<NEW_LINE>res1 = (getM(a) >> n) | (<MASK><NEW_LINE>res0 = (getL(a) >> n) | (getM(a) << (BITS - n));<NEW_LINE>} else if (n < BITS01) {<NEW_LINE>res2 = 0;<NEW_LINE>res1 = a2 >>> (n - BITS);<NEW_LINE>res0 = (getM(a) >> (n - BITS)) | (getH(a) << (BITS01 - n));<NEW_LINE>} else {<NEW_LINE>res2 = 0;<NEW_LINE>res1 = 0;<NEW_LINE>res0 = a2 >>> (n - BITS01);<NEW_LINE>}<NEW_LINE>return create(res0 & MASK, res1 & MASK, res2 & MASK_2);<NEW_LINE>} | a2 << (BITS - n)); |
1,837,954 | private boolean shouldFinishRootActivity() {<NEW_LINE>// Do not finish root activity if disabled globally. (Typically done when restarting LiveView.)<NEW_LINE>if (TiBaseActivity.canFinishRoot == false) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// This method only applies to "Ti.UI.Window" based activities.<NEW_LINE>// If this is the root activity, then let it do its default finish handling.<NEW_LINE>if (this instanceof TiRootActivity) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// Determine if this activity's "Ti.UI.Window" reference is still in the global collection.<NEW_LINE>// - Will not be in the collection if its close() method was called.<NEW_LINE>// - Will be in collection when pressing Back button or finish() was called natively.<NEW_LINE>boolean isTiWindowOpen = false;<NEW_LINE>if (this.launchIntent != null) {<NEW_LINE>int windowId = this.launchIntent.getIntExtra(TiC.INTENT_PROPERTY_WINDOW_ID, TiActivityWindows.INVALID_WINDOW_ID);<NEW_LINE>if (windowId != TiActivityWindows.INVALID_WINDOW_ID) {<NEW_LINE>isTiWindowOpen = TiActivityWindows.hasWindow(windowId);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// If this is the last "Ti.UI.Window" activity, then exit by default unless "exitOnClose" property was set.<NEW_LINE>boolean exitOnClose = (TiActivityWindows.getWindowCount() <= <MASK><NEW_LINE>if ((this.window != null) && this.window.hasProperty(TiC.PROPERTY_EXIT_ON_CLOSE)) {<NEW_LINE>exitOnClose = TiConvert.toBoolean(this.window.getProperty(TiC.PROPERTY_EXIT_ON_CLOSE), exitOnClose);<NEW_LINE>}<NEW_LINE>return exitOnClose;<NEW_LINE>} | (isTiWindowOpen ? 1 : 0)); |
360,801 | public FileCommentReactionEntity postFileCommentReactions(FileCommentReactionsBody body) throws ApiException {<NEW_LINE>Object localVarPostBody = body;<NEW_LINE>// verify the required parameter 'body' is set<NEW_LINE>if (body == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'body' when calling postFileCommentReactions");<NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/file_comment_reactions";<NEW_LINE>// query params<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = { "application/json" };<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>final String[] localVarContentTypes = { "application/json" };<NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>String[] <MASK><NEW_LINE>GenericType<FileCommentReactionEntity> localVarReturnType = new GenericType<FileCommentReactionEntity>() {<NEW_LINE>};<NEW_LINE>return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);<NEW_LINE>} | localVarAuthNames = new String[] {}; |
415,392 | public void checkInvariants() {<NEW_LINE>segmentMetadata.checkInvariants();<NEW_LINE>Preconditions.checkState(segmentMetadata.<MASK><NEW_LINE>Preconditions.checkState(segmentMetadata.getChunkCount() == chunkMetadataCollection.size(), "Chunk count must match. Segment snapshot= %s", this);<NEW_LINE>long dataSize = 0;<NEW_LINE>ChunkMetadata previous = null;<NEW_LINE>ChunkMetadata firstChunk = null;<NEW_LINE>for (val metadata : getChunkMetadataCollection()) {<NEW_LINE>dataSize += metadata.getLength();<NEW_LINE>if (previous != null) {<NEW_LINE>Preconditions.checkState(previous.getNextChunk().equals(metadata.getName()), "In correct link . chunk %s must point to chunk %s. Segment snapshot= %s", previous.getName(), metadata.getName(), this);<NEW_LINE>} else {<NEW_LINE>firstChunk = metadata;<NEW_LINE>}<NEW_LINE>previous = metadata;<NEW_LINE>}<NEW_LINE>Preconditions.checkState(dataSize == segmentMetadata.getLength() - segmentMetadata.getFirstChunkStartOffset(), "Data size does not match dataSize (%s). Segment=%s", dataSize, segmentMetadata);<NEW_LINE>if (chunkMetadataCollection.size() > 0) {<NEW_LINE>Preconditions.checkState(segmentMetadata.getFirstChunk().equals(firstChunk.getName()), "First chunk name is wrong. Segment snapshot= %s", this);<NEW_LINE>Preconditions.checkState(segmentMetadata.getLastChunk().equals(previous.getName()), "Last chunk name is wrong. Segment snapshot= %s", this);<NEW_LINE>Preconditions.checkState(previous.getNextChunk() == null, "Invalid last chunk Segment snapshot= %s", this);<NEW_LINE>Preconditions.checkState(segmentMetadata.getLength() == segmentMetadata.getLastChunkStartOffset() + previous.getLength(), "Last chunk start offset is wrong. snapshot= %s", this);<NEW_LINE>}<NEW_LINE>} | isStorageSystemSegment(), "Segment must be storage segment. Segment snapshot= %s", this); |
1,646,778 | final UpdatePatchBaselineResult executeUpdatePatchBaseline(UpdatePatchBaselineRequest updatePatchBaselineRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updatePatchBaselineRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdatePatchBaselineRequest> request = null;<NEW_LINE>Response<UpdatePatchBaselineResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdatePatchBaselineRequestProtocolMarshaller(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, "SSM");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdatePatchBaseline");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdatePatchBaselineResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdatePatchBaselineResultJsonUnmarshaller());<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(updatePatchBaselineRequest)); |
1,681,060 | private static List<EnumValueWithBackupName> buildEnumValues(List<ConceptDefinition> concepts, String system, Set<String> classifications, List<Filter> filters) {<NEW_LINE>List<EnumValueWithBackupName> valueList = new ArrayList<>();<NEW_LINE>for (ConceptDefinition concept : concepts) {<NEW_LINE>if (conceptMatchesFilters(concept, classifications, filters)) {<NEW_LINE>// Check the http://hl7.org/fhir/concept-properties to determine if the code value<NEW_LINE>// has been deprecated.<NEW_LINE>boolean isDeprecated = concept.getPropertyList().stream().anyMatch(property -> property.getCode().getValue().equals(TerminologyGenerator.CODE_VALUE_STATUS) && property.getValue().hasCode() && property.getValue().getCode().getValue().equals(TerminologyGenerator.CODE_VALUE_STATUS_DEPRECATED));<NEW_LINE>valueList.add(buildEnumValue(concept.getCode(), concept.getDisplay().getValue(), system, isDeprecated));<NEW_LINE>}<NEW_LINE>Set<String> childClassifications <MASK><NEW_LINE>childClassifications.add(concept.getCode().getValue());<NEW_LINE>valueList.addAll(buildEnumValues(concept.getConceptList(), system, childClassifications, filters));<NEW_LINE>}<NEW_LINE>return valueList;<NEW_LINE>} | = new HashSet<>(classifications); |
1,736,257 | private static void trySelectWhereJoined4CoercionBack(RegressionEnvironment env, AtomicInteger milestone, String stmtText) {<NEW_LINE>env.compileDeployAddListenerMile(stmtText, "s0", milestone.getAndIncrement());<NEW_LINE>// intPrimitive, intBoxed, longBoxed, doubleBoxed<NEW_LINE>sendBean(env, "A", 1, 10, 200, 3000);<NEW_LINE>sendBean(env, "B", 1, 10, 200, 3000);<NEW_LINE>sendBean(env, "C", 1, 10, 200, 3000);<NEW_LINE>env.assertEqualsNew("s0", "ids0", null);<NEW_LINE>// intPrimitive, intBoxed, longBoxed, doubleBoxed<NEW_LINE>sendBean(env, "S", -1, 11, 201, 0);<NEW_LINE>sendBean(env, "A", 2, 201, 0, 0);<NEW_LINE>sendBean(env, "B", 2, 0, 0, 201);<NEW_LINE>sendBean(env, "C", 2, 0, 11, 0);<NEW_LINE>env.assertEqualsNew("s0", "ids0", -1);<NEW_LINE>// intPrimitive, intBoxed, longBoxed, doubleBoxed<NEW_LINE>sendBean(env, "S", -2, 12, 202, 0);<NEW_LINE>sendBean(env, "A", <MASK><NEW_LINE>sendBean(env, "B", 3, 0, 0, 202);<NEW_LINE>sendBean(env, "C", 3, 0, -1, 0);<NEW_LINE>env.assertEqualsNew("s0", "ids0", null);<NEW_LINE>// intPrimitive, intBoxed, longBoxed, doubleBoxed<NEW_LINE>sendBean(env, "S", -3, 13, 203, 0);<NEW_LINE>sendBean(env, "A", 4, 203, 0, 0);<NEW_LINE>sendBean(env, "B", 4, 0, 0, 203.0001);<NEW_LINE>sendBean(env, "C", 4, 0, 13, 0);<NEW_LINE>env.assertEqualsNew("s0", "ids0", null);<NEW_LINE>// intPrimitive, intBoxed, longBoxed, doubleBoxed<NEW_LINE>sendBean(env, "S", -4, 14, 204, 0);<NEW_LINE>sendBean(env, "A", 5, 205, 0, 0);<NEW_LINE>sendBean(env, "B", 5, 0, 0, 204);<NEW_LINE>sendBean(env, "C", 5, 0, 14, 0);<NEW_LINE>env.assertEqualsNew("s0", "ids0", null);<NEW_LINE>env.undeployAll();<NEW_LINE>} | 3, 202, 0, 0); |
754,600 | public void close() throws IOException {<NEW_LINE>if (closed) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>closed = true;<NEW_LINE>boolean success = false;<NEW_LINE>try {<NEW_LINE>final long dirStart = out.getFilePointer();<NEW_LINE>final long indexDirStart = indexOut.getFilePointer();<NEW_LINE>out.writeVInt(fields.size());<NEW_LINE>for (FieldMetaData field : fields) {<NEW_LINE>// System.out.println(" field " + field.fieldInfo.name + " " + field.numTerms + " terms<NEW_LINE>// longsSize=" + field.longsSize);<NEW_LINE>out.writeVInt(field.fieldInfo.number);<NEW_LINE>assert field.numTerms > 0;<NEW_LINE><MASK><NEW_LINE>out.writeVInt(field.rootCode.bytes.length);<NEW_LINE>out.writeBytes(field.rootCode.bytes.bytes, field.rootCode.bytes.offset, field.rootCode.bytes.length);<NEW_LINE>if (field.fieldInfo.getIndexOptions() != IndexOptions.DOCS) {<NEW_LINE>out.writeVLong(field.sumTotalTermFreq);<NEW_LINE>}<NEW_LINE>out.writeVLong(field.sumDocFreq);<NEW_LINE>out.writeVInt(field.docCount);<NEW_LINE>indexOut.writeVLong(field.indexStartFP);<NEW_LINE>writeBytesRef(out, field.minTerm);<NEW_LINE>writeBytesRef(out, field.maxTerm);<NEW_LINE>}<NEW_LINE>out.writeLong(dirStart);<NEW_LINE>CodecUtil.writeFooter(out);<NEW_LINE>indexOut.writeLong(indexDirStart);<NEW_LINE>CodecUtil.writeFooter(indexOut);<NEW_LINE>success = true;<NEW_LINE>} finally {<NEW_LINE>if (success) {<NEW_LINE>IOUtils.close(out, indexOut, postingsWriter);<NEW_LINE>} else {<NEW_LINE>IOUtils.closeWhileHandlingException(out, indexOut, postingsWriter);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | out.writeVLong(field.numTerms); |
1,518,670 | public static ListLocationResponse unmarshall(ListLocationResponse listLocationResponse, UnmarshallerContext _ctx) {<NEW_LINE>listLocationResponse.setRequestId(_ctx.stringValue("ListLocationResponse.RequestId"));<NEW_LINE>listLocationResponse.setErrorCode(_ctx.stringValue("ListLocationResponse.ErrorCode"));<NEW_LINE>listLocationResponse.setErrorMessage(_ctx.stringValue("ListLocationResponse.ErrorMessage"));<NEW_LINE>listLocationResponse.setMessage(_ctx.stringValue("ListLocationResponse.Message"));<NEW_LINE>listLocationResponse.setCode(_ctx.stringValue("ListLocationResponse.Code"));<NEW_LINE>listLocationResponse.setDynamicCode(_ctx.stringValue("ListLocationResponse.DynamicCode"));<NEW_LINE>listLocationResponse.setSuccess(_ctx.booleanValue("ListLocationResponse.Success"));<NEW_LINE>listLocationResponse.setDynamicMessage(_ctx.stringValue("ListLocationResponse.DynamicMessage"));<NEW_LINE>List<LocationInfoItem> locationInfoItems = new ArrayList<LocationInfoItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListLocationResponse.LocationInfoItems.Length"); i++) {<NEW_LINE>LocationInfoItem locationInfoItem = new LocationInfoItem();<NEW_LINE>locationInfoItem.setExternalId(_ctx.stringValue("ListLocationResponse.LocationInfoItems[" + i + "].ExternalId"));<NEW_LINE>locationInfoItem.setLocationType(_ctx.stringValue("ListLocationResponse.LocationInfoItems[" + i + "].LocationType"));<NEW_LINE>locationInfoItem.setStatus(_ctx.integerValue("ListLocationResponse.LocationInfoItems[" + i + "].Status"));<NEW_LINE>locationInfoItem.setStoreId(_ctx.longValue("ListLocationResponse.LocationInfoItems[" + i + "].StoreId"));<NEW_LINE>locationInfoItem.setGmtCreate(_ctx.longValue("ListLocationResponse.LocationInfoItems[" + i + "].GmtCreate"));<NEW_LINE>locationInfoItem.setParentLocationId(_ctx.longValue("ListLocationResponse.LocationInfoItems[" + i + "].ParentLocationId"));<NEW_LINE>locationInfoItem.setGmtModified(_ctx.longValue("ListLocationResponse.LocationInfoItems[" + i + "].GmtModified"));<NEW_LINE>locationInfoItem.setLocationName(_ctx.stringValue("ListLocationResponse.LocationInfoItems[" + i + "].LocationName"));<NEW_LINE>locationInfoItem.setLayerType(_ctx.stringValue("ListLocationResponse.LocationInfoItems[" + i + "].LayerType"));<NEW_LINE>locationInfoItem.setLocationId(_ctx.longValue("ListLocationResponse.LocationInfoItems[" + i + "].LocationId"));<NEW_LINE>List<RectRoi> rectRois = new ArrayList<RectRoi>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("ListLocationResponse.LocationInfoItems[" + i + "].RectRois.Length"); j++) {<NEW_LINE>RectRoi rectRoi = new RectRoi();<NEW_LINE>RightBottom rightBottom = new RightBottom();<NEW_LINE>rightBottom.setX(_ctx.floatValue("ListLocationResponse.LocationInfoItems[" + i + "].RectRois[" + j + "].RightBottom.X"));<NEW_LINE>rightBottom.setY(_ctx.floatValue("ListLocationResponse.LocationInfoItems[" + i + "].RectRois[" + j + "].RightBottom.Y"));<NEW_LINE>rectRoi.setRightBottom(rightBottom);<NEW_LINE>LeftTop leftTop = new LeftTop();<NEW_LINE>leftTop.setX(_ctx.floatValue("ListLocationResponse.LocationInfoItems[" + i + "].RectRois[" + j + "].LeftTop.X"));<NEW_LINE>leftTop.setY(_ctx.floatValue("ListLocationResponse.LocationInfoItems[" + i <MASK><NEW_LINE>rectRoi.setLeftTop(leftTop);<NEW_LINE>List<Point> points = new ArrayList<Point>();<NEW_LINE>for (int k = 0; k < _ctx.lengthValue("ListLocationResponse.LocationInfoItems[" + i + "].RectRois[" + j + "].Points.Length"); k++) {<NEW_LINE>Point point = new Point();<NEW_LINE>point.setX(_ctx.floatValue("ListLocationResponse.LocationInfoItems[" + i + "].RectRois[" + j + "].Points[" + k + "].X"));<NEW_LINE>point.setY(_ctx.floatValue("ListLocationResponse.LocationInfoItems[" + i + "].RectRois[" + j + "].Points[" + k + "].Y"));<NEW_LINE>points.add(point);<NEW_LINE>}<NEW_LINE>rectRoi.setPoints(points);<NEW_LINE>rectRois.add(rectRoi);<NEW_LINE>}<NEW_LINE>locationInfoItem.setRectRois(rectRois);<NEW_LINE>locationInfoItems.add(locationInfoItem);<NEW_LINE>}<NEW_LINE>listLocationResponse.setLocationInfoItems(locationInfoItems);<NEW_LINE>return listLocationResponse;<NEW_LINE>} | + "].RectRois[" + j + "].LeftTop.Y")); |
1,355,654 | public AddApplicationCloudWatchLoggingOptionResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>AddApplicationCloudWatchLoggingOptionResult addApplicationCloudWatchLoggingOptionResult = new AddApplicationCloudWatchLoggingOptionResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return addApplicationCloudWatchLoggingOptionResult;<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("ApplicationARN", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>addApplicationCloudWatchLoggingOptionResult.setApplicationARN(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("ApplicationVersionId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>addApplicationCloudWatchLoggingOptionResult.setApplicationVersionId(context.getUnmarshaller(Long.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("CloudWatchLoggingOptionDescriptions", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>addApplicationCloudWatchLoggingOptionResult.setCloudWatchLoggingOptionDescriptions(new ListUnmarshaller<CloudWatchLoggingOptionDescription>(CloudWatchLoggingOptionDescriptionJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return addApplicationCloudWatchLoggingOptionResult;<NEW_LINE>} | class).unmarshall(context)); |
106,600 | /*<NEW_LINE>1. Evaluate DecimalEscape to obtain an EscapeValue E.<NEW_LINE>2. If E is not a character then go to step 6.<NEW_LINE>3. Let ch be E's character.<NEW_LINE>4. Let A be a one-element RECharSet containing the character ch.<NEW_LINE>5. Call CharacterSetMatcher(A, false) and return its Matcher result.<NEW_LINE>6. E must be an integer. Let n be that integer.<NEW_LINE>7. If n=0 or n>NCapturingParens then throw a SyntaxError exception.<NEW_LINE>8. Return an internal Matcher closure that takes two arguments, a State x<NEW_LINE>and a Continuation c, and performs the following:<NEW_LINE>1. Let cap be x's captures internal array.<NEW_LINE>2. Let s be cap[n].<NEW_LINE>3. If s is undefined, then call c(x) and return its result.<NEW_LINE>4. Let e be x's endIndex.<NEW_LINE>5. Let len be s's length.<NEW_LINE>6. Let f be e+len.<NEW_LINE>7. If f>InputLength, return failure.<NEW_LINE>8. If there exists an integer i between 0 (inclusive) and len (exclusive)<NEW_LINE>such that Canonicalize(s[i]) is not the same character as<NEW_LINE>Canonicalize(Input [e+i]), then return failure.<NEW_LINE>9. Let y be the State (f, cap).<NEW_LINE>10. Call c(y) and return its result.<NEW_LINE>*/<NEW_LINE>private static boolean backrefMatcher(REGlobalData gData, int parenIndex, String input, int end) {<NEW_LINE>int len;<NEW_LINE>int i;<NEW_LINE>if (gData.parens == null || parenIndex >= gData.parens.length)<NEW_LINE>return false;<NEW_LINE>int parenContent = gData.parensIndex(parenIndex);<NEW_LINE>if (parenContent == -1)<NEW_LINE>return true;<NEW_LINE><MASK><NEW_LINE>if ((gData.cp + len) > end)<NEW_LINE>return false;<NEW_LINE>if ((gData.regexp.flags & JSREG_FOLD) != 0) {<NEW_LINE>for (i = 0; i < len; i++) {<NEW_LINE>char c1 = input.charAt(parenContent + i);<NEW_LINE>char c2 = input.charAt(gData.cp + i);<NEW_LINE>if (c1 != c2 && upcase(c1) != upcase(c2))<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} else if (!input.regionMatches(parenContent, input, gData.cp, len)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>gData.cp += len;<NEW_LINE>return true;<NEW_LINE>} | len = gData.parensLength(parenIndex); |
1,098,870 | protected void updateMonth(final boolean animate) {<NEW_LINE>// Even if someone is asking to animate transition we have to honor calendar settings<NEW_LINE>// If it isn't set to be animated then we should never animate any transitions within it<NEW_LINE>if (animate && isAnimate()) {<NEW_LINE>// Creating new dates panel<NEW_LINE>monthDays = createMonthPanel();<NEW_LINE>// Updating current dates<NEW_LINE>updateMonth(monthDays);<NEW_LINE>// Setting collapse transition effects<NEW_LINE>final boolean ltr = getComponentOrientation().isLeftToRight();<NEW_LINE>// Transition effect<NEW_LINE>final SlideTransitionEffect effect = new SlideTransitionEffect();<NEW_LINE>effect.setType(SlideType.moveBoth);<NEW_LINE>effect.setDirection(oldShownDate.getTime() > shownDate.getTime() ? getNextDirection(<MASK><NEW_LINE>effect.setSpeed(20);<NEW_LINE>monthDaysTransition.setTransitionEffect(effect);<NEW_LINE>// Starting animated transition<NEW_LINE>monthDaysTransition.performTransition(monthDays);<NEW_LINE>} else {<NEW_LINE>// Updating current dates<NEW_LINE>updateMonth(monthDays);<NEW_LINE>// Transferring focus<NEW_LINE>requestFocusToSelected();<NEW_LINE>}<NEW_LINE>} | ltr) : getPrevDirection(ltr)); |
1,046,092 | protected SearchResultItem createSearchResultItem(NewznabXmlItem item) throws NzbHydraException {<NEW_LINE>SearchResultItem searchResultItem = new SearchResultItem();<NEW_LINE>String link = getEnclosureUrl(item);<NEW_LINE>searchResultItem.setLink(link);<NEW_LINE>if (item.getRssGuid().isPermaLink()) {<NEW_LINE>searchResultItem.setDetails(item.getRssGuid().getGuid());<NEW_LINE>Matcher matcher = GUID_PATTERN.matcher(item.getRssGuid().getGuid());<NEW_LINE>if (matcher.matches()) {<NEW_LINE>searchResultItem.setIndexerGuid(matcher.group(2));<NEW_LINE>} else {<NEW_LINE>searchResultItem.setIndexerGuid(item.getRssGuid().getGuid());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>searchResultItem.setIndexerGuid(item.<MASK><NEW_LINE>}<NEW_LINE>if (!Strings.isNullOrEmpty(item.getComments()) && Strings.isNullOrEmpty(searchResultItem.getDetails())) {<NEW_LINE>searchResultItem.setDetails(item.getComments().replace("#comments", ""));<NEW_LINE>}<NEW_LINE>// LATER If details link still not set build it using the GUID which is sure to be not a link at this point. Perhaps this isn't necessary because all indexers should have a comments link<NEW_LINE>searchResultItem.setFirstFound(Instant.now());<NEW_LINE>searchResultItem.setIndexer(this);<NEW_LINE>searchResultItem.setTitle(cleanUpTitle(item.getTitle()));<NEW_LINE>searchResultItem.setSize(item.getEnclosure().getLength());<NEW_LINE>searchResultItem.setPubDate(item.getPubDate());<NEW_LINE>searchResultItem.setIndexerScore(config.getScore());<NEW_LINE>searchResultItem.setGuid(SearchResultIdCalculator.calculateSearchResultId(searchResultItem));<NEW_LINE>searchResultItem.setAgePrecise(true);<NEW_LINE>searchResultItem.setDescription(item.getDescription());<NEW_LINE>searchResultItem.setDownloadType(DownloadType.NZB);<NEW_LINE>searchResultItem.setCommentsLink(item.getComments());<NEW_LINE>// May be overwritten by mapping in attributes<NEW_LINE>searchResultItem.setOriginalCategory(item.getCategory());<NEW_LINE>parseAttributes(item, searchResultItem);<NEW_LINE>return searchResultItem;<NEW_LINE>} | getRssGuid().getGuid()); |
368,098 | // </editor-fold>//GEN-END:initComponents<NEW_LINE>private void btnBrowseActionPerformed(java.awt.event.ActionEvent evt) {<NEW_LINE>// GEN-FIRST:event_btnBrowseActionPerformed<NEW_LINE>File oldFile = new <MASK><NEW_LINE>// NOI18N<NEW_LINE>JFileChooser fileChooser = new AccessibleJFileChooser(NbBundle.getMessage(CreatePanel.class, "ACSD_BrowseFolder"), oldFile);<NEW_LINE>// NOI18N<NEW_LINE>fileChooser.setDialogTitle(NbBundle.getMessage(CreatePanel.class, "Browse_title"));<NEW_LINE>fileChooser.setMultiSelectionEnabled(false);<NEW_LINE>FileFilter[] old = fileChooser.getChoosableFileFilters();<NEW_LINE>for (int i = 0; i < old.length; i++) {<NEW_LINE>FileFilter fileFilter = old[i];<NEW_LINE>fileChooser.removeChoosableFileFilter(fileFilter);<NEW_LINE>}<NEW_LINE>fileChooser.addChoosableFileFilter(new FileFilter() {<NEW_LINE><NEW_LINE>public boolean accept(File f) {<NEW_LINE>return f.isDirectory();<NEW_LINE>}<NEW_LINE><NEW_LINE>public String getDescription() {<NEW_LINE>// NOI18N<NEW_LINE>return NbBundle.getMessage(CreatePanel.class, "Folders");<NEW_LINE>}<NEW_LINE>});<NEW_LINE>fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);<NEW_LINE>// NOI18N<NEW_LINE>fileChooser.showDialog(this, NbBundle.getMessage(CreatePanel.class, "OK_Button"));<NEW_LINE>File f = fileChooser.getSelectedFile();<NEW_LINE>if (f != null) {<NEW_LINE>tfRootPath.setText(f.getAbsolutePath());<NEW_LINE>}<NEW_LINE>} | File(tfRootPath.getText()); |
1,852,259 | public static void register(ScalarFunctionModule module) {<NEW_LINE>for (var type : DataTypes.NUMERIC_PRIMITIVE_TYPES) {<NEW_LINE>DataType<?> returnType = DataTypes.getIntegralReturnType(type);<NEW_LINE>assert returnType != null : "Could not get integral type of " + type;<NEW_LINE>// trunc(number)<NEW_LINE>module.register(scalar(NAME, type.getTypeSignature(), returnType.getTypeSignature()).withForbiddenCoercion(), (signature, boundSignature) -> new UnaryScalar<>(signature, boundSignature, type, n -> {<NEW_LINE>double val = ((<MASK><NEW_LINE>Function<Double, Double> f = val >= 0 ? Math::floor : Math::ceil;<NEW_LINE>return (Number) returnType.sanitizeValue(f.apply(val));<NEW_LINE>}));<NEW_LINE>}<NEW_LINE>// trunc(number, mode)<NEW_LINE>module.register(scalar(NAME, DataTypes.DOUBLE.getTypeSignature(), DataTypes.INTEGER.getTypeSignature(), DataTypes.DOUBLE.getTypeSignature()), TruncFunction::createTruncWithMode);<NEW_LINE>} | Number) n).doubleValue(); |
1,589,632 | public void add(final long rangeStart, final long rangeEnd) {<NEW_LINE>rangeSanityCheck(rangeStart, rangeEnd);<NEW_LINE>if (rangeStart >= rangeEnd) {<NEW_LINE>// empty range<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final int hbStart = (BufferUtil.highbits(rangeStart));<NEW_LINE>final int lbStart = (BufferUtil.lowbits(rangeStart));<NEW_LINE>final int hbLast = (BufferUtil.highbits(rangeEnd - 1));<NEW_LINE>final int lbLast = (BufferUtil.lowbits(rangeEnd - 1));<NEW_LINE>for (int hb = hbStart; hb <= hbLast; ++hb) {<NEW_LINE>// first container may contain partial range<NEW_LINE>final int containerStart = (hb == hbStart) ? lbStart : 0;<NEW_LINE>// last container may contain partial range<NEW_LINE>final int containerLast = (hb == hbLast) ? lbLast : BufferUtil.maxLowBitAsInteger();<NEW_LINE>final int i = highLowContainer<MASK><NEW_LINE>if (i >= 0) {<NEW_LINE>final MappeableContainer c = highLowContainer.getContainerAtIndex(i).iadd(containerStart, containerLast + 1);<NEW_LINE>((MutableRoaringArray) highLowContainer).setContainerAtIndex(i, c);<NEW_LINE>} else {<NEW_LINE>((MutableRoaringArray) highLowContainer).insertNewKeyValueAt(-i - 1, (char) hb, MappeableContainer.rangeOfOnes(containerStart, containerLast + 1));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .getIndex((char) hb); |
211,348 | private RdSetElem toRdSetElem(Rd_set_elemContext ctx) {<NEW_LINE>if (ctx.rd_set_elem_asdot() != null) {<NEW_LINE>@Nullable<NEW_LINE>Entry<Uint16RangeExpr, Uint16RangeExpr> as = toUint32HighLowExpr(ctx.rd_set_elem_asdot());<NEW_LINE>if (as == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return new RdSetAsDot(as.getKey(), as.getValue(), toUint16RangeExpr(ctx.rd_set_elem_lo16()));<NEW_LINE>} else if (ctx.asplain_hi16 != null) {<NEW_LINE>assert ctx.rd_set_elem_32() != null;<NEW_LINE>return new RdSetAsPlain16(new LiteralUint16(toInteger(ctx.asplain_hi16)), toUint32RangeExpr(ctx.rd_set_elem_32()));<NEW_LINE>} else if (ctx.asplain_hi32 != null) {<NEW_LINE>assert ctx.rd_set_elem_lo16() != null;<NEW_LINE>return new RdSetAsPlain32(toUint32RangeExpr(ctx.asplain_hi32), toUint16RangeExpr<MASK><NEW_LINE>} else if (ctx.IP_PREFIX() != null) {<NEW_LINE>assert ctx.rd_set_elem_lo16() != null;<NEW_LINE>return new RdSetIpPrefix(Prefix.parse(ctx.IP_PREFIX().getText()), toUint16RangeExpr(ctx.rd_set_elem_lo16()));<NEW_LINE>} else if (ctx.IP_ADDRESS() != null) {<NEW_LINE>assert ctx.rd_set_elem_lo16() != null;<NEW_LINE>return new RdSetIpAddress(toIp(ctx.IP_ADDRESS()), toUint16RangeExpr(ctx.rd_set_elem_lo16()));<NEW_LINE>} else if (ctx.DFA_REGEX() != null) {<NEW_LINE>return new RdSetDfaRegex(unquote(ctx.COMMUNITY_SET_REGEX().getText()));<NEW_LINE>} else {<NEW_LINE>assert ctx.IOS_REGEX() != null;<NEW_LINE>return new RdSetIosRegex(unquote(ctx.COMMUNITY_SET_REGEX().getText()));<NEW_LINE>}<NEW_LINE>} | (ctx.rd_set_elem_lo16())); |
643,717 | public static DescribeSlowLogRecordsResponse unmarshall(DescribeSlowLogRecordsResponse describeSlowLogRecordsResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeSlowLogRecordsResponse.setRequestId(_ctx.stringValue("DescribeSlowLogRecordsResponse.RequestId"));<NEW_LINE>SlowLogRecords slowLogRecords = new SlowLogRecords();<NEW_LINE>slowLogRecords.setRows(_ctx.stringValue("DescribeSlowLogRecordsResponse.SlowLogRecords.Rows"));<NEW_LINE>slowLogRecords.setRowsBeforeLimitAtLeast(_ctx.stringValue("DescribeSlowLogRecordsResponse.SlowLogRecords.RowsBeforeLimitAtLeast"));<NEW_LINE>Statistics statistics = new Statistics();<NEW_LINE>statistics.setRowsRead(_ctx.integerValue("DescribeSlowLogRecordsResponse.SlowLogRecords.Statistics.RowsRead"));<NEW_LINE>statistics.setElapsedTime(_ctx.floatValue("DescribeSlowLogRecordsResponse.SlowLogRecords.Statistics.ElapsedTime"));<NEW_LINE>statistics.setBytesRead(_ctx.integerValue("DescribeSlowLogRecordsResponse.SlowLogRecords.Statistics.BytesRead"));<NEW_LINE>slowLogRecords.setStatistics(statistics);<NEW_LINE>List<ResultSet> tableSchema = new ArrayList<ResultSet>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeSlowLogRecordsResponse.SlowLogRecords.TableSchema.Length"); i++) {<NEW_LINE>ResultSet resultSet = new ResultSet();<NEW_LINE>resultSet.setType(_ctx.stringValue("DescribeSlowLogRecordsResponse.SlowLogRecords.TableSchema[" + i + "].Type"));<NEW_LINE>resultSet.setName(_ctx.stringValue("DescribeSlowLogRecordsResponse.SlowLogRecords.TableSchema[" + i + "].Name"));<NEW_LINE>tableSchema.add(resultSet);<NEW_LINE>}<NEW_LINE>slowLogRecords.setTableSchema(tableSchema);<NEW_LINE>List<ResultSet1> data = new ArrayList<ResultSet1>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeSlowLogRecordsResponse.SlowLogRecords.Data.Length"); i++) {<NEW_LINE>ResultSet1 resultSet1 = new ResultSet1();<NEW_LINE>resultSet1.setType(_ctx.stringValue("DescribeSlowLogRecordsResponse.SlowLogRecords.Data[" + i + "].Type"));<NEW_LINE>resultSet1.setQueryStartTime(_ctx.stringValue("DescribeSlowLogRecordsResponse.SlowLogRecords.Data[" + i + "].QueryStartTime"));<NEW_LINE>resultSet1.setQuery(_ctx.stringValue("DescribeSlowLogRecordsResponse.SlowLogRecords.Data[" + i + "].Query"));<NEW_LINE>resultSet1.setReadRows(_ctx.stringValue("DescribeSlowLogRecordsResponse.SlowLogRecords.Data[" + i + "].ReadRows"));<NEW_LINE>resultSet1.setInitialAddress(_ctx.stringValue("DescribeSlowLogRecordsResponse.SlowLogRecords.Data[" + i + "].InitialAddress"));<NEW_LINE>resultSet1.setMemoryUsage(_ctx.stringValue("DescribeSlowLogRecordsResponse.SlowLogRecords.Data[" + i + "].MemoryUsage"));<NEW_LINE>resultSet1.setInitialUser(_ctx.stringValue("DescribeSlowLogRecordsResponse.SlowLogRecords.Data[" + i + "].InitialUser"));<NEW_LINE>resultSet1.setInitialQueryId(_ctx.stringValue("DescribeSlowLogRecordsResponse.SlowLogRecords.Data[" + i + "].InitialQueryId"));<NEW_LINE>resultSet1.setReadBytes(_ctx.stringValue("DescribeSlowLogRecordsResponse.SlowLogRecords.Data[" + i + "].ReadBytes"));<NEW_LINE>resultSet1.setQueryDurationMs(_ctx.stringValue<MASK><NEW_LINE>resultSet1.setResultBytes(_ctx.stringValue("DescribeSlowLogRecordsResponse.SlowLogRecords.Data[" + i + "].ResultBytes"));<NEW_LINE>data.add(resultSet1);<NEW_LINE>}<NEW_LINE>slowLogRecords.setData(data);<NEW_LINE>describeSlowLogRecordsResponse.setSlowLogRecords(slowLogRecords);<NEW_LINE>return describeSlowLogRecordsResponse;<NEW_LINE>} | ("DescribeSlowLogRecordsResponse.SlowLogRecords.Data[" + i + "].QueryDurationMs")); |
857,543 | public void registerModify(Entity entity, boolean auto, @Nullable EntityAttributeChanges changes) {<NEW_LINE>try {<NEW_LINE>if (doNotRegister(entity))<NEW_LINE>return;<NEW_LINE>String masterEntityName = getEntityName(entity);<NEW_LINE>boolean isCategoryAttributeValue = entity instanceof CategoryAttributeValue;<NEW_LINE>Set<String> attributes = getLoggedAttributes(masterEntityName, auto);<NEW_LINE>if (attributes != null && attributes.contains("*")) {<NEW_LINE>attributes = getAllAttributes(entity);<NEW_LINE>}<NEW_LINE>if (attributes == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>MetaClass metaClass = metadata.getClassNN(masterEntityName);<NEW_LINE>attributes = filterRemovedAttributes(metaClass, attributes);<NEW_LINE>if (isCategoryAttributeValue) {<NEW_LINE>internalRegisterModifyAttributeValue((CategoryAttributeValue) entity, changes, attributes);<NEW_LINE>} else {<NEW_LINE>String storeName = metadataTools.getStoreName(metaClass);<NEW_LINE>internalRegisterModify(entity, <MASK><NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>logError(entity, e);<NEW_LINE>}<NEW_LINE>} | changes, metaClass, storeName, attributes); |
3,282 | private CompilerSettings buildCompilerSettings(Map<String, String> params) {<NEW_LINE>CompilerSettings compilerSettings;<NEW_LINE>if (params.isEmpty()) {<NEW_LINE>// Use the default settings.<NEW_LINE>compilerSettings = defaultCompilerSettings;<NEW_LINE>} else {<NEW_LINE>// Use custom settings specified by params.<NEW_LINE>compilerSettings = new CompilerSettings();<NEW_LINE>// Except regexes enabled - this is a node level setting and can't be changed in the request.<NEW_LINE>compilerSettings.setRegexesEnabled(defaultCompilerSettings.areRegexesEnabled());<NEW_LINE>compilerSettings.setRegexLimitFactor(defaultCompilerSettings.getRegexLimitFactor());<NEW_LINE>Map<String, String> copy = new HashMap<>(params);<NEW_LINE>String value = copy.remove(CompilerSettings.MAX_LOOP_COUNTER);<NEW_LINE>if (value != null) {<NEW_LINE>compilerSettings.setMaxLoopCounter(Integer.parseInt(value));<NEW_LINE>}<NEW_LINE>value = copy.remove(CompilerSettings.PICKY);<NEW_LINE>if (value != null) {<NEW_LINE>compilerSettings.setPicky(Boolean.parseBoolean(value));<NEW_LINE>}<NEW_LINE>value = copy.remove(CompilerSettings.INITIAL_CALL_SITE_DEPTH);<NEW_LINE>if (value != null) {<NEW_LINE>compilerSettings.setInitialCallSiteDepth<MASK><NEW_LINE>}<NEW_LINE>value = copy.remove(CompilerSettings.REGEX_ENABLED.getKey());<NEW_LINE>if (value != null) {<NEW_LINE>throw new IllegalArgumentException("[painless.regex.enabled] can only be set on node startup.");<NEW_LINE>}<NEW_LINE>value = copy.remove(CompilerSettings.REGEX_LIMIT_FACTOR.getKey());<NEW_LINE>if (value != null) {<NEW_LINE>throw new IllegalArgumentException("[painless.regex.limit-factor] can only be set on node startup.");<NEW_LINE>}<NEW_LINE>if (!copy.isEmpty()) {<NEW_LINE>throw new IllegalArgumentException("Unrecognized compile-time parameter(s): " + copy);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return compilerSettings;<NEW_LINE>} | (Integer.parseInt(value)); |
239,416 | public void updateBPartnerReminderDate(final I_R_Request request) {<NEW_LINE>final Timestamp reminderDate = request.getReminderDate();<NEW_LINE>if (reminderDate == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final UserId adUserId = UserId.ofRepoIdOrNull(request.getSalesRep_ID());<NEW_LINE>if (adUserId == null || !adUserId.isRegularUser()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final BPartnerId bpartnerId = BPartnerId.ofRepoIdOrNull(request.getC_BPartner_ID());<NEW_LINE>if (bpartnerId == null) {<NEW_LINE>// nothing to do<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final I_C_BPartner <MASK><NEW_LINE>if (bpartner == null) {<NEW_LINE>// nothing to do<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (bpartner.getSalesRepIntern_ID() == adUserId.getRepoId()) {<NEW_LINE>bpartner.setReminderDateIntern(reminderDate);<NEW_LINE>} else if (bpartner.getSalesRep_ID() == adUserId.getRepoId()) {<NEW_LINE>bpartner.setReminderDateExtern(reminderDate);<NEW_LINE>} else {<NEW_LINE>// nothing to do<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>bpartnerDAO.save(bpartner);<NEW_LINE>documentsCollection.invalidateDocumentByRecordId(I_C_BPartner.Table_Name, bpartner.getC_BPartner_ID());<NEW_LINE>} | bpartner = bpartnerDAO.getByIdInTrx(bpartnerId); |
1,631,336 | private STNode parseFieldDescriptorRhs(STNode metadata, STNode readonlyQualifier, STNode type, STNode fieldName) {<NEW_LINE>STToken nextToken = peek();<NEW_LINE>switch(nextToken.kind) {<NEW_LINE>case SEMICOLON_TOKEN:<NEW_LINE><MASK><NEW_LINE>STNode semicolonToken = parseSemicolon();<NEW_LINE>return STNodeFactory.createRecordFieldNode(metadata, readonlyQualifier, type, fieldName, questionMarkToken, semicolonToken);<NEW_LINE>case QUESTION_MARK_TOKEN:<NEW_LINE>questionMarkToken = parseQuestionMark();<NEW_LINE>semicolonToken = parseSemicolon();<NEW_LINE>return STNodeFactory.createRecordFieldNode(metadata, readonlyQualifier, type, fieldName, questionMarkToken, semicolonToken);<NEW_LINE>case EQUAL_TOKEN:<NEW_LINE>// parseRecordDefaultValue();<NEW_LINE>STNode equalsToken = parseAssignOp();<NEW_LINE>STNode expression = parseExpression();<NEW_LINE>semicolonToken = parseSemicolon();<NEW_LINE>return STNodeFactory.createRecordFieldWithDefaultValueNode(metadata, readonlyQualifier, type, fieldName, equalsToken, expression, semicolonToken);<NEW_LINE>default:<NEW_LINE>recover(nextToken, ParserRuleContext.FIELD_DESCRIPTOR_RHS);<NEW_LINE>return parseFieldDescriptorRhs(metadata, readonlyQualifier, type, fieldName);<NEW_LINE>}<NEW_LINE>} | STNode questionMarkToken = STNodeFactory.createEmptyNode(); |
426,111 | public void processingDone(List<Processing> processings) {<NEW_LINE>List<DocumentMessage> messages = new ArrayList<>();<NEW_LINE>if (messageFactory != null) {<NEW_LINE>for (Processing processing : processings) {<NEW_LINE>for (DocumentOperation documentOperation : processing.getDocumentOperations()) {<NEW_LINE>messages.add(messageFactory.fromDocumentOperation(processing, documentOperation));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>log.log(Level.FINE, () -> "Forwarding " + messages.size() + " messages from " + processings.size() + " processings.");<NEW_LINE>if (messages.isEmpty()) {<NEW_LINE>dispatchResponse(Response.Status.OK);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>ResponseMerger responseHandler = new ResponseMerger(requestMsg, messages.size(), this);<NEW_LINE>int numMsgWithOriginalSequenceId = 0;<NEW_LINE>for (Message message : messages) {<NEW_LINE>if (message.getSequenceId() == inputSequenceId)<NEW_LINE>numMsgWithOriginalSequenceId++;<NEW_LINE>}<NEW_LINE>for (Message message : messages) {<NEW_LINE>String path = internalNoThrottledSourcePath;<NEW_LINE>if ((numMsgWithOriginalSequenceId == 1) && (message.getSequenceId() == inputSequenceId))<NEW_LINE>path = getUri().getPath();<NEW_LINE>// See comment for internalNoThrottledSource<NEW_LINE>dispatchRequest(message, path, responseHandler);<NEW_LINE>}<NEW_LINE>} | long inputSequenceId = requestMsg.getSequenceId(); |
1,493,508 | private void dumpSkyframeStateAfterBuild(@Nullable BuildEventProtocolOptions besOptions, String format, @Nullable PathFragment outputFilePathFragment) throws CommandLineExpansionException, IOException, InvalidAqueryOutputFormatException {<NEW_LINE>Preconditions.checkState(env.getSkyframeExecutor() instanceof SequencedSkyframeExecutor);<NEW_LINE>UploadContext streamingContext = null;<NEW_LINE>Path localOutputFilePath = null;<NEW_LINE>String outputFileName;<NEW_LINE>if (outputFilePathFragment == null) {<NEW_LINE>outputFileName = getDefaultOutputFileName(format);<NEW_LINE>if (besOptions != null && besOptions.streamingLogFileUploads) {<NEW_LINE>streamingContext = runtime.getBuildEventArtifactUploaderFactoryMap().select(besOptions.buildEventUploadStrategy).create(env).startUpload(LocalFileType.PERFORMANCE_LOG, /* inputSupplier= */<NEW_LINE>null);<NEW_LINE>} else {<NEW_LINE>localOutputFilePath = env.getOutputBase().getRelative(outputFileName);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>localOutputFilePath = env.getOutputBase().getRelative(outputFilePathFragment);<NEW_LINE>outputFileName = localOutputFilePath.getBaseName();<NEW_LINE>}<NEW_LINE>if (localOutputFilePath != null) {<NEW_LINE>getReporter().handle(Event.info("Writing aquery dump to " + localOutputFilePath));<NEW_LINE>getReporter().post(new StartingAqueryDumpAfterBuildEvent(localOutputFilePath, outputFileName));<NEW_LINE>} else {<NEW_LINE>getReporter().handle<MASK><NEW_LINE>getReporter().post(new StartingAqueryDumpAfterBuildEvent(streamingContext, outputFileName));<NEW_LINE>}<NEW_LINE>try (OutputStream outputStream = initOutputStream(streamingContext, localOutputFilePath);<NEW_LINE>PrintStream printStream = new PrintStream(outputStream);<NEW_LINE>AqueryOutputHandler aqueryOutputHandler = ActionGraphProtoOutputFormatterCallback.constructAqueryOutputHandler(OutputType.fromString(format), outputStream, printStream)) {<NEW_LINE>// These options are fixed for simplicity. We'll add more configurability if the need arises.<NEW_LINE>ActionGraphDump actionGraphDump = new ActionGraphDump(/* includeActionCmdLine= */<NEW_LINE>false, /* includeArtifacts= */<NEW_LINE>true, /* actionFilters= */<NEW_LINE>null, /* includeParamFiles= */<NEW_LINE>false, /* deduplicateDepsets= */<NEW_LINE>true, aqueryOutputHandler);<NEW_LINE>((SequencedSkyframeExecutor) env.getSkyframeExecutor()).dumpSkyframeState(actionGraphDump);<NEW_LINE>}<NEW_LINE>} | (Event.info("Streaming aquery dump.")); |
195,112 | public void marshall(UpdateApplicationRequest updateApplicationRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (updateApplicationRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(updateApplicationRequest.getResourceGroupName(), RESOURCEGROUPNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(updateApplicationRequest.getCWEMonitorEnabled(), CWEMONITORENABLED_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateApplicationRequest.getOpsItemSNSTopicArn(), OPSITEMSNSTOPICARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateApplicationRequest.getRemoveSNSTopic(), REMOVESNSTOPIC_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateApplicationRequest.getAutoConfigEnabled(), AUTOCONFIGENABLED_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | updateApplicationRequest.getOpsCenterEnabled(), OPSCENTERENABLED_BINDING); |
1,501,452 | private void processRpcResponseStatus(TbActorCtx context, SessionInfoProto sessionInfo, ToDeviceRpcResponseStatusMsg responseMsg) {<NEW_LINE>UUID rpcId = new UUID(responseMsg.getRequestIdMSB(), responseMsg.getRequestIdLSB());<NEW_LINE>RpcStatus status = RpcStatus.valueOf(responseMsg.getStatus());<NEW_LINE>ToDeviceRpcRequestMetadata md = toDeviceRpcPendingMap.<MASK><NEW_LINE>if (md != null) {<NEW_LINE>JsonNode response = null;<NEW_LINE>if (status.equals(RpcStatus.DELIVERED)) {<NEW_LINE>if (md.getMsg().getMsg().isOneway()) {<NEW_LINE>toDeviceRpcPendingMap.remove(responseMsg.getRequestId());<NEW_LINE>if (rpcSequential) {<NEW_LINE>systemContext.getTbCoreDeviceRpcService().processRpcResponseFromDeviceActor(new FromDeviceRpcResponse(rpcId, null, null));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>md.setDelivered(true);<NEW_LINE>}<NEW_LINE>} else if (status.equals(RpcStatus.TIMEOUT)) {<NEW_LINE>Integer maxRpcRetries = md.getMsg().getMsg().getRetries();<NEW_LINE>maxRpcRetries = maxRpcRetries == null ? systemContext.getMaxRpcRetries() : Math.min(maxRpcRetries, systemContext.getMaxRpcRetries());<NEW_LINE>if (maxRpcRetries <= md.getRetries()) {<NEW_LINE>toDeviceRpcPendingMap.remove(responseMsg.getRequestId());<NEW_LINE>status = RpcStatus.FAILED;<NEW_LINE>response = JacksonUtil.newObjectNode().put("error", "There was a Timeout and all retry attempts have been exhausted. Retry attempts set: " + maxRpcRetries);<NEW_LINE>} else {<NEW_LINE>md.setRetries(md.getRetries() + 1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (md.getMsg().getMsg().isPersisted()) {<NEW_LINE>systemContext.getTbRpcService().save(tenantId, new RpcId(rpcId), status, response);<NEW_LINE>}<NEW_LINE>if (status != RpcStatus.SENT) {<NEW_LINE>sendNextPendingRequest(context);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>log.info("[{}][{}] Rpc has already removed from pending map.", deviceId, rpcId);<NEW_LINE>}<NEW_LINE>} | get(responseMsg.getRequestId()); |
336,847 | List<OrderDecorator> buildCustomFilterList(Element element, ParserContext pc) {<NEW_LINE>List<Element> customFilterElts = DomUtils.getChildElementsByTagName(element, Elements.CUSTOM_FILTER);<NEW_LINE>List<OrderDecorator> customFilters = new ArrayList<>();<NEW_LINE>for (Element elt : customFilterElts) {<NEW_LINE>String after = elt.getAttribute(ATT_AFTER);<NEW_LINE>String before = elt.getAttribute(ATT_BEFORE);<NEW_LINE>String position = elt.getAttribute(ATT_POSITION);<NEW_LINE>String ref = elt.getAttribute(ATT_REF);<NEW_LINE>if (!StringUtils.hasText(ref)) {<NEW_LINE>pc.getReaderContext().error("The '" + ATT_REF + "' attribute must be supplied", pc.extractSource(elt));<NEW_LINE>}<NEW_LINE>RuntimeBeanReference bean = new RuntimeBeanReference(ref);<NEW_LINE>if (WebConfigUtils.countNonEmpty(new String[] { after, before, position }) != 1) {<NEW_LINE>pc.getReaderContext().error("A single '" + ATT_AFTER + "', '" + ATT_BEFORE + "', or '" + ATT_POSITION + "' attribute must be supplied", pc.extractSource(elt));<NEW_LINE>}<NEW_LINE>if (StringUtils.hasText(position)) {<NEW_LINE>customFilters.add(new OrderDecorator(bean, <MASK><NEW_LINE>} else if (StringUtils.hasText(after)) {<NEW_LINE>SecurityFilters order = SecurityFilters.valueOf(after);<NEW_LINE>if (order == SecurityFilters.LAST) {<NEW_LINE>customFilters.add(new OrderDecorator(bean, SecurityFilters.LAST));<NEW_LINE>} else {<NEW_LINE>customFilters.add(new OrderDecorator(bean, order.getOrder() + 1));<NEW_LINE>}<NEW_LINE>} else if (StringUtils.hasText(before)) {<NEW_LINE>SecurityFilters order = SecurityFilters.valueOf(before);<NEW_LINE>if (order == SecurityFilters.FIRST) {<NEW_LINE>customFilters.add(new OrderDecorator(bean, SecurityFilters.FIRST));<NEW_LINE>} else {<NEW_LINE>customFilters.add(new OrderDecorator(bean, order.getOrder() - 1));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return customFilters;<NEW_LINE>} | SecurityFilters.valueOf(position))); |
1,686,693 | private static void loadDefs(Map<String, String> p, Map<String, Class> defs, ClassLoader l) throws IOException {<NEW_LINE>// Similar to IntrospectedInfo.load, after having parsed the properties.<NEW_LINE>for (Map.Entry<String, String> entry : p.entrySet()) {<NEW_LINE>String name = entry.getKey();<NEW_LINE>String clazzname = entry.getValue();<NEW_LINE>try {<NEW_LINE>Class<?> <MASK><NEW_LINE>defs.put(name, clazz);<NEW_LINE>} catch (ClassNotFoundException cnfe) {<NEW_LINE>// This is not normal. If the class is mentioned, it should be there.<NEW_LINE>// NOI18N<NEW_LINE>throw (IOException) new IOException("Could not load class " + clazzname + ": " + cnfe).initCause(cnfe);<NEW_LINE>} catch (NoClassDefFoundError ncdfe) {<NEW_LINE>// Normal for e.g. tasks dumped there by disabled modules.<NEW_LINE>// Cf. #36702 for possible better solution.<NEW_LINE>LOG.log(Level.FINE, "AntBridge.loadDefs: skipping {0}: {1}", new Object[] { clazzname, ncdfe });<NEW_LINE>} catch (LinkageError e) {<NEW_LINE>// Not normal; if it is there it ought to be resolvable etc.<NEW_LINE>// NOI18N<NEW_LINE>throw (IOException) new IOException("Could not load class " + clazzname + ": " + e).initCause(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | clazz = l.loadClass(clazzname); |
1,258,415 | private static InputSource createInputSource(FileObject fo, EditorCookie editor, final StyledDocument document) throws IOException, BadLocationException {<NEW_LINE>final StringWriter w = new StringWriter(document.getLength());<NEW_LINE>final EditorKit kit = findKit(editor);<NEW_LINE>if (kit == null)<NEW_LINE>return null;<NEW_LINE>final IOException[<MASK><NEW_LINE>final BadLocationException[] ble = new BadLocationException[1];<NEW_LINE>document.render(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>try {<NEW_LINE>kit.write(w, document, 0, document.getLength());<NEW_LINE>} catch (IOException e) {<NEW_LINE>ioe[0] = e;<NEW_LINE>} catch (BadLocationException e) {<NEW_LINE>ble[0] = e;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>if (ioe[0] != null) {<NEW_LINE>throw ioe[0];<NEW_LINE>} else if (ble[0] != null) {<NEW_LINE>throw ble[0];<NEW_LINE>}<NEW_LINE>InputSource in = new InputSource(new StringReader(w.toString()));<NEW_LINE>if (fo != null) {<NEW_LINE>// #10348<NEW_LINE>in.setSystemId(fo.toURL().toExternalForm());<NEW_LINE>// [PENDING] Ant's ProjectHelper has an elaborate set of work-<NEW_LINE>// arounds for inconsistent parser behavior, e.g. file:foo.xml<NEW_LINE>// works in Ant but not with Xerces parser. You must use just foo.xml<NEW_LINE>// as the system ID. If necessary, Ant's algorithm could be copied<NEW_LINE>// here to make the behavior match perfectly, but it ought not be necessary.<NEW_LINE>}<NEW_LINE>return in;<NEW_LINE>} | ] ioe = new IOException[1]; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.