idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
697,277 | private void recordParentInfo(final SpanRecorder recorder, final T request) {<NEW_LINE>final String parentApplicationName = requestAdaptor.getHeader(request, <MASK><NEW_LINE>if (parentApplicationName != null) {<NEW_LINE>String host = requestAdaptor.getHeader(request, Header.HTTP_HOST.toString());<NEW_LINE>if (host == null) {<NEW_LINE>host = requestAdaptor.getAcceptorHost(request);<NEW_LINE>}<NEW_LINE>recorder.recordAcceptorHost(host);<NEW_LINE>if (isDebug) {<NEW_LINE>logger.debug("Record acceptorHost={}", host);<NEW_LINE>}<NEW_LINE>final String type = requestAdaptor.getHeader(request, Header.HTTP_PARENT_APPLICATION_TYPE.toString());<NEW_LINE>final short parentApplicationType = NumberUtils.parseShort(type, ServiceType.UNDEFINED.getCode());<NEW_LINE>recorder.recordParentApplication(parentApplicationName, parentApplicationType);<NEW_LINE>if (isDebug) {<NEW_LINE>logger.debug("Record parentApplicationName={}, parentApplicationType={}", parentApplicationName, parentApplicationType);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (isDebug) {<NEW_LINE>logger.debug("Not found parentApplication");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | Header.HTTP_PARENT_APPLICATION_NAME.toString()); |
381,970 | public static ProcessingCapacityNotificationInfo from(CompositeData cd) {<NEW_LINE>ProcessingCapacityNotificationInfo result = null;<NEW_LINE>if (cd != null) {<NEW_LINE>// Does cd meet the necessary criteria to create a new<NEW_LINE>// ProcessingCapacityNotificationInfo ? If not then one of the<NEW_LINE>// following method invocations will exit on an<NEW_LINE>// IllegalArgumentException...<NEW_LINE><MASK><NEW_LINE>// $NON-NLS-1$<NEW_LINE>String[] attributeNames = { "newProcessingCapacity" };<NEW_LINE>ManagementUtils.verifyFieldNames(cd, attributeNames);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>String[] attributeTypes = { "java.lang.Integer" };<NEW_LINE>ManagementUtils.verifyFieldTypes(cd, attributeNames, attributeTypes);<NEW_LINE>// Extract the values of the attributes and use them to construct<NEW_LINE>// a new ProcessingCapacityNotificationInfo.<NEW_LINE>Object[] attributeVals = cd.getAll(attributeNames);<NEW_LINE>int capacityVal = ((Integer) attributeVals[0]).intValue();<NEW_LINE>result = new ProcessingCapacityNotificationInfo(capacityVal);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | ManagementUtils.verifyFieldNumber(cd, 1); |
552,603 | /*<NEW_LINE>* delete posts with the passed tag that come before the one with the gap marker for<NEW_LINE>* this tag - note this may leave some stray posts in tbl_posts, but these will<NEW_LINE>* be cleaned up by the next purge<NEW_LINE>*/<NEW_LINE>public static void deletePostsBeforeGapMarkerForTag(ReaderTag tag) {<NEW_LINE>String gapMarkerDate = getGapMarkerDateForTag(tag);<NEW_LINE>if (TextUtils.isEmpty(gapMarkerDate)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String dateColumn = getSortColumnForTag(tag);<NEW_LINE>String[] args = { tag.getTagSlug(), Integer.toString(tag.tagType.toInt()), gapMarkerDate };<NEW_LINE><MASK><NEW_LINE>int numDeleted = ReaderDatabase.getWritableDb().delete("tbl_posts", where, args);<NEW_LINE>if (numDeleted > 0) {<NEW_LINE>AppLog.d(AppLog.T.READER, "removed " + numDeleted + " posts older than gap marker");<NEW_LINE>EventBus.getDefault().post(ReaderPostTableActionEnded.INSTANCE);<NEW_LINE>}<NEW_LINE>} | String where = "tag_name=? AND tag_type=? AND " + dateColumn + " < ?"; |
574,935 | private static void fetchLatestInfo() throws IOException {<NEW_LINE>URL updateURL = new URL(API);<NEW_LINE>String content = IOUtils.toString(updateURL.openStream(), StandardCharsets.UTF_8);<NEW_LINE>JsonObject updateJson = Json.<MASK><NEW_LINE>// compare versions<NEW_LINE>latestVersion = updateJson.getString("tag_name", "2.0.0");<NEW_LINE>latestPatchnotes = updateJson.getString("body", "#Error\nCould not fetch update notes.");<NEW_LINE>if (isOutdated()) {<NEW_LINE>Log.info(LangUtil.translate("update.outdated"));<NEW_LINE>JsonArray assets = updateJson.get("assets").asArray();<NEW_LINE>for (JsonValue assetValue : assets.values()) {<NEW_LINE>JsonObject assetObj = assetValue.asObject();<NEW_LINE>String file = assetObj.getString("name", "invalid");<NEW_LINE>// Skip non-jars<NEW_LINE>if (!file.endsWith(".jar")) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// Find the largest jar<NEW_LINE>int size = assetObj.getInt("size", 0);<NEW_LINE>if (size > latestArtifactSize) {<NEW_LINE>latestArtifactSize = size;<NEW_LINE>String fileURL = assetObj.getString("browser_download_url", null);<NEW_LINE>if (fileURL != null)<NEW_LINE>latestArtifact = fileURL;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>String date = updateJson.getString("published_at", null);<NEW_LINE>if (date != null)<NEW_LINE>latestVersionDate = Instant.parse(date);<NEW_LINE>} catch (DateTimeParseException ex) {<NEW_LINE>Log.warn("Failed to parse timestamp for latest release");<NEW_LINE>}<NEW_LINE>if (latestArtifact == null)<NEW_LINE>Log.warn(LangUtil.translate("update.fail.nodownload"));<NEW_LINE>}<NEW_LINE>} | parse(content).asObject(); |
871,041 | public static ListTableThemeResponse unmarshall(ListTableThemeResponse listTableThemeResponse, UnmarshallerContext _ctx) {<NEW_LINE>listTableThemeResponse.setRequestId(_ctx.stringValue("ListTableThemeResponse.RequestId"));<NEW_LINE>listTableThemeResponse.setErrorCode(_ctx.stringValue("ListTableThemeResponse.ErrorCode"));<NEW_LINE>listTableThemeResponse.setErrorMessage(_ctx.stringValue("ListTableThemeResponse.ErrorMessage"));<NEW_LINE>listTableThemeResponse.setHttpStatusCode<MASK><NEW_LINE>listTableThemeResponse.setSuccess(_ctx.booleanValue("ListTableThemeResponse.Success"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setTotalCount(_ctx.longValue("ListTableThemeResponse.Data.TotalCount"));<NEW_LINE>List<ThemeListItem> themeList = new ArrayList<ThemeListItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListTableThemeResponse.Data.ThemeList.Length"); i++) {<NEW_LINE>ThemeListItem themeListItem = new ThemeListItem();<NEW_LINE>themeListItem.setThemeId(_ctx.longValue("ListTableThemeResponse.Data.ThemeList[" + i + "].ThemeId"));<NEW_LINE>themeListItem.setName(_ctx.stringValue("ListTableThemeResponse.Data.ThemeList[" + i + "].Name"));<NEW_LINE>themeListItem.setLevel(_ctx.integerValue("ListTableThemeResponse.Data.ThemeList[" + i + "].Level"));<NEW_LINE>themeListItem.setParentId(_ctx.longValue("ListTableThemeResponse.Data.ThemeList[" + i + "].ParentId"));<NEW_LINE>themeListItem.setProjectId(_ctx.longValue("ListTableThemeResponse.Data.ThemeList[" + i + "].ProjectId"));<NEW_LINE>themeListItem.setCreator(_ctx.stringValue("ListTableThemeResponse.Data.ThemeList[" + i + "].Creator"));<NEW_LINE>themeListItem.setCreateTimeStamp(_ctx.longValue("ListTableThemeResponse.Data.ThemeList[" + i + "].CreateTimeStamp"));<NEW_LINE>themeList.add(themeListItem);<NEW_LINE>}<NEW_LINE>data.setThemeList(themeList);<NEW_LINE>listTableThemeResponse.setData(data);<NEW_LINE>return listTableThemeResponse;<NEW_LINE>} | (_ctx.integerValue("ListTableThemeResponse.HttpStatusCode")); |
1,848,414 | private static SetArgs createSetArgs7or6(Object[] argsArr) {<NEW_LINE>if (argsArr.length != 7 && argsArr.length != 6) {<NEW_LINE>MatrixLog.w(<MASK><NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>SetArgs setArgs = new SetArgs();<NEW_LINE>if (!(argsArr[0] instanceof Integer)) {<NEW_LINE>MatrixLog.w(TAG, "createSetArgs args idx 0 not Integer, %s", argsArr[0]);<NEW_LINE>return null;<NEW_LINE>} else {<NEW_LINE>setArgs.type = (Integer) argsArr[0];<NEW_LINE>}<NEW_LINE>if (!(argsArr[1] instanceof Long)) {<NEW_LINE>MatrixLog.w(TAG, "createSetArgs args idx 1 not Long, %s", argsArr[1]);<NEW_LINE>return null;<NEW_LINE>} else {<NEW_LINE>setArgs.triggerAtMillis = (Long) argsArr[1];<NEW_LINE>}<NEW_LINE>if (!(argsArr[2] instanceof Long)) {<NEW_LINE>MatrixLog.w(TAG, "createSetArgs args idx 2 not Long, %s", argsArr[2]);<NEW_LINE>return null;<NEW_LINE>} else {<NEW_LINE>setArgs.windowMillis = (Long) argsArr[2];<NEW_LINE>}<NEW_LINE>if (!(argsArr[3] instanceof Long)) {<NEW_LINE>MatrixLog.w(TAG, "createSetArgs args idx 3 not Long, %s", argsArr[3]);<NEW_LINE>return null;<NEW_LINE>} else {<NEW_LINE>setArgs.intervalMillis = (Long) argsArr[3];<NEW_LINE>}<NEW_LINE>if (argsArr[4] != null && !(argsArr[4] instanceof PendingIntent)) {<NEW_LINE>MatrixLog.w(TAG, "createSetArgs args idx 4 not PendingIntent, %s", argsArr[4]);<NEW_LINE>return null;<NEW_LINE>} else {<NEW_LINE>setArgs.operation = (PendingIntent) argsArr[4];<NEW_LINE>}<NEW_LINE>return setArgs;<NEW_LINE>} | TAG, "createSetArgs args length invalid : %d", argsArr.length); |
572,234 | public void parseBPMNShape(Element bpmnShapeElement) {<NEW_LINE>String bpmnElement = bpmnShapeElement.attribute("bpmnElement");<NEW_LINE>if (bpmnElement != null && !"".equals(bpmnElement)) {<NEW_LINE>// For collaborations, their are also shape definitions for the<NEW_LINE>// participants / processes<NEW_LINE>if (participantProcesses.get(bpmnElement) != null) {<NEW_LINE>ProcessDefinitionEntity procDef = getProcessDefinition(participantProcesses.get(bpmnElement));<NEW_LINE>procDef.setGraphicalNotationDefined(true);<NEW_LINE>// The participation that references this process, has a bounds to be<NEW_LINE>// rendered + a name as wel<NEW_LINE>parseDIBounds(bpmnShapeElement, procDef.getParticipantProcess());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (ProcessDefinitionEntity processDefinition : getProcessDefinitions()) {<NEW_LINE>ActivityImpl activity = processDefinition.findActivity(bpmnElement);<NEW_LINE>if (activity != null) {<NEW_LINE>parseDIBounds(bpmnShapeElement, activity);<NEW_LINE>// collapsed or expanded<NEW_LINE>String isExpanded = bpmnShapeElement.attribute("isExpanded");<NEW_LINE>if (isExpanded != null) {<NEW_LINE>activity.setProperty<MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>Lane lane = processDefinition.getLaneForId(bpmnElement);<NEW_LINE>if (lane != null) {<NEW_LINE>// The shape represents a lane<NEW_LINE>parseDIBounds(bpmnShapeElement, lane);<NEW_LINE>} else if (!elementIds.contains(bpmnElement)) {<NEW_LINE>// It might not be an<NEW_LINE>// activity nor a<NEW_LINE>// lane, but it might<NEW_LINE>// still reference<NEW_LINE>// 'something'<NEW_LINE>addError("Invalid reference in 'bpmnElement' attribute, activity " + bpmnElement + " not found", bpmnShapeElement);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>addError("'bpmnElement' attribute is required on BPMNShape", bpmnShapeElement);<NEW_LINE>}<NEW_LINE>} | (PROPERTYNAME_ISEXPANDED, parseBooleanAttribute(isExpanded)); |
1,034,131 | public void run() throws GlossaryAuthorFVTCheckedException, InvalidParameterException, PropertyServerException, UserNotAuthorizedException {<NEW_LINE><MASK><NEW_LINE>Glossary glossary = glossaryFVT.createGlossary(DEFAULT_TEST_GLOSSARY_NAME);<NEW_LINE>FVTUtils.validateNode(glossary);<NEW_LINE>System.out.println("Create a subjectArea1");<NEW_LINE>SubjectAreaDefinition subjectArea1 = createSubjectAreaDefinitionWithGlossaryGuid(DEFAULT_TEST_CATEGORY_NAME, glossary.getSystemAttributes().getGUID());<NEW_LINE>FVTUtils.validateNode(subjectArea1);<NEW_LINE>System.out.println("Create a subjectArea2");<NEW_LINE>SubjectAreaDefinition subjectArea2 = createSubjectAreaDefinitionWithGlossaryGuid(DEFAULT_TEST_CATEGORY_NAME2, glossary.getSystemAttributes().getGUID());<NEW_LINE>FVTUtils.validateNode(subjectArea2);<NEW_LINE>SubjectAreaDefinition subjectAreaForUpdate = new SubjectAreaDefinition();<NEW_LINE>subjectAreaForUpdate.setName(DEFAULT_TEST_CATEGORY_NAME_UPDATED);<NEW_LINE>if (subjectArea1 != null) {<NEW_LINE>System.out.println("Get the subjectArea1 ");<NEW_LINE>String guid = subjectArea1.getSystemAttributes().getGUID();<NEW_LINE>SubjectAreaDefinition gotSubjectAreaDefinition = getSubjectAreaDefinitionByGUID(guid);<NEW_LINE>System.out.println("Update the subjectArea1 ");<NEW_LINE>SubjectAreaDefinition updatedSubjectAreaDefinition = updateSubjectAreaDefinition(guid, subjectAreaForUpdate);<NEW_LINE>FVTUtils.validateNode(updatedSubjectAreaDefinition);<NEW_LINE>System.out.println("Get the subjectArea1 again");<NEW_LINE>gotSubjectAreaDefinition = getSubjectAreaDefinitionByGUID(guid);<NEW_LINE>FVTUtils.validateNode(gotSubjectAreaDefinition);<NEW_LINE>System.out.println("Delete the subjectArea1 ");<NEW_LINE>deleteSubjectAreaDefinition(guid);<NEW_LINE>// FVTUtils.validateNode( gotSubjectAreaDefinition);<NEW_LINE>System.out.println("restore the subjectArea1 ");<NEW_LINE>gotSubjectAreaDefinition = restoreSubjectAreaDefinition(guid);<NEW_LINE>FVTUtils.validateNode(gotSubjectAreaDefinition);<NEW_LINE>System.out.println("Delete the subjectArea1 ");<NEW_LINE>deleteSubjectAreaDefinition(guid);<NEW_LINE>// FVTUtils.validateNode( gotSubjectAreaDefinition);<NEW_LINE>System.out.println("Purge a subjectArea1 ");<NEW_LINE>// create subjectArea DEFAULT_TEST_CATEGORY_NAME3 with parent<NEW_LINE>System.out.println("Create a subjectArea with a parent subjectArea");<NEW_LINE>System.out.println("Create a category with a parent category");<NEW_LINE>SubjectAreaDefinition subjectAreaDefinition3 = createSubjectAreaDefinitionWithParentGlossaryGuid(DEFAULT_TEST_CATEGORY_NAME3, subjectArea2.getSystemAttributes().getGUID(), glossary.getSystemAttributes().getGUID());<NEW_LINE>FVTUtils.validateNode(subjectAreaDefinition3);<NEW_LINE>}<NEW_LINE>} | System.out.println("Create a glossary"); |
1,850,873 | public void marshall(ScheduleEntry scheduleEntry, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (scheduleEntry == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(scheduleEntry.getApproximateDurationSeconds(), APPROXIMATEDURATIONSECONDS_BINDING);<NEW_LINE>protocolMarshaller.marshall(scheduleEntry.getApproximateStartTime(), APPROXIMATESTARTTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(scheduleEntry.getChannelName(), CHANNELNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(scheduleEntry.getProgramName(), PROGRAMNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(scheduleEntry.getScheduleAdBreaks(), SCHEDULEADBREAKS_BINDING);<NEW_LINE>protocolMarshaller.marshall(scheduleEntry.getScheduleEntryType(), SCHEDULEENTRYTYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(scheduleEntry.getSourceLocationName(), SOURCELOCATIONNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(scheduleEntry.getVodSourceName(), VODSOURCENAME_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | scheduleEntry.getArn(), ARN_BINDING); |
232,273 | public final consulo.ui.Window suggestParentWindow(@Nullable final Project project) {<NEW_LINE>synchronized (myLock) {<NEW_LINE>Window window = getFocusedWindowForProject(project);<NEW_LINE>if (window == null) {<NEW_LINE>if (project != null) {<NEW_LINE>IdeFrame frameFor = WindowManagerEx.getInstanceEx().findFrameFor(project);<NEW_LINE>return frameFor == null ? null : frameFor.getWindow();<NEW_LINE>} else {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>LOG.<MASK><NEW_LINE>LOG.assertTrue(window.isShowing());<NEW_LINE>while (window != null) {<NEW_LINE>// skip all windows until found forst dialog or frame<NEW_LINE>if (!(window instanceof Dialog) && !(window instanceof Frame)) {<NEW_LINE>window = window.getOwner();<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// skip not visible and disposed/not shown windows<NEW_LINE>if (!window.isDisplayable() || !window.isShowing()) {<NEW_LINE>window = window.getOwner();<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// skip windows that have not associated WindowInfo<NEW_LINE>final WindowInfo info = myWindow2Info.get(TargetAWT.from(window));<NEW_LINE>if (info == null) {<NEW_LINE>window = window.getOwner();<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (info.mySuggestAsParent) {<NEW_LINE>return TargetAWT.from(window);<NEW_LINE>} else {<NEW_LINE>window = window.getOwner();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} | assertTrue(window.isDisplayable()); |
167,829 | public double learnSequence(Sequence<T> sequence, AtomicLong nextRandom, double learningRate, BatchSequences<T> batchSequences) {<NEW_LINE>Sequence<T> tempSequence = sequence;<NEW_LINE>if (sampling > 0)<NEW_LINE><MASK><NEW_LINE>int currentWindow = window;<NEW_LINE>if (variableWindows != null && variableWindows.length != 0) {<NEW_LINE>currentWindow = variableWindows[RandomUtils.nextInt(0, variableWindows.length)];<NEW_LINE>}<NEW_LINE>for (int i = 0; i < tempSequence.getElements().size(); i++) {<NEW_LINE>nextRandom.set(Math.abs(nextRandom.get() * 25214903917L + 11));<NEW_LINE>cbow(i, tempSequence.getElements(), (int) nextRandom.get() % currentWindow, nextRandom, learningRate, currentWindow, batchSequences);<NEW_LINE>}<NEW_LINE>return 0;<NEW_LINE>} | tempSequence = applySubsampling(sequence, nextRandom); |
1,284,605 | private void mergeWith(DoubleExponentialHistogramBuckets other, boolean additive) {<NEW_LINE>if (other.counts.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Find the common scale, and the extended window required to merge the two bucket sets<NEW_LINE>int commonScale = Math.min(this.scale, other.scale);<NEW_LINE>// Deltas are changes in scale<NEW_LINE>int deltaThis = this.scale - commonScale;<NEW_LINE>int deltaOther = other.scale - commonScale;<NEW_LINE>long newWindowStart;<NEW_LINE>long newWindowEnd;<NEW_LINE>if (this.counts.isEmpty()) {<NEW_LINE>newWindowStart = other.getOffset() >> deltaOther;<NEW_LINE>newWindowEnd = other.<MASK><NEW_LINE>} else {<NEW_LINE>newWindowStart = Math.min(this.getOffset() >> deltaThis, other.getOffset() >> deltaOther);<NEW_LINE>newWindowEnd = Math.max((this.counts.getIndexEnd() >> deltaThis), (other.counts.getIndexEnd() >> deltaOther));<NEW_LINE>}<NEW_LINE>// downscale to fit new window<NEW_LINE>deltaThis += getScaleReduction(newWindowStart, newWindowEnd);<NEW_LINE>this.downscale(deltaThis);<NEW_LINE>// since we changed scale of this, we need to know the new difference between the two scales<NEW_LINE>deltaOther = other.scale - this.scale;<NEW_LINE>// do actual merging of other into this. Will decrement or increment depending on sign.<NEW_LINE>int sign = additive ? 1 : -1;<NEW_LINE>for (int i = other.getOffset(); i <= other.counts.getIndexEnd(); i++) {<NEW_LINE>if (!this.counts.increment(i >> deltaOther, sign * other.counts.get(i))) {<NEW_LINE>// This should never occur if scales and windows are calculated without bugs<NEW_LINE>throw new IllegalStateException("Failed to merge exponential histogram buckets.");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>this.totalCount += sign * other.totalCount;<NEW_LINE>} | counts.getIndexEnd() >> deltaOther; |
1,654,172 | static Request putWatch(PutWatchRequest putWatchRequest) {<NEW_LINE>String endpoint = new RequestConverters.EndpointBuilder().addPathPartAsIs("_xpack", "watcher", "watch").addPathPart(putWatchRequest.getId()).build();<NEW_LINE>Request request = new Request(HttpPut.METHOD_NAME, endpoint);<NEW_LINE>RequestConverters.Params params = new RequestConverters.Params(request).withVersion(putWatchRequest.getVersion()).withIfSeqNo(putWatchRequest.ifSeqNo()).withIfPrimaryTerm(putWatchRequest.ifPrimaryTerm());<NEW_LINE>if (putWatchRequest.isActive() == false) {<NEW_LINE>params.putParam("active", "false");<NEW_LINE>}<NEW_LINE>ContentType contentType = RequestConverters.<MASK><NEW_LINE>BytesReference source = putWatchRequest.getSource();<NEW_LINE>request.setEntity(new NByteArrayEntity(source.toBytesRef().bytes, 0, source.length(), contentType));<NEW_LINE>return request;<NEW_LINE>} | createContentType(putWatchRequest.xContentType()); |
1,793,608 | public void refresh(TableCell cell) {<NEW_LINE>String sTags = null;<NEW_LINE>Download dm = (Download) cell.getDataSource();<NEW_LINE>if (dm != null) {<NEW_LINE>List<Tag> tags = tag_manager.getTagsForTaggable(interesting_tts, PluginCoreUtils.unwrap(dm));<NEW_LINE>if (tags.size() > 0) {<NEW_LINE>for (Tag t : tags) {<NEW_LINE>if (t.getGroupContainer() == tag_group) {<NEW_LINE>String file = t.getImageFile();<NEW_LINE>if (file != null) {<NEW_LINE>String <MASK><NEW_LINE>if (sTags == null) {<NEW_LINE>sTags = str;<NEW_LINE>} else {<NEW_LINE>sTags += ", " + str;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>cell.setSortValue(sTags);<NEW_LINE>cell.setToolTip((sTags == null) ? "" : sTags);<NEW_LINE>} | str = t.getTagName(true); |
1,469,075 | public static void main(String[] args) {<NEW_LINE>System.out.println("QuickSort and Compare:");<NEW_LINE>ICompare sortAndCompare = new SortAndCompare();<NEW_LINE>System.out.println(sortAndCompare.compare("ABCDEFGHLMNOPQRS", "DCGSRQPOM"));<NEW_LINE>System.out.println(sortAndCompare.compare("ASDF", "GHJK"));<NEW_LINE>System.out.println("Counting Sort and Compare:");<NEW_LINE>ICompare countAndCompare = new CountAndCompare();<NEW_LINE>System.out.println(countAndCompare.compare("ABCDEFGHLMNOPQRS", "DCGSRQPOM"));<NEW_LINE>System.out.println(countAndCompare.compare("ASDF", "GHJK"));<NEW_LINE>System.out.println("Using HashTable:");<NEW_LINE>ICompare hashTableCompare = new HashTableCompare();<NEW_LINE>System.out.println(hashTableCompare<MASK><NEW_LINE>System.out.println(hashTableCompare.compare("ASDF", "GHJK"));<NEW_LINE>System.out.println("Using Prime Product and Mode:");<NEW_LINE>ICompare primeCompare = new PrimeCompare();<NEW_LINE>System.out.println(primeCompare.compare("ABCDEFGHLMNOPQRS", "DCGSRQPOM"));<NEW_LINE>System.out.println(primeCompare.compare("ASDF", "GHJK"));<NEW_LINE>} | .compare("ABCDEFGHLMNOPQRS", "DCGSRQPOM")); |
1,216,271 | private void clientInvalidated(ClientDescriptor clientDescriptor, int invalidationId) {<NEW_LINE>InvalidationHolder invalidationHolder = clientsWaitingForInvalidation.get(invalidationId);<NEW_LINE>if (invalidationHolder == null) {<NEW_LINE>// Happens when client is re-sending/sending invalidations for which server has lost track since fail-over happened.<NEW_LINE>LOGGER.debug("Ignoring invalidation from client {} " + clientDescriptor);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if (invalidationHolder.clientsHavingToInvalidate.isEmpty()) {<NEW_LINE>if (clientsWaitingForInvalidation.remove(invalidationId) != null) {<NEW_LINE>try {<NEW_LINE>Long key = invalidationHolder.key;<NEW_LINE>if (key == null) {<NEW_LINE>if (isStrong()) {<NEW_LINE>clientCommunicator.sendNoResponse(invalidationHolder.clientDescriptorWaitingForInvalidation, allInvalidationDone());<NEW_LINE>LOGGER.debug("SERVER: notifying originating client that all other clients invalidated all in cache {} from {} (ID {})", storeIdentifier, clientDescriptor, invalidationId);<NEW_LINE>} else {<NEW_LINE>entityMessenger.messageSelf(new ClearInvalidationCompleteMessage());<NEW_LINE>InvalidationTracker invalidationTracker = stateService.getInvalidationTracker(storeIdentifier);<NEW_LINE>if (invalidationTracker != null) {<NEW_LINE>invalidationTracker.setClearInProgress(false);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (isStrong()) {<NEW_LINE>clientCommunicator.sendNoResponse(invalidationHolder.clientDescriptorWaitingForInvalidation, hashInvalidationDone(key));<NEW_LINE>LOGGER.debug("SERVER: notifying originating client that all other clients invalidated key {} in cache {} from {} (ID {})", key, storeIdentifier, clientDescriptor, invalidationId);<NEW_LINE>} else {<NEW_LINE>entityMessenger.messageSelf(new InvalidationCompleteMessage(key));<NEW_LINE>InvalidationTracker invalidationTracker = stateService.getInvalidationTracker(storeIdentifier);<NEW_LINE>if (invalidationTracker != null) {<NEW_LINE>invalidationTracker.untrackHashInvalidation(key);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (MessageCodecException mce) {<NEW_LINE>throw new AssertionError("Codec error", mce);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | invalidationHolder.clientsHavingToInvalidate.remove(clientDescriptor); |
679,786 | protected Entity loadEntityInstance(EntityLoadInfo info) {<NEW_LINE>if (info.isNewEntity()) {<NEW_LINE>return metadata.create(info.getMetaClass());<NEW_LINE>}<NEW_LINE>String pkName = referenceToEntitySupport.getPrimaryKeyForLoadingEntityFromLink(info.getMetaClass());<NEW_LINE>// noinspection unchecked<NEW_LINE>LoadContext<Entity> ctx = new LoadContext(info.getMetaClass());<NEW_LINE>ctx.setQueryString(format("select e from %s e where e.%s = :entityId", info.getMetaClass().getName(), pkName)).setParameter("entityId", info.getId());<NEW_LINE>if (info.getViewName() != null) {<NEW_LINE>View view = viewRepository.findView(info.getMetaClass(<MASK><NEW_LINE>if (view != null) {<NEW_LINE>ctx.setView(view);<NEW_LINE>} else {<NEW_LINE>log.warn("Unable to find view \"{}\" for entity \"{}\"", info.getViewName(), info.getMetaClass());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Entity entity;<NEW_LINE>try {<NEW_LINE>entity = dataService.load(ctx);<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.warn("Unable to load item: {}", info, e);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return entity;<NEW_LINE>} | ), info.getViewName()); |
261,665 | final DescribeDeviceResult executeDescribeDevice(DescribeDeviceRequest describeDeviceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeDeviceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeDeviceRequest> request = null;<NEW_LINE>Response<DescribeDeviceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeDeviceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeDeviceRequest));<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.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeDevice");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeDeviceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeDeviceResultJsonUnmarshaller());<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.SERVICE_ID, "WorkLink"); |
1,374,676 | private static Map<TypeAlias, jnr.ffi.NativeType> buildTypeMap() {<NEW_LINE>Map<TypeAlias, jnr.ffi.NativeType> m = new EnumMap<TypeAlias, jnr.ffi.NativeType>(TypeAlias.class);<NEW_LINE>m.put(TypeAlias.int8_t, NativeType.SCHAR);<NEW_LINE>m.put(TypeAlias.u_int8_t, NativeType.UCHAR);<NEW_LINE>m.put(TypeAlias.int16_t, NativeType.SSHORT);<NEW_LINE>m.put(TypeAlias.u_int16_t, NativeType.USHORT);<NEW_LINE>m.put(TypeAlias.int32_t, NativeType.SINT);<NEW_LINE>m.put(TypeAlias.u_int32_t, NativeType.UINT);<NEW_LINE>m.put(TypeAlias.int64_t, NativeType.SLONGLONG);<NEW_LINE>m.put(TypeAlias.u_int64_t, NativeType.ULONGLONG);<NEW_LINE>m.put(TypeAlias.intptr_t, NativeType.SINT);<NEW_LINE>m.put(TypeAlias.uintptr_t, NativeType.UINT);<NEW_LINE>m.put(TypeAlias.caddr_t, NativeType.ADDRESS);<NEW_LINE>m.put(TypeAlias.dev_t, NativeType.ULONG);<NEW_LINE>m.put(<MASK><NEW_LINE>m.put(TypeAlias.blksize_t, NativeType.SLONG);<NEW_LINE>m.put(TypeAlias.gid_t, NativeType.UINT);<NEW_LINE>m.put(TypeAlias.in_addr_t, NativeType.UINT);<NEW_LINE>m.put(TypeAlias.in_port_t, NativeType.USHORT);<NEW_LINE>m.put(TypeAlias.ino_t, NativeType.ULONGLONG);<NEW_LINE>m.put(TypeAlias.ino64_t, NativeType.ULONGLONG);<NEW_LINE>m.put(TypeAlias.key_t, NativeType.SINT);<NEW_LINE>m.put(TypeAlias.mode_t, NativeType.ULONG);<NEW_LINE>m.put(TypeAlias.nlink_t, NativeType.ULONG);<NEW_LINE>m.put(TypeAlias.id_t, NativeType.SLONG);<NEW_LINE>m.put(TypeAlias.pid_t, NativeType.SLONG);<NEW_LINE>m.put(TypeAlias.off_t, NativeType.SLONGLONG);<NEW_LINE>m.put(TypeAlias.swblk_t, NativeType.SLONG);<NEW_LINE>m.put(TypeAlias.uid_t, NativeType.UINT);<NEW_LINE>m.put(TypeAlias.clock_t, NativeType.SLONG);<NEW_LINE>m.put(TypeAlias.size_t, NativeType.UINT);<NEW_LINE>m.put(TypeAlias.ssize_t, NativeType.SINT);<NEW_LINE>m.put(TypeAlias.time_t, NativeType.SLONG);<NEW_LINE>m.put(TypeAlias.fsblkcnt_t, NativeType.ULONGLONG);<NEW_LINE>m.put(TypeAlias.fsfilcnt_t, NativeType.ULONGLONG);<NEW_LINE>m.put(TypeAlias.sa_family_t, NativeType.USHORT);<NEW_LINE>m.put(TypeAlias.socklen_t, NativeType.UINT);<NEW_LINE>m.put(TypeAlias.rlim_t, NativeType.ULONGLONG);<NEW_LINE>m.put(TypeAlias.cc_t, NativeType.UCHAR);<NEW_LINE>m.put(TypeAlias.speed_t, NativeType.UINT);<NEW_LINE>m.put(TypeAlias.tcflag_t, NativeType.UINT);<NEW_LINE>return m;<NEW_LINE>} | TypeAlias.blkcnt_t, NativeType.SLONGLONG); |
1,684,431 | protected void mutate(BackendAction item) {<NEW_LINE>BackendEntry e = item.entry();<NEW_LINE>assert e instanceof TextBackendEntry;<NEW_LINE>TextBackendEntry entry = (TextBackendEntry) e;<NEW_LINE>InMemoryDBTable table = this.<MASK><NEW_LINE>switch(item.action()) {<NEW_LINE>case INSERT:<NEW_LINE>LOG.debug("[store {}] add entry: {}", this.store, entry);<NEW_LINE>table.insert(null, entry);<NEW_LINE>break;<NEW_LINE>case DELETE:<NEW_LINE>LOG.debug("[store {}] remove id: {}", this.store, entry.id());<NEW_LINE>table.delete(null, entry);<NEW_LINE>break;<NEW_LINE>case APPEND:<NEW_LINE>LOG.debug("[store {}] append entry: {}", this.store, entry);<NEW_LINE>table.append(null, entry);<NEW_LINE>break;<NEW_LINE>case ELIMINATE:<NEW_LINE>LOG.debug("[store {}] eliminate entry: {}", this.store, entry);<NEW_LINE>table.eliminate(null, entry);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new BackendException("Unsupported mutate type: %s", item.action());<NEW_LINE>}<NEW_LINE>} | table(entry.type()); |
1,665,077 | static String formatGroupBy(List<GroupingElement> groupingElements) {<NEW_LINE>ImmutableList.Builder<String> resultStrings = ImmutableList.builder();<NEW_LINE>for (GroupingElement groupingElement : groupingElements) {<NEW_LINE>String result = "";<NEW_LINE>if (groupingElement instanceof SimpleGroupBy) {<NEW_LINE>List<Expression> columns = groupingElement.getExpressions();<NEW_LINE>if (columns.size() == 1) {<NEW_LINE>result = formatExpression(getOnlyElement(columns));<NEW_LINE>} else {<NEW_LINE>result = formatGroupingSet(columns);<NEW_LINE>}<NEW_LINE>} else if (groupingElement instanceof GroupingSets) {<NEW_LINE>result = format("GROUPING SETS (%s)", Joiner.on(", ").join(((GroupingSets) groupingElement).getSets().stream().map(ExpressionFormatter::<MASK><NEW_LINE>} else if (groupingElement instanceof Cube) {<NEW_LINE>result = format("CUBE %s", formatGroupingSet(groupingElement.getExpressions()));<NEW_LINE>} else if (groupingElement instanceof Rollup) {<NEW_LINE>result = format("ROLLUP %s", formatGroupingSet(groupingElement.getExpressions()));<NEW_LINE>}<NEW_LINE>resultStrings.add(result);<NEW_LINE>}<NEW_LINE>return Joiner.on(", ").join(resultStrings.build());<NEW_LINE>} | formatGroupingSet).iterator())); |
690,708 | public void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>((WordPress) getApplication()).component().inject(this);<NEW_LINE>mCommentsStoreAdapter.register(this);<NEW_LINE>AppLog.i(<MASK><NEW_LINE>setContentView(R.layout.comments_detail_activity);<NEW_LINE>Toolbar toolbar = findViewById(R.id.toolbar_main);<NEW_LINE>setSupportActionBar(toolbar);<NEW_LINE>ActionBar actionBar = getSupportActionBar();<NEW_LINE>if (actionBar != null) {<NEW_LINE>actionBar.setDisplayShowTitleEnabled(true);<NEW_LINE>actionBar.setDisplayHomeAsUpEnabled(true);<NEW_LINE>}<NEW_LINE>if (savedInstanceState == null) {<NEW_LINE>mCommentId = getIntent().getLongExtra(COMMENT_ID_EXTRA, -1);<NEW_LINE>mSite = (SiteModel) getIntent().getSerializableExtra(WordPress.SITE);<NEW_LINE>mStatusFilter = (CommentStatus) getIntent().getSerializableExtra(COMMENT_STATUS_FILTER_EXTRA);<NEW_LINE>} else {<NEW_LINE>mCommentId = savedInstanceState.getLong(COMMENT_ID_EXTRA);<NEW_LINE>mSite = (SiteModel) savedInstanceState.getSerializable(WordPress.SITE);<NEW_LINE>mStatusFilter = (CommentStatus) savedInstanceState.getSerializable(COMMENT_STATUS_FILTER_EXTRA);<NEW_LINE>}<NEW_LINE>// set up the viewpager and adapter for lateral navigation<NEW_LINE>mViewPager = findViewById(R.id.viewpager);<NEW_LINE>mViewPager.setPageTransformer(false, new WPViewPagerTransformer(WPViewPagerTransformer.TransformType.SLIDE_OVER));<NEW_LINE>mProgressBar = findViewById(R.id.progress_loading);<NEW_LINE>mAppBarLayout = findViewById(R.id.appbar_main);<NEW_LINE>// Asynchronously loads comments and build the adapter<NEW_LINE>loadDataInViewPager();<NEW_LINE>if (savedInstanceState == null) {<NEW_LINE>// track initial comment view<NEW_LINE>AnalyticsUtils.trackCommentActionWithSiteDetails(Stat.COMMENT_VIEWED, AnalyticsCommentActionSource.SITE_COMMENTS, mSite);<NEW_LINE>}<NEW_LINE>} | AppLog.T.COMMENTS, "Creating CommentsDetailActivity"); |
893,730 | public void marshall(LoRaWANDeviceProfile loRaWANDeviceProfile, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (loRaWANDeviceProfile == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(loRaWANDeviceProfile.getSupportsClassB(), SUPPORTSCLASSB_BINDING);<NEW_LINE>protocolMarshaller.marshall(loRaWANDeviceProfile.getClassBTimeout(), CLASSBTIMEOUT_BINDING);<NEW_LINE>protocolMarshaller.marshall(loRaWANDeviceProfile.getPingSlotPeriod(), PINGSLOTPERIOD_BINDING);<NEW_LINE>protocolMarshaller.marshall(loRaWANDeviceProfile.getPingSlotDr(), PINGSLOTDR_BINDING);<NEW_LINE>protocolMarshaller.marshall(loRaWANDeviceProfile.getPingSlotFreq(), PINGSLOTFREQ_BINDING);<NEW_LINE>protocolMarshaller.marshall(loRaWANDeviceProfile.getSupportsClassC(), SUPPORTSCLASSC_BINDING);<NEW_LINE>protocolMarshaller.marshall(loRaWANDeviceProfile.getClassCTimeout(), CLASSCTIMEOUT_BINDING);<NEW_LINE>protocolMarshaller.marshall(loRaWANDeviceProfile.getMacVersion(), MACVERSION_BINDING);<NEW_LINE>protocolMarshaller.marshall(loRaWANDeviceProfile.getRegParamsRevision(), REGPARAMSREVISION_BINDING);<NEW_LINE>protocolMarshaller.marshall(loRaWANDeviceProfile.getRxDelay1(), RXDELAY1_BINDING);<NEW_LINE>protocolMarshaller.marshall(loRaWANDeviceProfile.getRxDrOffset1(), RXDROFFSET1_BINDING);<NEW_LINE>protocolMarshaller.marshall(loRaWANDeviceProfile.getRxDataRate2(), RXDATARATE2_BINDING);<NEW_LINE>protocolMarshaller.marshall(loRaWANDeviceProfile.getRxFreq2(), RXFREQ2_BINDING);<NEW_LINE>protocolMarshaller.marshall(loRaWANDeviceProfile.getFactoryPresetFreqsList(), FACTORYPRESETFREQSLIST_BINDING);<NEW_LINE>protocolMarshaller.marshall(loRaWANDeviceProfile.getMaxEirp(), MAXEIRP_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(loRaWANDeviceProfile.getRfRegion(), RFREGION_BINDING);<NEW_LINE>protocolMarshaller.marshall(loRaWANDeviceProfile.getSupportsJoin(), SUPPORTSJOIN_BINDING);<NEW_LINE>protocolMarshaller.marshall(loRaWANDeviceProfile.getSupports32BitFCnt(), SUPPORTS32BITFCNT_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | loRaWANDeviceProfile.getMaxDutyCycle(), MAXDUTYCYCLE_BINDING); |
1,054,547 | private void rebuildMenu() {<NEW_LINE>List<TrayMenuItem> <MASK><NEW_LINE>menu.add(new ActionItem(resourceBundle.getString("traymenu.showMainWindow"), this::showMainWindow));<NEW_LINE>menu.add(new ActionItem(resourceBundle.getString("traymenu.showPreferencesWindow"), this::showPreferencesWindow));<NEW_LINE>menu.add(new SeparatorItem());<NEW_LINE>for (Vault vault : vaults) {<NEW_LINE>List<TrayMenuItem> submenu = buildSubmenu(vault);<NEW_LINE>var label = vault.isUnlocked() ? "* ".concat(vault.getDisplayName()) : vault.getDisplayName();<NEW_LINE>menu.add(new SubMenuItem(label, submenu));<NEW_LINE>}<NEW_LINE>menu.add(new SeparatorItem());<NEW_LINE>menu.add(new ActionItem(resourceBundle.getString("traymenu.lockAllVaults"), this::lockAllVaults, vaults.stream().anyMatch(Vault::isUnlocked)));<NEW_LINE>menu.add(new ActionItem(resourceBundle.getString("traymenu.quitApplication"), this::quitApplication));<NEW_LINE>try {<NEW_LINE>trayMenu.updateTrayMenu(menu);<NEW_LINE>} catch (TrayMenuException e) {<NEW_LINE>LOG.error("Updating tray menu failed", e);<NEW_LINE>}<NEW_LINE>} | menu = new ArrayList<>(); |
1,828,612 | final DescribeReleaseLabelResult executeDescribeReleaseLabel(DescribeReleaseLabelRequest describeReleaseLabelRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeReleaseLabelRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeReleaseLabelRequest> request = null;<NEW_LINE>Response<DescribeReleaseLabelResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeReleaseLabelRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeReleaseLabelRequest));<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.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeReleaseLabel");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeReleaseLabelResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeReleaseLabelResultJsonUnmarshaller());<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.SERVICE_ID, "EMR"); |
1,064,265 | private boolean saveInvoice() {<NEW_LINE>log.config("C_Invoice_ID=" + po.get_ID());<NEW_LINE>MInvoice invoice = (MInvoice) po;<NEW_LINE>int lineCount = 0;<NEW_LINE>// for all bom lines<NEW_LINE>for (int i = 0; i < selectionList.size(); i++) {<NEW_LINE>if (selectionList.get(i).isSelected) {<NEW_LINE>BigDecimal qty = selectionList.get(i).qty;<NEW_LINE>int M_Product_ID = selectionList.get(i).m_product_id;<NEW_LINE>int C_UOM_ID = selectionList.get(i).c_uom_id;<NEW_LINE>// Create Line<NEW_LINE>MInvoiceLine il = new MInvoiceLine(invoice);<NEW_LINE>// Set the product and UOM - pricing is based on the product<NEW_LINE>// UOM<NEW_LINE>il.setM_Product_ID(M_Product_ID, true);<NEW_LINE>// If the BOM Drop UOM is different, convert the quantity to<NEW_LINE>// the Product UOM<NEW_LINE>if (il.getC_UOM_ID() != C_UOM_ID) {<NEW_LINE>// Convert the quantity<NEW_LINE>qty = MUOMConversion.convertProductFrom(ctx, M_Product_ID, C_UOM_ID, qty);<NEW_LINE>}<NEW_LINE>il.setQty(qty);<NEW_LINE>il.setPrice();<NEW_LINE>il.setTax();<NEW_LINE>if (il.save())<NEW_LINE>lineCount++;<NEW_LINE>else<NEW_LINE>log.log(Level.SEVERE, "Line not saved");<NEW_LINE>}<NEW_LINE>// line selected<NEW_LINE>}<NEW_LINE>// for all bom lines<NEW_LINE>String result = "@C_Invoice_ID@ " + invoice.getDocumentNo() + ": " + lineCount;<NEW_LINE>result = <MASK><NEW_LINE>form.showDialog("Inserted", result);<NEW_LINE>log.config("#" + lineCount);<NEW_LINE>return true;<NEW_LINE>} | Msg.parseTranslation(ctx, result); |
101,268 | protected void reportDeclaration(MethodBinding methodBinding, MatchLocator locator, SimpleSet knownMethods) throws CoreException {<NEW_LINE>ReferenceBinding declaringClass = methodBinding.declaringClass;<NEW_LINE>IType type = locator.lookupType(declaringClass);<NEW_LINE>// case of a secondary type<NEW_LINE>if (type == null)<NEW_LINE>return;<NEW_LINE>// Report match for binary<NEW_LINE>if (type.isBinary()) {<NEW_LINE>IMethod method = null;<NEW_LINE>TypeBinding[] parameters = methodBinding.original().parameters;<NEW_LINE>int parameterLength = parameters.length;<NEW_LINE>char[][] parameterTypes = new char[parameterLength][];<NEW_LINE>for (int i = 0; i < parameterLength; i++) {<NEW_LINE>char[] typeName = parameters[i].qualifiedSourceName();<NEW_LINE>for (int j = 0, dim = parameters[i].dimensions(); j < dim; j++) {<NEW_LINE>typeName = CharOperation.concat(typeName, new char[] { '[', ']' });<NEW_LINE>}<NEW_LINE>parameterTypes[i] = typeName;<NEW_LINE>}<NEW_LINE>method = locator.createBinaryMethodHandle(type, methodBinding.selector, parameterTypes);<NEW_LINE>if (method == null || knownMethods.addIfNotIncluded(method) == null)<NEW_LINE>return;<NEW_LINE>IResource resource = type.getResource();<NEW_LINE>if (resource == null)<NEW_LINE>resource = type.getJavaProject().getProject();<NEW_LINE>IBinaryType info = locator.getBinaryInfo((org.eclipse.jdt.internal.core.ClassFile) type.getClassFile(), resource);<NEW_LINE>locator.reportBinaryMemberDeclaration(resource, method, methodBinding, info, SearchMatch.A_ACCURATE);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// When source is available, report match if method is found in the declaring type<NEW_LINE>IResource resource = type.getResource();<NEW_LINE>if (declaringClass instanceof ParameterizedTypeBinding)<NEW_LINE>declaringClass = ((ParameterizedTypeBinding) declaringClass).genericType();<NEW_LINE>ClassScope scope = ((SourceTypeBinding) declaringClass).scope;<NEW_LINE>if (scope != null) {<NEW_LINE>TypeDeclaration typeDecl = scope.referenceContext;<NEW_LINE>AbstractMethodDeclaration methodDecl = typeDecl.declarationOf(methodBinding.original());<NEW_LINE>if (methodDecl != null) {<NEW_LINE>// Create method handle from method declaration<NEW_LINE>String methodName = new String(methodBinding.selector);<NEW_LINE>Argument[] arguments = methodDecl.arguments;<NEW_LINE>int length = arguments == null ? 0 : arguments.length;<NEW_LINE>String[] parameterTypes = new String[length];<NEW_LINE>for (int i = 0; i < length; i++) {<NEW_LINE>char[][] typeName = arguments[i].type.getParameterizedTypeName();<NEW_LINE>parameterTypes[i] = Signature.createTypeSignature(CharOperation.concatWith(typeName, '.'), false);<NEW_LINE>}<NEW_LINE>IMethod method = <MASK><NEW_LINE>if (method == null || knownMethods.addIfNotIncluded(method) == null)<NEW_LINE>return;<NEW_LINE>// Create and report corresponding match<NEW_LINE>int offset = methodDecl.sourceStart;<NEW_LINE>this.match = new MethodDeclarationMatch(method, SearchMatch.A_ACCURATE, offset, methodDecl.sourceEnd - offset + 1, locator.getParticipant(), resource);<NEW_LINE>locator.report(this.match);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | type.getMethod(methodName, parameterTypes); |
1,542,159 | private ClassPool initClassPool(List<JarInput> jarInputs, List<DirectoryInput> directoryInputs) {<NEW_LINE>if (((VariantScopeImpl) this.appVariantContext.getScope()).getVariantData().getName().toLowerCase().contains("debug")) {<NEW_LINE>try {<NEW_LINE>FieldUtils.writeStaticField(ClassPool.class, "defaultPool", null, true);<NEW_LINE>} catch (IllegalAccessException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// logger.warn(">>> Do not open daemon <<<<");<NEW_LINE>}<NEW_LINE>final ClassPool pool = ClassPool.getDefault();<NEW_LINE>try {<NEW_LINE>File verifyFile = PathUtil.getJarFile(com.taobao.verify.Verifier.class);<NEW_LINE>pool.insertClassPath(verifyFile.getAbsolutePath());<NEW_LINE>for (File file : scope.getJavaClasspath(AndroidArtifacts.ConsumedConfigType.COMPILE_CLASSPATH, AndroidArtifacts.ArtifactType.CLASSES)) {<NEW_LINE>if (file.isFile()) {<NEW_LINE>pool.insertClassPath(file.getAbsolutePath());<NEW_LINE>} else {<NEW_LINE>pool.appendClassPath(file.getAbsolutePath());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String path = Joiner.on(File.pathSeparator).join(scope.getGlobalScope().getAndroidBuilder().getBootClasspathAsStrings(false));<NEW_LINE>pool.appendPathList(path);<NEW_LINE>for (JarInput jarInput : jarInputs) {<NEW_LINE>pool.insertClassPath(jarInput.getFile().getAbsolutePath());<NEW_LINE>}<NEW_LINE>for (DirectoryInput directoryInput : directoryInputs) {<NEW_LINE>pool.appendClassPath(directoryInput.getFile().getAbsolutePath());<NEW_LINE>}<NEW_LINE>} catch (NotFoundException e) {<NEW_LINE>throw new <MASK><NEW_LINE>}<NEW_LINE>return pool;<NEW_LINE>} | StopExecutionException(e.getMessage()); |
266,307 | public static PasswdRuleConfig parse(JSONObject config) {<NEW_LINE>Short <MASK><NEW_LINE>Short max = config.getShort("max");<NEW_LINE>Short letter = config.getShort("letter");<NEW_LINE>Short digit = config.getShort("digit");<NEW_LINE>Short upperCase = config.getShort("upperCase");<NEW_LINE>Short lowerCase = config.getShort("lowerCase");<NEW_LINE>Short specialChar = config.getShort("special");<NEW_LINE>final int minLength = (min != null) ? min.intValue() : 6;<NEW_LINE>final int maxLength = (max != null) ? max.intValue() : 20;<NEW_LINE>final int minLetter = (letter != null) ? letter.intValue() : 0;<NEW_LINE>final int minDigit = (digit != null) ? digit.intValue() : 0;<NEW_LINE>final int upperLetter = (upperCase != null) ? upperCase.intValue() : 0;<NEW_LINE>final int lowerLetter = (lowerCase != null) ? lowerCase.intValue() : 0;<NEW_LINE>if (minLength < 0) {<NEW_LINE>throw new IllegalArgumentException("Invalid password rule config: min = " + minLength);<NEW_LINE>}<NEW_LINE>if (maxLength < minLength) {<NEW_LINE>throw new IllegalArgumentException("Invalid password rule config: min = " + minLength + ", max = " + maxLength);<NEW_LINE>}<NEW_LINE>if (minLetter < 0) {<NEW_LINE>throw new IllegalArgumentException("Invalid password rule config: letter = " + minLetter);<NEW_LINE>}<NEW_LINE>if (minDigit < 0) {<NEW_LINE>throw new IllegalArgumentException("Invalid password rule config: digit = " + minDigit);<NEW_LINE>}<NEW_LINE>if (upperLetter < 0) {<NEW_LINE>throw new IllegalArgumentException("Invalid password rule config: upperCase = " + upperLetter);<NEW_LINE>}<NEW_LINE>if (lowerLetter < 0) {<NEW_LINE>throw new IllegalArgumentException("Invalid password rule config: lowerCase = " + lowerLetter);<NEW_LINE>}<NEW_LINE>return new PasswdRuleConfig(minLength, maxLength, upperLetter, lowerLetter, minLetter, minDigit, specialChar);<NEW_LINE>} | min = config.getShort("min"); |
628,483 | public void createGetterForField(AccessLevel level, JavacNode fieldNode, JavacNode source, boolean whineIfExists, boolean lazy, List<JCAnnotation> onMethod) {<NEW_LINE>if (fieldNode.getKind() != Kind.FIELD) {<NEW_LINE>source.addError(GETTER_NODE_NOT_SUPPORTED_ERR);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>JCVariableDecl fieldDecl = <MASK><NEW_LINE>if (lazy) {<NEW_LINE>if ((fieldDecl.mods.flags & Flags.PRIVATE) == 0 || (fieldDecl.mods.flags & Flags.FINAL) == 0) {<NEW_LINE>source.addError("'lazy' requires the field to be private and final.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if ((fieldDecl.mods.flags & Flags.TRANSIENT) != 0) {<NEW_LINE>source.addError("'lazy' is not supported on transient fields.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (fieldDecl.init == null) {<NEW_LINE>source.addError("'lazy' requires field initialization.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>AnnotationValues<Accessors> accessors = getAccessorsForField(fieldNode);<NEW_LINE>String methodName = toGetterName(fieldNode, accessors);<NEW_LINE>if (methodName == null) {<NEW_LINE>source.addWarning("Not generating getter for this field: It does not fit your @Accessors prefix list.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (String altName : toAllGetterNames(fieldNode, accessors)) {<NEW_LINE>switch(methodExists(altName, fieldNode, false, 0)) {<NEW_LINE>case EXISTS_BY_LOMBOK:<NEW_LINE>return;<NEW_LINE>case EXISTS_BY_USER:<NEW_LINE>if (whineIfExists) {<NEW_LINE>String altNameExpl = "";<NEW_LINE>if (!altName.equals(methodName))<NEW_LINE>altNameExpl = String.format(" (%s)", altName);<NEW_LINE>source.addWarning(String.format("Not generating %s(): A method with that name already exists%s", methodName, altNameExpl));<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>default:<NEW_LINE>case NOT_EXISTS:<NEW_LINE>}<NEW_LINE>}<NEW_LINE>long access = toJavacModifier(level) | (fieldDecl.mods.flags & Flags.STATIC);<NEW_LINE>injectMethod(fieldNode.up(), createGetter(access, fieldNode, fieldNode.getTreeMaker(), source, lazy, onMethod));<NEW_LINE>} | (JCVariableDecl) fieldNode.get(); |
1,492,495 | final UpdateCostCategoryDefinitionResult executeUpdateCostCategoryDefinition(UpdateCostCategoryDefinitionRequest updateCostCategoryDefinitionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateCostCategoryDefinitionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateCostCategoryDefinitionRequest> request = null;<NEW_LINE>Response<UpdateCostCategoryDefinitionResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateCostCategoryDefinitionRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateCostCategoryDefinitionRequest));<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, "Cost Explorer");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateCostCategoryDefinitionResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateCostCategoryDefinitionResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateCostCategoryDefinition"); |
830,305 | public void intercept(Invocation inv) {<NEW_LINE>Parameter[] parameters = inv.getMethod().getParameters();<NEW_LINE>for (int index = 0; index < parameters.length; index++) {<NEW_LINE>DecimalMin decimalMin = parameters[index].getAnnotation(DecimalMin.class);<NEW_LINE>if (decimalMin != null) {<NEW_LINE>Object <MASK><NEW_LINE>if (validObject != null && !matches(decimalMin, validObject)) {<NEW_LINE>String reason = parameters[index].getName() + " min value is " + decimalMin.value() + ", but current value is " + validObject + " at method: " + ClassUtil.buildMethodString(inv.getMethod());<NEW_LINE>Ret paras = Ret.by("value", decimalMin.value());<NEW_LINE>ValidUtil.throwValidException(parameters[index].getName(), decimalMin.message(), paras, reason);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>inv.invoke();<NEW_LINE>} | validObject = inv.getArg(index); |
1,448,760 | public List<ConfigItem> generateConfig(final NetworkElementCommand cmd) {<NEW_LINE>final LoadBalancerConfigCommand command = (LoadBalancerConfigCommand) cmd;<NEW_LINE><MASK><NEW_LINE>final String[] configuration = cfgtr.generateConfiguration(command);<NEW_LINE>String routerIp = command.getNic().getIp();<NEW_LINE>if (command.getVpcId() == null) {<NEW_LINE>routerIp = cmd.getAccessDetail(NetworkElementCommand.ROUTER_IP);<NEW_LINE>}<NEW_LINE>final String tmpCfgFilePath = "/etc/haproxy/";<NEW_LINE>final String tmpCfgFileName = "haproxy.cfg.new." + String.valueOf(System.currentTimeMillis());<NEW_LINE>final String[][] allRules = cfgtr.generateFwRules(command);<NEW_LINE>final String[] addRules = allRules[LoadBalancerConfigurator.ADD];<NEW_LINE>final String[] removeRules = allRules[LoadBalancerConfigurator.REMOVE];<NEW_LINE>final String[] statRules = allRules[LoadBalancerConfigurator.STATS];<NEW_LINE>final LoadBalancerRule loadBalancerRule = new LoadBalancerRule(configuration, tmpCfgFilePath, tmpCfgFileName, addRules, removeRules, statRules, routerIp);<NEW_LINE>final List<LoadBalancerRule> rules = new LinkedList<LoadBalancerRule>();<NEW_LINE>rules.add(loadBalancerRule);<NEW_LINE>final LoadBalancerRules configRules = new LoadBalancerRules(rules);<NEW_LINE>return generateConfigItems(configRules);<NEW_LINE>} | final LoadBalancerConfigurator cfgtr = new HAProxyConfigurator(); |
995,407 | public void run() {<NEW_LINE>peers_changed = false;<NEW_LINE>GlobalManager gm = CoreFactory.getSingleton().getGlobalManager();<NEW_LINE>swarm_peers = tv.getDataSources();<NEW_LINE>final Map<PEPeerManager, int[]> done_pms = new HashMap<>();<NEW_LINE>List<DownloadManager> dms = new ArrayList<>();<NEW_LINE>for (PEPeer peer : swarm_peers) {<NEW_LINE>PEPeerManager pm = peer.getManager();<NEW_LINE>int[] <MASK><NEW_LINE>if (count == null) {<NEW_LINE>done_pms.put(pm, new int[] { 1 });<NEW_LINE>byte[] hash = pm.getHash();<NEW_LINE>DownloadManager dm = gm.getDownloadManager(new HashWrapper(hash));<NEW_LINE>if (dm != null) {<NEW_LINE>dms.add(dm);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>count[0]++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Collections.sort(dms, new Comparator<DownloadManager>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public int compare(DownloadManager o1, DownloadManager o2) {<NEW_LINE>PEPeerManager pm1 = o1.getPeerManager();<NEW_LINE>PEPeerManager pm2 = o2.getPeerManager();<NEW_LINE>int[] c1 = done_pms.get(pm1);<NEW_LINE>int[] c2 = done_pms.get(pm2);<NEW_LINE>int n1 = c1 == null ? 0 : c1[0];<NEW_LINE>int n2 = c2 == null ? 0 : c2[0];<NEW_LINE>return (n2 - n1);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>swarm_view.dataSourceChanged(dms.toArray(new DownloadManager[dms.size()]));<NEW_LINE>} | count = done_pms.get(pm); |
1,573,742 | private void computeTstring(int fc, String text) {<NEW_LINE>// measure the LST<NEW_LINE>int i = text.length();<NEW_LINE>int len = 0;<NEW_LINE>for (int c = fc; c >= 0; ) {<NEW_LINE>int piece = this.confPiece[c];<NEW_LINE>len += this.confTstrings[piece];<NEW_LINE>if (i == 0)<NEW_LINE>break;<NEW_LINE>int bas = this.confLinks.base[c];<NEW_LINE>int start = bas + this.statesSeq[--i];<NEW_LINE>int ele = this.confLinks.mergetable[start];<NEW_LINE>// this means that config 0 means null<NEW_LINE>c = ele;<NEW_LINE>// record in it the config number<NEW_LINE>this.statesSeq[i] = ele;<NEW_LINE>len++;<NEW_LINE>}<NEW_LINE>// allocate it<NEW_LINE>if (this.treearr == null || this.treearr.length < len) {<NEW_LINE>if (this.treearr != null) {<NEW_LINE>}<NEW_LINE>this.treearr = new char[len];<NEW_LINE>}<NEW_LINE>this.treeLen = len;<NEW_LINE>// then fill it<NEW_LINE>i = 0;<NEW_LINE>len = text.length();<NEW_LINE>for (int j = 0; j < len; j++) {<NEW_LINE>int c = this.statesSeq[j];<NEW_LINE>int piece = this.confPiece[c];<NEW_LINE>int ln = this.confTstrings[piece];<NEW_LINE>System.arraycopy(this.confTstrings, piece + 1, <MASK><NEW_LINE>i += ln;<NEW_LINE>this.treearr[i++] = text.charAt(j);<NEW_LINE>}<NEW_LINE>int piece = this.confPiece[fc];<NEW_LINE>System.arraycopy(this.confTstrings, piece + 1, this.treearr, i, this.confTstrings[piece]);<NEW_LINE>} | this.treearr, i, ln); |
1,745,754 | public Request<CreateDBParameterGroupRequest> marshall(CreateDBParameterGroupRequest createDBParameterGroupRequest) {<NEW_LINE>if (createDBParameterGroupRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>Request<CreateDBParameterGroupRequest> request = new DefaultRequest<CreateDBParameterGroupRequest>(createDBParameterGroupRequest, "AmazonNeptune");<NEW_LINE>request.addParameter("Action", "CreateDBParameterGroup");<NEW_LINE>request.addParameter("Version", "2014-10-31");<NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>if (createDBParameterGroupRequest.getDBParameterGroupName() != null) {<NEW_LINE>request.addParameter("DBParameterGroupName", StringUtils.fromString(createDBParameterGroupRequest.getDBParameterGroupName()));<NEW_LINE>}<NEW_LINE>if (createDBParameterGroupRequest.getDBParameterGroupFamily() != null) {<NEW_LINE>request.addParameter("DBParameterGroupFamily", StringUtils.fromString(createDBParameterGroupRequest.getDBParameterGroupFamily()));<NEW_LINE>}<NEW_LINE>if (createDBParameterGroupRequest.getDescription() != null) {<NEW_LINE>request.addParameter("Description", StringUtils.fromString(createDBParameterGroupRequest.getDescription()));<NEW_LINE>}<NEW_LINE>if (createDBParameterGroupRequest.getTags() != null) {<NEW_LINE>java.util.List<Tag> tagsList = createDBParameterGroupRequest.getTags();<NEW_LINE>if (tagsList.isEmpty()) {<NEW_LINE>request.addParameter("Tags", "");<NEW_LINE>} else {<NEW_LINE>int tagsListIndex = 1;<NEW_LINE>for (Tag tagsListValue : tagsList) {<NEW_LINE>if (tagsListValue != null) {<NEW_LINE>if (tagsListValue.getKey() != null) {<NEW_LINE>request.addParameter("Tags.Tag." + tagsListIndex + ".Key", StringUtils.fromString(tagsListValue.getKey()));<NEW_LINE>}<NEW_LINE>if (tagsListValue.getValue() != null) {<NEW_LINE>request.addParameter("Tags.Tag." + tagsListIndex + ".Value", StringUtils.fromString<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>tagsListIndex++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>} | (tagsListValue.getValue())); |
246,901 | public void exitMethodDeclaration(ProcessingParser.MethodDeclarationContext ctx) {<NEW_LINE>ParserRuleContext memCtx = ctx.getParent();<NEW_LINE>ParserRuleContext clsBdyDclCtx = memCtx.getParent();<NEW_LINE>ParserRuleContext clsBdyCtx = clsBdyDclCtx.getParent();<NEW_LINE>ParserRuleContext clsDclCtx = clsBdyCtx.getParent();<NEW_LINE>boolean inSketchContext = clsBdyCtx instanceof ProcessingParser.StaticProcessingSketchContext || clsBdyCtx instanceof ProcessingParser.ActiveProcessingSketchContext;<NEW_LINE>boolean inPAppletContext = inSketchContext || (clsDclCtx instanceof ProcessingParser.ClassDeclarationContext && clsDclCtx.getChildCount() >= 4 && clsDclCtx.getChild(2).getText().equals("extends") && clsDclCtx.getChild(3).getText<MASK><NEW_LINE>// Find modifiers<NEW_LINE>ParserRuleContext possibleModifiers = ctx;<NEW_LINE>while (!(possibleModifiers instanceof ProcessingParser.ClassBodyDeclarationContext)) {<NEW_LINE>possibleModifiers = possibleModifiers.getParent();<NEW_LINE>}<NEW_LINE>// Look for visibility modifiers and annotations<NEW_LINE>boolean hasVisibilityModifier = false;<NEW_LINE>int numChildren = possibleModifiers.getChildCount();<NEW_LINE>ParserRuleContext annoationPoint = null;<NEW_LINE>for (int i = 0; i < numChildren; i++) {<NEW_LINE>boolean childIsVisibility;<NEW_LINE>ParseTree child = possibleModifiers.getChild(i);<NEW_LINE>String childText = child.getText();<NEW_LINE>childIsVisibility = childText.equals("public");<NEW_LINE>childIsVisibility = childIsVisibility || childText.equals("private");<NEW_LINE>childIsVisibility = childIsVisibility || childText.equals("protected");<NEW_LINE>hasVisibilityModifier = hasVisibilityModifier || childIsVisibility;<NEW_LINE>boolean isModifier = child instanceof ProcessingParser.ModifierContext;<NEW_LINE>if (isModifier && isAnnotation((ProcessingParser.ModifierContext) child)) {<NEW_LINE>annoationPoint = (ParserRuleContext) child;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Insert at start of method or after annoation<NEW_LINE>if (!hasVisibilityModifier) {<NEW_LINE>if (annoationPoint == null) {<NEW_LINE>insertBefore(possibleModifiers.getStart(), " public ");<NEW_LINE>} else {<NEW_LINE>insertAfter(annoationPoint.getStop(), " public ");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Check if this was main<NEW_LINE>if ((inSketchContext || inPAppletContext) && hasVisibilityModifier && ctx.getChild(1).getText().equals("main")) {<NEW_LINE>foundMain = true;<NEW_LINE>}<NEW_LINE>} | ().endsWith("PApplet")); |
994,492 | protected void applyPhysicsTransform(Vector3f worldLocation, Quaternion worldRotation) {<NEW_LINE>if (enabled && spatial != null) {<NEW_LINE>Vector3f localLocation = spatial.getLocalTranslation();<NEW_LINE><MASK><NEW_LINE>if (!applyLocal && spatial.getParent() != null) {<NEW_LINE>localLocation.set(worldLocation).subtractLocal(spatial.getParent().getWorldTranslation());<NEW_LINE>localLocation.divideLocal(spatial.getParent().getWorldScale());<NEW_LINE>tmp_inverseWorldRotation.set(spatial.getParent().getWorldRotation()).inverseLocal().multLocal(localLocation);<NEW_LINE>localRotationQuat.set(worldRotation);<NEW_LINE>tmp_inverseWorldRotation.set(spatial.getParent().getWorldRotation()).inverseLocal().mult(localRotationQuat, localRotationQuat);<NEW_LINE>spatial.setLocalTranslation(localLocation);<NEW_LINE>spatial.setLocalRotation(localRotationQuat);<NEW_LINE>} else {<NEW_LINE>spatial.setLocalTranslation(worldLocation);<NEW_LINE>spatial.setLocalRotation(worldRotation);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | Quaternion localRotationQuat = spatial.getLocalRotation(); |
298,080 | public void execute(final JvmTestExecutionSpec testExecutionSpec, TestResultProcessor testResultProcessor) {<NEW_LINE>final TestFramework testFramework = testExecutionSpec.getTestFramework();<NEW_LINE>final WorkerTestClassProcessorFactory testInstanceFactory = testFramework.getProcessorFactory();<NEW_LINE>final Set<File> classpath = ImmutableSet.copyOf(testExecutionSpec.getClasspath());<NEW_LINE>final Set<File> modulePath = ImmutableSet.copyOf(testExecutionSpec.getModulePath());<NEW_LINE>final List<String<MASK><NEW_LINE>final Factory<TestClassProcessor> forkingProcessorFactory = new Factory<TestClassProcessor>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public TestClassProcessor create() {<NEW_LINE>return new ForkingTestClassProcessor(workerLeaseService, workerFactory, testInstanceFactory, testExecutionSpec.getJavaForkOptions(), classpath, modulePath, testWorkerImplementationModules, testFramework.getWorkerConfigurationAction(), moduleRegistry, documentationRegistry);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>final Factory<TestClassProcessor> reforkingProcessorFactory = new Factory<TestClassProcessor>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public TestClassProcessor create() {<NEW_LINE>return new RestartEveryNTestClassProcessor(forkingProcessorFactory, testExecutionSpec.getForkEvery());<NEW_LINE>}<NEW_LINE>};<NEW_LINE>processor = new PatternMatchTestClassProcessor(testFilter, new RunPreviousFailedFirstTestClassProcessor(testExecutionSpec.getPreviousFailedTestClasses(), new MaxNParallelTestClassProcessor(getMaxParallelForks(testExecutionSpec), reforkingProcessorFactory, actorFactory)));<NEW_LINE>final FileTree testClassFiles = testExecutionSpec.getCandidateClassFiles();<NEW_LINE>Runnable detector;<NEW_LINE>if (testExecutionSpec.isScanForTestClasses() && testFramework.getDetector() != null) {<NEW_LINE>TestFrameworkDetector testFrameworkDetector = testFramework.getDetector();<NEW_LINE>testFrameworkDetector.setTestClasses(testExecutionSpec.getTestClassesDirs().getFiles());<NEW_LINE>testFrameworkDetector.setTestClasspath(classpath);<NEW_LINE>detector = new DefaultTestClassScanner(testClassFiles, testFrameworkDetector, processor);<NEW_LINE>} else {<NEW_LINE>detector = new DefaultTestClassScanner(testClassFiles, null, processor);<NEW_LINE>}<NEW_LINE>new TestMainAction(detector, processor, testResultProcessor, workerLeaseService, clock, testExecutionSpec.getPath(), "Gradle Test Run " + testExecutionSpec.getIdentityPath()).run();<NEW_LINE>} | > testWorkerImplementationModules = testFramework.getTestWorkerImplementationModules(); |
443,393 | private void downloadAndReadItemFiles(@NonNull Map<RemoteFile, SettingsItemReader<? extends SettingsItem>> remoteFilesForRead, @NonNull Map<File, RemoteFile> remoteFilesForDownload) throws IOException {<NEW_LINE>OsmandApplication app = backupHelper.getApp();<NEW_LINE>List<FileDownloadTask> fileDownloadTasks = new ArrayList<>();<NEW_LINE>for (Entry<File, RemoteFile> fileEntry : remoteFilesForDownload.entrySet()) {<NEW_LINE>fileDownloadTasks.add(new FileDownloadTask(fileEntry.getKey(), fileEntry.getValue()));<NEW_LINE>}<NEW_LINE>ThreadPoolTaskExecutor<FileDownloadTask> filesDownloadExecutor = createExecutor();<NEW_LINE>filesDownloadExecutor.run(fileDownloadTasks);<NEW_LINE>boolean hasDownloadErrors = hasDownloadErrors(fileDownloadTasks);<NEW_LINE>if (!hasDownloadErrors) {<NEW_LINE>List<ItemFileDownloadTask> itemFileDownloadTasks = new ArrayList<>();<NEW_LINE>for (Entry<File, RemoteFile> entry : remoteFilesForDownload.entrySet()) {<NEW_LINE>File tempFile = entry.getKey();<NEW_LINE>RemoteFile remoteFile = entry.getValue();<NEW_LINE>if (tempFile.exists()) {<NEW_LINE>SettingsItemReader<? extends SettingsItem> <MASK><NEW_LINE>if (reader != null) {<NEW_LINE>itemFileDownloadTasks.add(new ItemFileDownloadTask(app, tempFile, reader));<NEW_LINE>} else {<NEW_LINE>throw new IOException("No reader for: " + tempFile.getName());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new IOException("No temp item file: " + tempFile.getName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ThreadPoolTaskExecutor<ItemFileDownloadTask> itemFilesDownloadExecutor = createExecutor();<NEW_LINE>itemFilesDownloadExecutor.run(itemFileDownloadTasks);<NEW_LINE>} else {<NEW_LINE>throw new IOException("Error downloading temp item files");<NEW_LINE>}<NEW_LINE>} | reader = remoteFilesForRead.get(remoteFile); |
1,148,192 | public void editorContextMenuAboutToShow(IMenuManager menu) {<NEW_LINE>menu.add(new GroupMarker(GROUP_SQL_ADDITIONS));<NEW_LINE>super.editorContextMenuAboutToShow(menu);<NEW_LINE>// menu.add(new Separator("content"));//$NON-NLS-1$<NEW_LINE>addAction(menu, GROUP_SQL_EXTRAS, SQLEditorContributor.ACTION_CONTENT_ASSIST_PROPOSAL);<NEW_LINE>addAction(<MASK><NEW_LINE>addAction(menu, GROUP_SQL_EXTRAS, SQLEditorContributor.ACTION_CONTENT_ASSIST_INFORMATION);<NEW_LINE>menu.insertBefore(ITextEditorActionConstants.GROUP_COPY, ActionUtils.makeCommandContribution(getSite(), SQLEditorCommands.CMD_NAVIGATE_OBJECT));<NEW_LINE>TextViewer textViewer = getTextViewer();<NEW_LINE>if (!isReadOnly() && textViewer != null && textViewer.isEditable()) {<NEW_LINE>MenuManager formatMenu = new MenuManager(SQLEditorMessages.sql_editor_menu_format, "format");<NEW_LINE>IAction formatAction = getAction(SQLEditorContributor.ACTION_CONTENT_FORMAT_PROPOSAL);<NEW_LINE>if (formatAction != null) {<NEW_LINE>formatMenu.add(formatAction);<NEW_LINE>}<NEW_LINE>formatMenu.add(ActionUtils.makeCommandContribution(getSite(), "org.jkiss.dbeaver.ui.editors.sql.morph.delimited.list"));<NEW_LINE>formatMenu.add(getAction(ITextEditorActionConstants.UPPER_CASE));<NEW_LINE>formatMenu.add(getAction(ITextEditorActionConstants.LOWER_CASE));<NEW_LINE>formatMenu.add(ActionUtils.makeCommandContribution(getSite(), "org.jkiss.dbeaver.ui.editors.sql.trim.spaces"));<NEW_LINE>formatMenu.add(new Separator());<NEW_LINE>formatMenu.add(ActionUtils.makeCommandContribution(getSite(), "org.jkiss.dbeaver.ui.editors.sql.word.wrap"));<NEW_LINE>formatMenu.add(ActionUtils.makeCommandContribution(getSite(), "org.jkiss.dbeaver.ui.editors.sql.comment.single"));<NEW_LINE>formatMenu.add(ActionUtils.makeCommandContribution(getSite(), "org.jkiss.dbeaver.ui.editors.sql.comment.multi"));<NEW_LINE>menu.insertAfter(GROUP_SQL_ADDITIONS, formatMenu);<NEW_LINE>}<NEW_LINE>// menu.remove(IWorkbenchActionConstants.MB_ADDITIONS);<NEW_LINE>} | menu, GROUP_SQL_EXTRAS, SQLEditorContributor.ACTION_CONTENT_ASSIST_TIP); |
1,720,349 | public void marshall(UpdateRecipeJobRequest updateRecipeJobRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (updateRecipeJobRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(updateRecipeJobRequest.getEncryptionKeyArn(), ENCRYPTIONKEYARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(updateRecipeJobRequest.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateRecipeJobRequest.getLogSubscription(), LOGSUBSCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateRecipeJobRequest.getMaxCapacity(), MAXCAPACITY_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateRecipeJobRequest.getMaxRetries(), MAXRETRIES_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateRecipeJobRequest.getOutputs(), OUTPUTS_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateRecipeJobRequest.getDataCatalogOutputs(), DATACATALOGOUTPUTS_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateRecipeJobRequest.getDatabaseOutputs(), DATABASEOUTPUTS_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateRecipeJobRequest.getRoleArn(), ROLEARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateRecipeJobRequest.getTimeout(), TIMEOUT_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | updateRecipeJobRequest.getEncryptionMode(), ENCRYPTIONMODE_BINDING); |
1,423,403 | void startWithPopTo(final FragmentManager fm, final ISupportFragment from, final ISupportFragment to, final String fragmentTag, final boolean includeTargetFragment) {<NEW_LINE>enqueue(fm, new Action(Action.ACTION_POP_MOCK) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>int flag = 0;<NEW_LINE>if (includeTargetFragment) {<NEW_LINE>flag = FragmentManager.POP_BACK_STACK_INCLUSIVE;<NEW_LINE>}<NEW_LINE>List<Fragment> willPopFragments = SupportHelper.<MASK><NEW_LINE>final ISupportFragment top = getTopFragmentForStart(from, fm);<NEW_LINE>if (top == null)<NEW_LINE>throw new NullPointerException("There is no Fragment in the FragmentManager, maybe you need to call loadRootFragment() first!");<NEW_LINE>int containerId = top.getSupportDelegate().mContainerId;<NEW_LINE>bindContainerId(containerId, to);<NEW_LINE>if (willPopFragments.size() <= 0)<NEW_LINE>return;<NEW_LINE>handleAfterSaveInStateTransactionException(fm, "startWithPopTo()");<NEW_LINE>FragmentationMagician.executePendingTransactionsAllowingStateLoss(fm);<NEW_LINE>if (!FragmentationMagician.isStateSaved(fm)) {<NEW_LINE>mockStartWithPopAnim(SupportHelper.getTopFragment(fm), to, top.getSupportDelegate().mAnimHelper.popExitAnim);<NEW_LINE>}<NEW_LINE>safePopTo(fragmentTag, fm, flag, willPopFragments);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>dispatchStartTransaction(fm, from, to, 0, ISupportFragment.STANDARD, TransactionDelegate.TYPE_ADD);<NEW_LINE>} | getWillPopFragments(fm, fragmentTag, includeTargetFragment); |
408,245 | private void initDefaultRoutes(Router router) {<NEW_LINE>router.add(GET, "/", RootTask.class);<NEW_LINE>router.add(GET, "", RootRedirectTask.class);<NEW_LINE>router.add(POST, "/reset", ResetTask.class);<NEW_LINE>router.add(GET, "/mappings", GetAllStubMappingsTask.class);<NEW_LINE>router.add(POST, "/mappings", CreateStubMappingTask.class);<NEW_LINE>router.add(DELETE, "/mappings", ResetStubMappingsTask.class);<NEW_LINE>// Deprecated<NEW_LINE>router.add(POST, "/mappings/new", OldCreateStubMappingTask.class);<NEW_LINE>// Deprecated<NEW_LINE>router.add(POST, "/mappings/remove", OldRemoveStubMappingTask.class);<NEW_LINE>// Deprecated<NEW_LINE>router.add(POST, "/mappings/edit", OldEditStubMappingTask.class);<NEW_LINE>router.add(POST, "/mappings/save", SaveMappingsTask.class);<NEW_LINE>router.add(POST, "/mappings/reset", ResetToDefaultMappingsTask.class);<NEW_LINE>router.add(GET, "/mappings/{id}", GetStubMappingTask.class);<NEW_LINE>router.add(PUT, "/mappings/{id}", EditStubMappingTask.class);<NEW_LINE>router.add(DELETE, "/mappings/{id}", RemoveStubMappingTask.class);<NEW_LINE>router.add(POST, "/mappings/find-by-metadata", FindStubMappingsByMetadataTask.class);<NEW_LINE>router.add(POST, "/mappings/remove-by-metadata", RemoveStubMappingsByMetadataTask.class);<NEW_LINE>router.add(POST, "/mappings/import", ImportStubMappingsTask.class);<NEW_LINE>router.add(GET, "/files", GetAllStubFilesTask.class);<NEW_LINE>router.add(PUT, "/files/**", EditStubFileTask.class);<NEW_LINE>router.add(DELETE, "/files/**", DeleteStubFileTask.class);<NEW_LINE>router.add(GET, "/scenarios", GetAllScenariosTask.class);<NEW_LINE>router.add(POST, "/scenarios/reset", ResetScenariosTask.class);<NEW_LINE>router.add(PUT, "/scenarios/{name}/state", SetScenarioStateTask.class);<NEW_LINE>router.add(GET, "/requests", GetAllRequestsTask.class);<NEW_LINE>router.add(DELETE, "/requests", ResetRequestsTask.class);<NEW_LINE>// Deprecated<NEW_LINE>router.add(POST, "/requests/reset", OldResetRequestsTask.class);<NEW_LINE>router.add(POST, "/requests/count", GetRequestCountTask.class);<NEW_LINE>router.add(POST, "/requests/find", FindRequestsTask.class);<NEW_LINE>router.add(GET, "/requests/unmatched", FindUnmatchedRequestsTask.class);<NEW_LINE>router.add(GET, "/requests/unmatched/near-misses", FindNearMissesForUnmatchedTask.class);<NEW_LINE>router.add(GET, "/requests/{id}", GetServedStubTask.class);<NEW_LINE>router.add(DELETE, "/requests/{id}", RemoveServeEventTask.class);<NEW_LINE>router.add(POST, "/requests/remove", RemoveServeEventsByRequestPatternTask.class);<NEW_LINE>router.add(POST, "/requests/remove-by-metadata", RemoveServeEventsByStubMetadataTask.class);<NEW_LINE>router.add(POST, "/recordings/snapshot", SnapshotTask.class);<NEW_LINE>router.add(POST, "/recordings/start", StartRecordingTask.class);<NEW_LINE>router.add(POST, "/recordings/stop", StopRecordingTask.class);<NEW_LINE>router.add(GET, "/recordings/status", GetRecordingStatusTask.class);<NEW_LINE>router.add(GET, "/recorder", GetRecordingsIndexTask.class);<NEW_LINE>router.add(POST, "/near-misses/request", FindNearMissesForRequestTask.class);<NEW_LINE>router.add(<MASK><NEW_LINE>router.add(GET, "/settings", GetGlobalSettingsTask.class);<NEW_LINE>router.add(PUT, "/settings", GlobalSettingsUpdateTask.class);<NEW_LINE>router.add(POST, "/settings", GlobalSettingsUpdateTask.class);<NEW_LINE>router.add(PATCH, "/settings/extended", PatchExtendedSettingsTask.class);<NEW_LINE>router.add(POST, "/shutdown", ShutdownServerTask.class);<NEW_LINE>router.add(GET, "/docs/swagger", GetSwaggerSpecTask.class);<NEW_LINE>router.add(GET, "/docs", GetDocIndexTask.class);<NEW_LINE>router.add(GET, "/certs/wiremock-ca.crt", GetCaCertTask.class);<NEW_LINE>} | POST, "/near-misses/request-pattern", FindNearMissesForRequestPatternTask.class); |
1,396,912 | public void addPage(final RequestContext context) {<NEW_LINE>final JsonRenderer renderer = new JsonRenderer();<NEW_LINE>context.setRenderer(renderer);<NEW_LINE>final JSONObject ret = new JSONObject();<NEW_LINE>try {<NEW_LINE>final JSONObject requestJSON = context.requestJSON();<NEW_LINE>final String pageId = pageMgmtService.addPage(requestJSON);<NEW_LINE>ret.put(Keys.OBJECT_ID, pageId);<NEW_LINE>ret.put(Keys.MSG<MASK><NEW_LINE>ret.put(Keys.CODE, StatusCodes.SUCC);<NEW_LINE>renderer.setJSONObject(ret);<NEW_LINE>} catch (final ServiceException e) {<NEW_LINE>// May be permalink check exception<NEW_LINE>LOGGER.log(Level.WARN, e.getMessage(), e);<NEW_LINE>final JSONObject jsonObject = new JSONObject().put(Keys.CODE, StatusCodes.ERR);<NEW_LINE>renderer.setJSONObject(jsonObject);<NEW_LINE>jsonObject.put(Keys.MSG, e.getMessage());<NEW_LINE>}<NEW_LINE>} | , langPropsService.get("addSuccLabel")); |
728,782 | private View applyGroupFilters(final View view) {<NEW_LINE>View derivedView = View.fromJson(view.toCompactJson());<NEW_LINE>final Set<String> groups = checkForGroups();<NEW_LINE>if (null == groups) {<NEW_LINE>// None of the filters specify a group or groups.<NEW_LINE>return derivedView;<NEW_LINE>} else if (groups.isEmpty()) {<NEW_LINE>// Return null to indicate that groups are specified but no data can be returned<NEW_LINE>return null;<NEW_LINE>} else {<NEW_LINE>View.Builder <MASK><NEW_LINE>boolean updated = false;<NEW_LINE>for (final String group : groups) {<NEW_LINE>// group might be an entity group, an edge group or neither (if the user specifies a filter with<NEW_LINE>// "group=X" and X is not a group in the schema) - if neither then it can be ignored.<NEW_LINE>if (view.isEntity(group)) {<NEW_LINE>updated = true;<NEW_LINE>LOGGER.info("Updating derived view with entity group {} and ViewElementDefinition {}", group, view.getEntity(group));<NEW_LINE>derivedViewBuilder = derivedViewBuilder.entity(group, view.getEntity(group));<NEW_LINE>} else if (view.isEdge(group)) {<NEW_LINE>updated = true;<NEW_LINE>LOGGER.info("Updating derived view with edge group {} and ViewElementDefinition {}", group, view.getEdge(group));<NEW_LINE>derivedViewBuilder = derivedViewBuilder.edge(group, view.getEdge(group));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!updated) {<NEW_LINE>// None of the groups were found in the view, so no data should be returned.<NEW_LINE>return null;<NEW_LINE>} else {<NEW_LINE>derivedView = derivedViewBuilder.build();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return derivedView;<NEW_LINE>} | derivedViewBuilder = new View.Builder(); |
944,195 | public void encodeEnd(FacesContext context, UIComponent component) throws IOException {<NEW_LINE><MASK><NEW_LINE>ResponseWriter writer = context.getResponseWriter();<NEW_LINE>Map<String, Object> attributes = component.getAttributes();<NEW_LINE>// <!DOCTYPE html PUBLIC<NEW_LINE>// "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><NEW_LINE>writer.write("<!DOCTYPE ");<NEW_LINE>writer.write((String) attributes.get("rootElement"));<NEW_LINE>String publicValue = (String) attributes.get("public");<NEW_LINE>if (publicValue != null && publicValue.length() > 0) {<NEW_LINE>writer.write(" PUBLIC \"");<NEW_LINE>writer.write(publicValue);<NEW_LINE>writer.write("\"");<NEW_LINE>}<NEW_LINE>String systemValue = (String) attributes.get("system");<NEW_LINE>if (systemValue != null && systemValue.length() > 0) {<NEW_LINE>writer.write(" \"");<NEW_LINE>writer.write(systemValue);<NEW_LINE>writer.write("\"");<NEW_LINE>}<NEW_LINE>writer.write(">");<NEW_LINE>} | super.encodeEnd(context, component); |
1,791,617 | public void hook(ExtensionHook extensionHook) {<NEW_LINE>super.hook(extensionHook);<NEW_LINE>// Register the parameters<NEW_LINE>extensionHook.addOptionsParamSet(getParam());<NEW_LINE>extensionHook.addSessionListener(this);<NEW_LINE>extensionHook.addSiteMapListener(this);<NEW_LINE>extensionHook.addHttpSenderListener(this);<NEW_LINE>if (getView() != null) {<NEW_LINE>// Hook the panels<NEW_LINE>extensionHook.getHookView(<MASK><NEW_LINE>extensionHook.getHookView().addOptionPanel(getOptionsHttpSessionsPanel());<NEW_LINE>// Hook the popup menus<NEW_LINE>extensionHook.getHookMenu().addPopupMenuItem(getPopupMenuSetActiveSession());<NEW_LINE>extensionHook.getHookMenu().addPopupMenuItem(getPopupMenuUnsetActiveSession());<NEW_LINE>extensionHook.getHookMenu().addPopupMenuItem(getPopupMenuRemoveSession());<NEW_LINE>extensionHook.getHookMenu().addPopupMenuItem(getPopupMenuAddUserFromSession());<NEW_LINE>extensionHook.getHookMenu().addPopupMenuItem(getPopupMenuItemCopySessionToken());<NEW_LINE>if (Control.getSingleton().getExtensionLoader().getExtension(ExtensionSearch.class) != null) {<NEW_LINE>extensionHook.getHookMenu().addPopupMenuItem(getPopupMenuItemFindRelatedMessages());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Register as an API implementor<NEW_LINE>extensionHook.addApiImplementor(new HttpSessionsAPI(this));<NEW_LINE>} | ).addStatusPanel(getHttpSessionsPanel()); |
719,650 | private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {<NEW_LINE>in.defaultReadObject();<NEW_LINE>byte[] ec = new byte[Constants.EYE_CATCHER_LENGTH];<NEW_LINE>// d164415 start<NEW_LINE>int bytesRead = 0;<NEW_LINE>for (int offset = 0; offset < Constants.EYE_CATCHER_LENGTH; offset += bytesRead) {<NEW_LINE>bytesRead = in.read(ec, offset, Constants.EYE_CATCHER_LENGTH - offset);<NEW_LINE>if (bytesRead == -1) {<NEW_LINE>throw new IOException("end of input stream while reading eye catcher");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// d164415 end<NEW_LINE>// validate that the eyecatcher matches<NEW_LINE>for (int i = 0; i < eyecatcher.length; i++) {<NEW_LINE>if (eyecatcher[i] != ec[i]) {<NEW_LINE>String eyeCatcherString = new String(ec);<NEW_LINE>throw new IOException("Invalid eye catcher '" + eyeCatcherString + "' in FinderResultClientCollection input stream");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// platform<NEW_LINE>in.readShort();<NEW_LINE>// vid<NEW_LINE>in.readShort();<NEW_LINE>server = (FinderResultServer) in.readObject();<NEW_LINE>allWrappers = <MASK><NEW_LINE>chunkSize = in.readInt();<NEW_LINE>} | (Vector) in.readObject(); |
1,155,036 | public void renameTo(PathFragment sourcePath, PathFragment targetPath) throws IOException {<NEW_LINE>if (isRootDirectory(sourcePath)) {<NEW_LINE>throw Errno.EACCES.exception(sourcePath);<NEW_LINE>}<NEW_LINE>if (isRootDirectory(targetPath)) {<NEW_LINE>throw Errno.EACCES.exception(targetPath);<NEW_LINE>}<NEW_LINE>synchronized (this) {<NEW_LINE>InMemoryDirectoryInfo sourceParent = getDirectory(sourcePath.getParentDirectory());<NEW_LINE>InMemoryDirectoryInfo targetParent = getDirectory(targetPath.getParentDirectory());<NEW_LINE>InMemoryContentInfo sourceInode = sourceParent.getChild(baseNameOrWindowsDrive(sourcePath));<NEW_LINE>if (sourceInode == null) {<NEW_LINE>throw Errno.ENOENT.exception(sourcePath);<NEW_LINE>}<NEW_LINE>InMemoryContentInfo targetInode = targetParent.getChild(baseNameOrWindowsDrive(targetPath));<NEW_LINE>unlink(sourceParent, baseNameOrWindowsDrive(sourcePath), sourcePath);<NEW_LINE>try {<NEW_LINE>// TODO(bazel-team): (2009) test with symbolic links.<NEW_LINE>// Precondition checks:<NEW_LINE>if (targetInode != null) {<NEW_LINE>// already exists<NEW_LINE>if (targetInode.isDirectory()) {<NEW_LINE>if (!sourceInode.isDirectory()) {<NEW_LINE>throw new IOException(sourcePath + " -> " + targetPath + " (" + Errno.EISDIR + ")");<NEW_LINE>}<NEW_LINE>if (targetInode.getSize() > 2) {<NEW_LINE>throw <MASK><NEW_LINE>}<NEW_LINE>} else if (sourceInode.isDirectory()) {<NEW_LINE>throw new IOException(sourcePath + " -> " + targetPath + " (" + Errno.ENOTDIR + ")");<NEW_LINE>}<NEW_LINE>unlink(targetParent, baseNameOrWindowsDrive(targetPath), targetPath);<NEW_LINE>}<NEW_LINE>insert(targetParent, baseNameOrWindowsDrive(targetPath), sourceInode, targetPath);<NEW_LINE>} catch (IOException e) {<NEW_LINE>// restore source<NEW_LINE>insert(// restore source<NEW_LINE>sourceParent, // restore source<NEW_LINE>baseNameOrWindowsDrive(sourcePath), // restore source<NEW_LINE>sourceInode, sourcePath);<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | Errno.ENOTEMPTY.exception(targetPath); |
1,370,674 | public void postIndex(ShardId shardId, Engine.Index indexOperation, Engine.IndexResult result) {<NEW_LINE>if (result.getResultType() == Engine.Result.Type.SUCCESS) {<NEW_LINE>final ParsedDocument doc = indexOperation.parsedDoc();<NEW_LINE>final long tookInNanos = result.getTook();<NEW_LINE>// when logger level is more specific than WARN AND event is within threshold it should be logged<NEW_LINE>if (indexWarnThreshold >= 0 && tookInNanos > indexWarnThreshold && level.isLevelEnabledFor(SlowLogLevel.WARN)) {<NEW_LINE>indexLogger.warn(new IndexingSlowLogMessage(index, doc, tookInNanos, reformat, maxSourceCharsToLog));<NEW_LINE>} else if (indexInfoThreshold >= 0 && tookInNanos > indexInfoThreshold && level.isLevelEnabledFor(SlowLogLevel.INFO)) {<NEW_LINE>indexLogger.info(new IndexingSlowLogMessage(index, doc, tookInNanos, reformat, maxSourceCharsToLog));<NEW_LINE>} else if (indexDebugThreshold >= 0 && tookInNanos > indexDebugThreshold && level.isLevelEnabledFor(SlowLogLevel.DEBUG)) {<NEW_LINE>indexLogger.debug(new IndexingSlowLogMessage(index, doc, tookInNanos, reformat, maxSourceCharsToLog));<NEW_LINE>} else if (indexTraceThreshold >= 0 && tookInNanos > indexTraceThreshold && level.isLevelEnabledFor(SlowLogLevel.TRACE)) {<NEW_LINE>indexLogger.trace(new IndexingSlowLogMessage(index, doc<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | , tookInNanos, reformat, maxSourceCharsToLog)); |
900,851 | static ParserState doUnsignedByteBitfield(ParserState state, Object kwds, @SuppressWarnings("unused") char c, @SuppressWarnings("unused") char[] format, @SuppressWarnings("unused") int format_idx, Object kwdnames, Object varargs, @Shared("getArgNode") @Cached GetArgNode getArgNode, @Cached AsNativePrimitiveNode asNativePrimitiveNode, @Shared("writeOutVarNode") @Cached WriteOutVarNode writeOutVarNode, @Shared("excToNativeNode") @Cached TransformExceptionToNativeNode transformExceptionToNativeNode) throws InteropException, ParseArgumentsException {<NEW_LINE>// C type: unsigned char<NEW_LINE>Object arg = getArgNode.execute(state, kwds, kwdnames, state.restKeywordsOnly);<NEW_LINE>if (!skipOptionalArg(arg, state.restOptional)) {<NEW_LINE>try {<NEW_LINE>writeOutVarNode.writeUInt8(varargs, state.outIndex, asNativePrimitiveNode.toInt64(arg, false));<NEW_LINE>} catch (PException e) {<NEW_LINE>CompilerDirectives.transferToInterpreter();<NEW_LINE><MASK><NEW_LINE>throw ParseArgumentsException.raise();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return state.incrementOutIndex();<NEW_LINE>} | transformExceptionToNativeNode.execute(null, e); |
1,154,298 | public boolean testSumOfBatches(double[] x, double functionTolerance) {<NEW_LINE>boolean ret = false;<NEW_LINE>log.info("Making sure that the sum of stochastic gradients equals the full gradient");<NEW_LINE>AbstractStochasticCachingDiffFunction.SamplingMethod tmpSampleMethod = thisFunc.sampleMethod;<NEW_LINE>StochasticCalculateMethods tmpMethod = thisFunc.method;<NEW_LINE>// Make sure that our function is using ordered sampling. Otherwise we have no gaurentees.<NEW_LINE>thisFunc<MASK><NEW_LINE>if (thisFunc.method == StochasticCalculateMethods.NoneSpecified) {<NEW_LINE>log.info("No calculate method has been specified");<NEW_LINE>}<NEW_LINE>approxValue = 0;<NEW_LINE>approxGrad = new double[x.length];<NEW_LINE>curGrad = new double[x.length];<NEW_LINE>fullGrad = new double[x.length];<NEW_LINE>double percent = 0.0;<NEW_LINE>// This loop runs through all the batches and sums of the calculations to compare against the full gradient<NEW_LINE>for (int i = 0; i < numBatches; i++) {<NEW_LINE>percent = 100 * ((double) i) / (numBatches);<NEW_LINE>// update the value<NEW_LINE>approxValue += thisFunc.valueAt(x, v, testBatchSize);<NEW_LINE>// update the gradient<NEW_LINE>thisFunc.returnPreviousValues = true;<NEW_LINE>System.arraycopy(thisFunc.derivativeAt(x, v, testBatchSize), 0, curGrad, 0, curGrad.length);<NEW_LINE>// Update Approximate<NEW_LINE>approxGrad = ArrayMath.pairwiseAdd(approxGrad, curGrad);<NEW_LINE>double norm = ArrayMath.norm(approxGrad);<NEW_LINE>System.err.printf("%5.1f percent complete %6.2f \n", percent, norm);<NEW_LINE>}<NEW_LINE>// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!<NEW_LINE>// Get the full gradient and value, these should equal the approximates<NEW_LINE>// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!<NEW_LINE>log.info("About to calculate the full derivative and value");<NEW_LINE>System.arraycopy(thisFunc.derivativeAt(x), 0, fullGrad, 0, fullGrad.length);<NEW_LINE>thisFunc.returnPreviousValues = true;<NEW_LINE>fullValue = thisFunc.valueAt(x);<NEW_LINE>diff = new double[x.length];<NEW_LINE>if ((ArrayMath.norm_inf(diff = ArrayMath.pairwiseSubtract(fullGrad, approxGrad))) < functionTolerance) {<NEW_LINE>sayln("");<NEW_LINE>sayln("Success: sum of batch gradients equals full gradient");<NEW_LINE>ret = true;<NEW_LINE>} else {<NEW_LINE>diffNorm = ArrayMath.norm(diff);<NEW_LINE>sayln("");<NEW_LINE>sayln("Failure: sum of batch gradients minus full gradient has norm " + diffNorm);<NEW_LINE>ret = false;<NEW_LINE>}<NEW_LINE>if (Math.abs(approxValue - fullValue) < functionTolerance) {<NEW_LINE>sayln("");<NEW_LINE>sayln("Success: sum of batch values equals full value");<NEW_LINE>ret = true;<NEW_LINE>} else {<NEW_LINE>sayln("");<NEW_LINE>sayln("Failure: sum of batch values minus full value has norm " + Math.abs(approxValue - fullValue));<NEW_LINE>ret = false;<NEW_LINE>}<NEW_LINE>thisFunc.sampleMethod = tmpSampleMethod;<NEW_LINE>thisFunc.method = tmpMethod;<NEW_LINE>return ret;<NEW_LINE>} | .sampleMethod = AbstractStochasticCachingDiffFunction.SamplingMethod.Ordered; |
1,632,999 | public DashboardEntry unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>DashboardEntry dashboardEntry = new DashboardEntry();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>if (context.isStartOfDocument())<NEW_LINE>targetDepth += 1;<NEW_LINE>while (true) {<NEW_LINE>XMLEvent xmlEvent = context.nextEvent();<NEW_LINE>if (xmlEvent.isEndDocument())<NEW_LINE>return dashboardEntry;<NEW_LINE>if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {<NEW_LINE>if (context.testExpression("DashboardName", targetDepth)) {<NEW_LINE>dashboardEntry.setDashboardName(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("DashboardArn", targetDepth)) {<NEW_LINE>dashboardEntry.setDashboardArn(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("LastModified", targetDepth)) {<NEW_LINE>dashboardEntry.setLastModified(DateStaxUnmarshallerFactory.getInstance("iso8601").unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("Size", targetDepth)) {<NEW_LINE>dashboardEntry.setSize(LongStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent.isEndElement()) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>return dashboardEntry;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
1,123,135 | private void createExternalTaskDemoData(ProcessEngine engine) {<NEW_LINE>RuntimeService runtimeService = engine.getRuntimeService();<NEW_LINE>ExternalTaskService externalTaskService = engine.getExternalTaskService();<NEW_LINE>String workerId = "AWorker";<NEW_LINE>String topicName = "ATopic";<NEW_LINE>long lockDuration = 5 * 60L * 1000L;<NEW_LINE>String errorDetails = "java.lang.RuntimeException: A exception message!\n" + " at org.camunda.bpm.pa.service.FailingDelegate.execute(FailingDelegate.java:10)\n" + " at org.camunda.bpm.engine.impl.delegate.JavaDelegateInvocation.invoke(JavaDelegateInvocation.java:34)\n" + " at org.camunda.bpm.engine.impl.delegate.DelegateInvocation.proceed(DelegateInvocation.java:37)\n" + " ...\n";<NEW_LINE>// create 5 tasks<NEW_LINE>for (int i = 0; i < 5; i++) {<NEW_LINE>runtimeService.startProcessInstanceByKey("SimpleExternalTaskProcess");<NEW_LINE>}<NEW_LINE>// complete two tasks<NEW_LINE>List<LockedExternalTask> lockedTasks = externalTaskService.fetchAndLock(2, workerId, false).topic(topicName, lockDuration).execute();<NEW_LINE>for (LockedExternalTask task : lockedTasks) {<NEW_LINE>externalTaskService.complete(task.getId(), workerId);<NEW_LINE>}<NEW_LINE>// fail the remaining 3 tasks<NEW_LINE>lockedTasks = externalTaskService.fetchAndLock(3, workerId, false).topic(topicName, lockDuration).execute();<NEW_LINE>for (LockedExternalTask task : lockedTasks) {<NEW_LINE>externalTaskService.handleFailure(task.getId(), workerId, "This is an error!", errorDetails, 0, 0L);<NEW_LINE>}<NEW_LINE>// create 2 more tasks<NEW_LINE>for (int i = 0; i < 2; i++) {<NEW_LINE>runtimeService.startProcessInstanceByKey("SimpleExternalTaskProcess");<NEW_LINE>}<NEW_LINE>// fail them and then complete them<NEW_LINE>lockedTasks = externalTaskService.fetchAndLock(2, workerId, false).topic(topicName, lockDuration).execute();<NEW_LINE>for (LockedExternalTask task : lockedTasks) {<NEW_LINE>externalTaskService.handleFailure(task.getId(), workerId, "This is an error!", errorDetails, 1, 0L);<NEW_LINE>}<NEW_LINE>lockedTasks = externalTaskService.fetchAndLock(2, workerId, false).topic(topicName, lockDuration).execute();<NEW_LINE>for (LockedExternalTask task : lockedTasks) {<NEW_LINE>externalTaskService.complete(task.getId(), workerId);<NEW_LINE>}<NEW_LINE>// create 6 more tasks<NEW_LINE>List<ProcessInstance> piList = new LinkedList<ProcessInstance>();<NEW_LINE>for (int i = 0; i < 6; i++) {<NEW_LINE>piList.add<MASK><NEW_LINE>}<NEW_LINE>// delete two of them<NEW_LINE>runtimeService.deleteProcessInstance(piList.get(0).getId(), "This process was annoying!");<NEW_LINE>runtimeService.deleteProcessInstance(piList.get(1).getId(), "This process was annoying!");<NEW_LINE>} | (runtimeService.startProcessInstanceByKey("SimpleExternalTaskProcess")); |
1,399,380 | private static ConstructingObjectParser<Builder, Void> createParser(boolean ignoreUnknownFields) {<NEW_LINE>ConstructingObjectParser<Builder, Void> parser = new ConstructingObjectParser<>(RESULT_TYPE_FIELD.getPreferredName(), ignoreUnknownFields, a -> new Builder((String) a[0]));<NEW_LINE>parser.declareString(ConstructingObjectParser.constructorArg(), Job.ID);<NEW_LINE>parser.declareString((modelSizeStat, s) -> {<NEW_LINE>}, Result.RESULT_TYPE);<NEW_LINE>parser.declareString(Builder::setPartitionFieldName, PARTITION_FIELD_NAME);<NEW_LINE>parser.declareString(Builder::setPartitionFieldValue, PARTITION_FIELD_VALUE);<NEW_LINE>parser.declareLong(Builder::setCategorizedDocCount, CATEGORIZED_DOC_COUNT_FIELD);<NEW_LINE>parser.declareLong(Builder::setTotalCategoryCount, TOTAL_CATEGORY_COUNT_FIELD);<NEW_LINE>parser.declareLong(Builder::setFrequentCategoryCount, FREQUENT_CATEGORY_COUNT_FIELD);<NEW_LINE>parser.declareLong(Builder::setRareCategoryCount, RARE_CATEGORY_COUNT_FIELD);<NEW_LINE>parser.declareLong(Builder::setDeadCategoryCount, DEAD_CATEGORY_COUNT_FIELD);<NEW_LINE>parser.declareLong(Builder::setFailedCategoryCount, FAILED_CATEGORY_COUNT_FIELD);<NEW_LINE>parser.declareField(Builder::setCategorizationStatus, p -> CategorizationStatus.fromString(p.text()<MASK><NEW_LINE>parser.declareField(Builder::setLogTime, p -> TimeUtils.parseTimeFieldToInstant(p, LOG_TIME_FIELD.getPreferredName()), LOG_TIME_FIELD, ValueType.VALUE);<NEW_LINE>parser.declareField(Builder::setTimestamp, p -> TimeUtils.parseTimeFieldToInstant(p, TIMESTAMP_FIELD.getPreferredName()), TIMESTAMP_FIELD, ValueType.VALUE);<NEW_LINE>return parser;<NEW_LINE>} | ), CATEGORIZATION_STATUS_FIELD, ValueType.STRING); |
378,090 | public void takeScreenshotsOfMenuandAllowlist() throws UiObjectNotFoundException {<NEW_LINE>SystemClock.sleep(5000);<NEW_LINE>onView(withId(R.id.mozac_browser_toolbar_edit_url_view)).check(matches(isDisplayed())).check(matches(hasFocus())).perform(click(), replaceText(webServer.url("/").toString()));<NEW_LINE>onView(withId(R.id.mozac_browser_toolbar_edit_url_view)).check(matches(isDisplayed())).check(matches(hasFocus())).perform(pressImeActionButton());<NEW_LINE>device.findObject(new UiSelector().resourceId(TestHelper.getAppName() + ":id/webview").enabled(true)).waitForExists(waitingTime);<NEW_LINE>TestHelper.menuButton.perform(click());<NEW_LINE>Screengrab.screenshot("BrowserViewMenu");<NEW_LINE>onView(withId(R.id.enhanced_tracking)).perform(click());<NEW_LINE>// Open setting<NEW_LINE>onView(withId(R.id.menuView)).check(matches(isDisplayed())<MASK><NEW_LINE>onView(withId(R.id.settings)).check(matches(isDisplayed())).perform(click());<NEW_LINE>onView(withText(R.string.preference_privacy_and_security_header)).perform(click());<NEW_LINE>UiScrollable settingsView = new UiScrollable(new UiSelector().scrollable(true));<NEW_LINE>if (settingsView.exists()) {<NEW_LINE>// On tablet, this will not be found<NEW_LINE>settingsView.scrollToEnd(5);<NEW_LINE>onView(withText(R.string.preference_exceptions)).perform(click());<NEW_LINE>}<NEW_LINE>onView(withId(R.id.removeAllExceptions)).check(matches(isDisplayed()));<NEW_LINE>Screengrab.screenshot("ExceptionsDialog");<NEW_LINE>onView(withId(R.id.removeAllExceptions)).perform(click());<NEW_LINE>} | ).perform(click()); |
1,536,067 | private void addJoinFieldMapping(ObjectNode propertiesNode, ElasticsearchPersistentProperty property) throws IOException {<NEW_LINE>JoinTypeRelation[] joinTypeRelations = property.getRequiredAnnotation(JoinTypeRelations.class).relations();<NEW_LINE>if (joinTypeRelations.length == 0) {<NEW_LINE>LOGGER.warn(//<NEW_LINE>String.//<NEW_LINE>format(//<NEW_LINE>"Property %s's type is JoinField but its annotation JoinTypeRelation is " + "not properly maintained", property.getFieldName()));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ObjectNode propertyNode = propertiesNode.<MASK><NEW_LINE>propertyNode.put(FIELD_PARAM_TYPE, TYPE_VALUE_JOIN);<NEW_LINE>ObjectNode relationsNode = propertyNode.putObject(JOIN_TYPE_RELATIONS);<NEW_LINE>for (JoinTypeRelation joinTypeRelation : joinTypeRelations) {<NEW_LINE>String parent = joinTypeRelation.parent();<NEW_LINE>String[] children = joinTypeRelation.children();<NEW_LINE>if (children.length > 1) {<NEW_LINE>relationsNode.putArray(parent).addAll(Arrays.stream(children).map(TextNode::valueOf).collect(Collectors.toList()));<NEW_LINE>} else if (children.length == 1) {<NEW_LINE>relationsNode.put(parent, children[0]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | putObject(property.getFieldName()); |
540,044 | public static DescribeInstanceResponse unmarshall(DescribeInstanceResponse describeInstanceResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeInstanceResponse.setRequestId(_ctx.stringValue("DescribeInstanceResponse.RequestId"));<NEW_LINE>describeInstanceResponse.setInstanceId<MASK><NEW_LINE>describeInstanceResponse.setName(_ctx.stringValue("DescribeInstanceResponse.Name"));<NEW_LINE>describeInstanceResponse.setDescription(_ctx.stringValue("DescribeInstanceResponse.Description"));<NEW_LINE>describeInstanceResponse.setStatus(_ctx.stringValue("DescribeInstanceResponse.Status"));<NEW_LINE>describeInstanceResponse.setConcurrency(_ctx.longValue("DescribeInstanceResponse.Concurrency"));<NEW_LINE>describeInstanceResponse.setModifyTime(_ctx.longValue("DescribeInstanceResponse.ModifyTime"));<NEW_LINE>describeInstanceResponse.setModifyUserName(_ctx.stringValue("DescribeInstanceResponse.ModifyUserName"));<NEW_LINE>describeInstanceResponse.setNluServiceType(_ctx.stringValue("DescribeInstanceResponse.NluServiceType"));<NEW_LINE>List<String> applicableOperations = new ArrayList<String>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeInstanceResponse.ApplicableOperations.Length"); i++) {<NEW_LINE>applicableOperations.add(_ctx.stringValue("DescribeInstanceResponse.ApplicableOperations[" + i + "]"));<NEW_LINE>}<NEW_LINE>describeInstanceResponse.setApplicableOperations(applicableOperations);<NEW_LINE>return describeInstanceResponse;<NEW_LINE>} | (_ctx.stringValue("DescribeInstanceResponse.InstanceId")); |
660,149 | public CompletableFuture<ApiResponse<List<Pet>>> findPetsByStatusWithHttpInfo(List<String> status) throws ApiException {<NEW_LINE>try {<NEW_LINE>HttpRequest.Builder localVarRequestBuilder = findPetsByStatusRequestBuilder(status);<NEW_LINE>return memberVarHttpClient.sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> {<NEW_LINE>if (memberVarAsyncResponseInterceptor != null) {<NEW_LINE>memberVarAsyncResponseInterceptor.accept(localVarResponse);<NEW_LINE>}<NEW_LINE>if (localVarResponse.statusCode() / 100 != 2) {<NEW_LINE>return CompletableFuture.failedFuture(getApiException("findPetsByStatus", localVarResponse));<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>return CompletableFuture.completedFuture(new ApiResponse<List<Pet>>(localVarResponse.statusCode(), localVarResponse.headers().map(), memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<List<Pet>>() {<NEW_LINE>})));<NEW_LINE>} catch (IOException e) {<NEW_LINE>return CompletableFuture.<MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (ApiException e) {<NEW_LINE>return CompletableFuture.failedFuture(e);<NEW_LINE>}<NEW_LINE>} | failedFuture(new ApiException(e)); |
551,478 | public void invoke(Project project, Editor editor, PsiFile file) throws IncorrectOperationException {<NEW_LINE>final AtomicReference<PsiMethod> eventMethodRef = new AtomicReference<>();<NEW_LINE>final Runnable generateOnEvent = () -> OnEventGenerateAction.createHandler((context, eventProject) -> event, eventMethodRef::set).<MASK><NEW_LINE>final Runnable updateArgumentList = () -> Optional.ofNullable(eventMethodRef.get()).map(eventMethod -> AddArgumentFix.createArgumentList(methodCall, clsName, eventMethod.getName(), JavaPsiFacade.getInstance(project).getElementFactory())).ifPresent(argumentList -> methodCall.getArgumentList().replace(argumentList));<NEW_LINE>final Runnable action = () -> {<NEW_LINE>TransactionGuard.getInstance().submitTransactionAndWait(generateOnEvent);<NEW_LINE>WriteCommandAction.runWriteCommandAction(project, updateArgumentList);<NEW_LINE>LithoLoggerProvider.getEventLogger().log(EventLogger.EVENT_FIX_EVENT_HANDLER + ".new");<NEW_LINE>};<NEW_LINE>final Application application = ApplicationManager.getApplication();<NEW_LINE>if (application.isUnitTestMode()) {<NEW_LINE>action.run();<NEW_LINE>} else {<NEW_LINE>application.invokeLater(action);<NEW_LINE>}<NEW_LINE>} | invoke(project, editor, file); |
1,598,702 | private static void createBrokerResourceIfNeeded(String helixClusterName, HelixAdmin helixAdmin, boolean enableBatchMessageMode) {<NEW_LINE>// Add state model definition if needed<NEW_LINE>String stateModel = PinotHelixBrokerResourceOnlineOfflineStateModelGenerator.PINOT_BROKER_RESOURCE_ONLINE_OFFLINE_STATE_MODEL;<NEW_LINE>StateModelDefinition stateModelDef = helixAdmin.getStateModelDef(helixClusterName, stateModel);<NEW_LINE>if (stateModelDef == null) {<NEW_LINE>LOGGER.info("Adding state model: {}", stateModel);<NEW_LINE>helixAdmin.addStateModelDef(helixClusterName, stateModel, PinotHelixBrokerResourceOnlineOfflineStateModelGenerator.generatePinotStateModelDefinition());<NEW_LINE>}<NEW_LINE>// Add broker resource if needed<NEW_LINE>if (helixAdmin.getResourceIdealState(helixClusterName, BROKER_RESOURCE_INSTANCE) == null) {<NEW_LINE><MASK><NEW_LINE>IdealState idealState = new CustomModeISBuilder(BROKER_RESOURCE_INSTANCE).setStateModel(stateModel).build();<NEW_LINE>idealState.setBatchMessageMode(enableBatchMessageMode);<NEW_LINE>helixAdmin.addResource(helixClusterName, BROKER_RESOURCE_INSTANCE, idealState);<NEW_LINE>}<NEW_LINE>} | LOGGER.info("Adding resource: {}", BROKER_RESOURCE_INSTANCE); |
206,033 | private Mono<Response<SlotConfigNamesResourceInner>> listSlotConfigurationNamesWithResponseAsync(String resourceGroupName, String name, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (name == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = <MASK><NEW_LINE>return service.listSlotConfigurationNames(this.client.getEndpoint(), resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context);<NEW_LINE>} | this.client.mergeContext(context); |
790,958 | public static synchronized void init(@NotNull final Context context, @NotNull ILogger logger, @NotNull Sentry.OptionsConfiguration<SentryAndroidOptions> configuration) {<NEW_LINE>// if SentryPerformanceProvider was disabled or removed, we set the App Start when<NEW_LINE>// the SDK is called.<NEW_LINE>AppStartState.getInstance().setAppStartTime(appStart, appStartTime);<NEW_LINE>try {<NEW_LINE>Sentry.init(OptionsContainer.create(SentryAndroidOptions.class), options -> {<NEW_LINE>final LoadClass classLoader = new LoadClass();<NEW_LINE>final boolean isFragmentAvailable = classLoader.isClassAvailable(SENTRY_FRAGMENT_INTEGRATION_CLASS_NAME, options);<NEW_LINE>final boolean isTimberAvailable = classLoader.isClassAvailable(SENTRY_TIMBER_INTEGRATION_CLASS_NAME, options);<NEW_LINE>AndroidOptionsInitializer.init(options, context, logger, isFragmentAvailable, isTimberAvailable);<NEW_LINE>configuration.configure(options);<NEW_LINE>deduplicateIntegrations(options, isFragmentAvailable, isTimberAvailable);<NEW_LINE>}, true);<NEW_LINE>} catch (IllegalAccessException e) {<NEW_LINE>logger.log(<MASK><NEW_LINE>// This is awful. Should we have this all on the interface and let the caller deal with these?<NEW_LINE>// They mean bug in the SDK.<NEW_LINE>throw new RuntimeException("Failed to initialize Sentry's SDK", e);<NEW_LINE>} catch (InstantiationException e) {<NEW_LINE>logger.log(SentryLevel.FATAL, "Fatal error during SentryAndroid.init(...)", e);<NEW_LINE>throw new RuntimeException("Failed to initialize Sentry's SDK", e);<NEW_LINE>} catch (NoSuchMethodException e) {<NEW_LINE>logger.log(SentryLevel.FATAL, "Fatal error during SentryAndroid.init(...)", e);<NEW_LINE>throw new RuntimeException("Failed to initialize Sentry's SDK", e);<NEW_LINE>} catch (InvocationTargetException e) {<NEW_LINE>logger.log(SentryLevel.FATAL, "Fatal error during SentryAndroid.init(...)", e);<NEW_LINE>throw new RuntimeException("Failed to initialize Sentry's SDK", e);<NEW_LINE>}<NEW_LINE>} | SentryLevel.FATAL, "Fatal error during SentryAndroid.init(...)", e); |
583,390 | public void onRequestFinish(MegaApiJava api, MegaRequest request, MegaError error) {<NEW_LINE>logDebug("onRequestFinish");<NEW_LINE>if (request.getType() == MegaRequest.TYPE_LOGIN) {<NEW_LINE>if (error.getErrorCode() != MegaError.API_OK) {<NEW_LINE>logWarning("Login failed with error code: " + error.getErrorCode());<NEW_LINE>MegaApplication.setLoggingIn(false);<NEW_LINE>} else {<NEW_LINE>loginProgressBar.setVisibility(View.VISIBLE);<NEW_LINE>loginFetchNodesProgressBar.setVisibility(View.GONE);<NEW_LINE>loggingInText.setVisibility(View.VISIBLE);<NEW_LINE>fetchingNodesText.setVisibility(View.VISIBLE);<NEW_LINE>prepareNodesText.setVisibility(View.GONE);<NEW_LINE>gSession = megaApi.dumpSession();<NEW_LINE>credentials = new UserCredentials(lastEmail, gSession, "", "", "");<NEW_LINE>dbH.saveCredentials(credentials);<NEW_LINE>logDebug("Logged in with session");<NEW_LINE>logDebug("Setting account auth token for folder links.");<NEW_LINE>megaApiFolder.setAccountAuth(megaApi.getAccountAuth());<NEW_LINE>megaApi.fetchNodes(this);<NEW_LINE>// Get cookies settings after login.<NEW_LINE>MegaApplication<MASK><NEW_LINE>}<NEW_LINE>} else if (request.getType() == MegaRequest.TYPE_FETCH_NODES) {<NEW_LINE>if (error.getErrorCode() == MegaError.API_OK) {<NEW_LINE>DatabaseHandler dbH = DatabaseHandler.getDbHandler(getApplicationContext());<NEW_LINE>gSession = megaApi.dumpSession();<NEW_LINE>MegaUser myUser = megaApi.getMyUser();<NEW_LINE>String myUserHandle = "";<NEW_LINE>if (myUser != null) {<NEW_LINE>lastEmail = megaApi.getMyUser().getEmail();<NEW_LINE>myUserHandle = megaApi.getMyUser().getHandle() + "";<NEW_LINE>}<NEW_LINE>credentials = new UserCredentials(lastEmail, gSession, "", "", myUserHandle);<NEW_LINE>dbH.saveCredentials(credentials);<NEW_LINE>loginLoggingIn.setVisibility(View.GONE);<NEW_LINE>MegaApplication.setLoggingIn(false);<NEW_LINE>afterLoginAndFetch();<NEW_LINE>}<NEW_LINE>} else if (request.getType() == MegaRequest.TYPE_COPY) {<NEW_LINE>filesChecked++;<NEW_LINE>if (error.getErrorCode() == MegaError.API_OK) {<NEW_LINE>MegaNode node = megaApi.getNodeByHandle(request.getNodeHandle());<NEW_LINE>if (node != null) {<NEW_LINE>attachNodes.add(node);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>logWarning("Error copying node into My Chat Files");<NEW_LINE>}<NEW_LINE>if (filesChecked == filePreparedInfos.size()) {<NEW_LINE>startChatUploadService();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .getInstance().checkEnabledCookies(); |
1,360,575 | public SqsQueueConfiguration unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>SqsQueueConfiguration sqsQueueConfiguration = new SqsQueueConfiguration();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("queuePolicy", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>sqsQueueConfiguration.setQueuePolicy(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return sqsQueueConfiguration;<NEW_LINE>} | class).unmarshall(context)); |
658,668 | final UpdateServiceInstanceResult executeUpdateServiceInstance(UpdateServiceInstanceRequest updateServiceInstanceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateServiceInstanceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateServiceInstanceRequest> request = null;<NEW_LINE>Response<UpdateServiceInstanceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateServiceInstanceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateServiceInstanceRequest));<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.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateServiceInstance");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateServiceInstanceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateServiceInstanceResultJsonUnmarshaller());<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.SERVICE_ID, "Proton"); |
397,269 | private void updateInstanceToOwner(String region) {<NEW_LINE>LOGGER.info(String.format("Getting owners for all instances in region %s", region));<NEW_LINE>long startTime = DateTime.now().minusDays(LOOKBACK_DAYS).getMillis();<NEW_LINE>String url = String.format("%1$s/view/instances;_since=%2$d;state.name=running;tags.key=%3$s;" + "_expand:(instanceId,tags:(key,value))", eddaClient.getBaseUrl(region), startTime, BasicSimianArmyContext.GLOBAL_OWNER_TAGKEY);<NEW_LINE>JsonNode jsonNode = null;<NEW_LINE>try {<NEW_LINE>jsonNode = eddaClient.getJsonNodeFromUrl(url);<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOGGER.error(String.format("Failed to get Jason node from edda for instance owners in region %s.", region), e);<NEW_LINE>}<NEW_LINE>if (jsonNode == null || !jsonNode.isArray()) {<NEW_LINE>throw new RuntimeException(String.format("Failed to get valid document from %s, got: %s", url, jsonNode));<NEW_LINE>}<NEW_LINE>for (Iterator<JsonNode> it = jsonNode.getElements(); it.hasNext(); ) {<NEW_LINE>JsonNode elem = it.next();<NEW_LINE>String instanceId = elem.get("instanceId").getTextValue();<NEW_LINE>JsonNode <MASK><NEW_LINE>if (tags == null || !tags.isArray() || tags.size() == 0) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>for (Iterator<JsonNode> tagsIt = tags.getElements(); tagsIt.hasNext(); ) {<NEW_LINE>JsonNode tag = tagsIt.next();<NEW_LINE>String tagKey = tag.get("key").getTextValue();<NEW_LINE>if (BasicSimianArmyContext.GLOBAL_OWNER_TAGKEY.equals(tagKey)) {<NEW_LINE>instanceToOwner.put(instanceId, tag.get("value").getTextValue());<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | tags = elem.get("tags"); |
472,806 | protected void configurePlot(Plot plot, JRChartPlot jrPlot) {<NEW_LINE>super.configurePlot(plot, jrPlot);<NEW_LINE>if (plot instanceof CategoryPlot) {<NEW_LINE>CategoryPlot categoryPlot = (CategoryPlot) plot;<NEW_LINE>CategoryItemRenderer categoryRenderer = categoryPlot.getRenderer();<NEW_LINE>CategoryDataset categoryDataset = categoryPlot.getDataset();<NEW_LINE>if (categoryDataset != null) {<NEW_LINE>for (int i = 0; i < categoryDataset.getRowCount(); i++) {<NEW_LINE>categoryRenderer.setSeriesOutlinePaint(i, ChartThemesConstants.TRANSPARENT_PAINT);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>categoryPlot.setRangeGridlinePaint(ChartThemesConstants.GRAY_PAINT_217);<NEW_LINE>categoryPlot.setRangeGridlineStroke(new BasicStroke(0.5f));<NEW_LINE>categoryPlot.setDomainGridlinesVisible(false);<NEW_LINE>categoryPlot.getDomainAxis().setCategoryLabelPositions(CategoryLabelPositions.UP_45);<NEW_LINE>} else if (plot instanceof XYPlot) {<NEW_LINE>XYPlot xyPlot = (XYPlot) plot;<NEW_LINE>XYItemRenderer xyItemRenderer = xyPlot.getRenderer();<NEW_LINE>XYDataset xyDataset = xyPlot.getDataset();<NEW_LINE>if (xyDataset != null) {<NEW_LINE>for (int i = 0; i < xyDataset.getSeriesCount(); i++) {<NEW_LINE>xyItemRenderer.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>xyPlot.setRangeGridlinePaint(ChartThemesConstants.GRAY_PAINT_217);<NEW_LINE>xyPlot.setRangeGridlineStroke(new BasicStroke(0.5f));<NEW_LINE>xyPlot.setDomainGridlinesVisible(false);<NEW_LINE>xyPlot.setRangeZeroBaselineVisible(true);<NEW_LINE>}<NEW_LINE>} | setSeriesOutlinePaint(i, ChartThemesConstants.TRANSPARENT_PAINT); |
968,703 | public void render() {<NEW_LINE>float delta = Gdx.graphics.getDeltaTime();<NEW_LINE>float remaining = delta;<NEW_LINE>while (remaining > 0) {<NEW_LINE>float d = <MASK><NEW_LINE>world.step(d, 8, 3);<NEW_LINE>time += d;<NEW_LINE>remaining -= d;<NEW_LINE>}<NEW_LINE>camera.update();<NEW_LINE>ScreenUtils.clear(0, 0, 0, 0);<NEW_LINE>batch.setProjectionMatrix(camera.projection);<NEW_LINE>batch.setTransformMatrix(camera.view);<NEW_LINE>batch.begin();<NEW_LINE>animation.apply(skeleton, time, time, true, events, 1, MixBlend.first, MixDirection.in);<NEW_LINE>skeleton.x += 8 * delta;<NEW_LINE>skeleton.updateWorldTransform();<NEW_LINE>skeletonRenderer.draw(batch, skeleton);<NEW_LINE>batch.end();<NEW_LINE>// Position each attachment body.<NEW_LINE>for (Slot slot : skeleton.getSlots()) {<NEW_LINE>if (!(slot.getAttachment() instanceof Box2dAttachment))<NEW_LINE>continue;<NEW_LINE>Box2dAttachment attachment = (Box2dAttachment) slot.getAttachment();<NEW_LINE>if (attachment.body == null)<NEW_LINE>continue;<NEW_LINE>float x = slot.getBone().getWorldX();<NEW_LINE>float y = slot.getBone().getWorldY();<NEW_LINE>float rotation = slot.getBone().getWorldRotationX();<NEW_LINE>attachment.body.setTransform(x, y, rotation * MathUtils.degRad);<NEW_LINE>}<NEW_LINE>box2dRenderer.render(world, camera.combined);<NEW_LINE>} | Math.min(0.016f, remaining); |
390,363 | public void example74(Vertx vertx, Router router) {<NEW_LINE>// create an OAuth2 provider, clientID and clientSecret<NEW_LINE>// should be requested to github<NEW_LINE>OAuth2Auth gitHubAuthProvider = GithubAuth.create(vertx, "CLIENT_ID", "CLIENT_SECRET");<NEW_LINE>// create a oauth2 handler on our running server<NEW_LINE>// the second argument is the full url to the callback<NEW_LINE>// as you entered in your provider management console.<NEW_LINE>OAuth2AuthHandler githubOAuth2 = OAuth2AuthHandler.create(vertx, gitHubAuthProvider, "https://myserver.com/github-callback");<NEW_LINE>// setup the callback handler for receiving the GitHub callback<NEW_LINE>githubOAuth2.setupCallback(router.route("/github-callback"));<NEW_LINE>// create an OAuth2 provider, clientID and clientSecret<NEW_LINE>// should be requested to Google<NEW_LINE>OAuth2Auth googleAuthProvider = OAuth2Auth.create(vertx, new OAuth2Options().setClientId("CLIENT_ID").setClientSecret("CLIENT_SECRET").setFlow(OAuth2FlowType.AUTH_CODE).setSite("https://accounts.google.com").setTokenPath(<MASK><NEW_LINE>// create a oauth2 handler on our domain: "http://localhost:8080"<NEW_LINE>OAuth2AuthHandler googleOAuth2 = OAuth2AuthHandler.create(vertx, googleAuthProvider, "https://myserver.com/google-callback");<NEW_LINE>// setup the callback handler for receiving the Google callback<NEW_LINE>googleOAuth2.setupCallback(router.route("/google-callback"));<NEW_LINE>// At this point the 2 callbacks endpoints are registered:<NEW_LINE>// /github-callback -> handle github Oauth2 callbacks<NEW_LINE>// /google-callback -> handle google Oauth2 callbacks<NEW_LINE>// As the callbacks are made by the IdPs there's no header<NEW_LINE>// to identify the source, hence the need of custom URLs<NEW_LINE>// However for out Application we can control it so later<NEW_LINE>// we can add the right handler for the right tenant<NEW_LINE>router.route().handler(// tenants using github should go this way:<NEW_LINE>MultiTenantHandler.create("X-Tenant").addTenantHandler("github", // tenants using google should go this way:<NEW_LINE>githubOAuth2).addTenantHandler("google", // all other should be forbidden<NEW_LINE>googleOAuth2).addDefaultHandler(ctx -> ctx.fail(401)));<NEW_LINE>// Proceed using the router as usual.<NEW_LINE>} | "https://www.googleapis.com/oauth2/v3/token").setAuthorizationPath("/o/oauth2/auth")); |
102,310 | public void service(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {<NEW_LINE>List<JasperPrint> jasperPrintList = BaseHttpServlet.getJasperPrintList(request);<NEW_LINE>if (jasperPrintList == null) {<NEW_LINE>throw new ServletException("No JasperPrint documents found on the HTTP session.");<NEW_LINE>}<NEW_LINE>Boolean isBuffered = Boolean.valueOf(request.getParameter(BaseHttpServlet.BUFFERED_OUTPUT_REQUEST_PARAMETER));<NEW_LINE>if (isBuffered) {<NEW_LINE>FileBufferedOutputStream fbos = new FileBufferedOutputStream();<NEW_LINE>JRPdfExporter exporter = new JRPdfExporter(DefaultJasperReportsContext.getInstance());<NEW_LINE>exporter.setExporterInput(SimpleExporterInput.getInstance(jasperPrintList));<NEW_LINE>exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(fbos));<NEW_LINE>try {<NEW_LINE>exporter.exportReport();<NEW_LINE>fbos.close();<NEW_LINE>if (fbos.size() > 0) {<NEW_LINE>response.setContentType("application/pdf");<NEW_LINE>response.setContentLength(fbos.size());<NEW_LINE>ServletOutputStream outputStream = response.getOutputStream();<NEW_LINE>try {<NEW_LINE>fbos.writeData(outputStream);<NEW_LINE>fbos.dispose();<NEW_LINE>outputStream.flush();<NEW_LINE>} finally {<NEW_LINE>if (outputStream != null) {<NEW_LINE>try {<NEW_LINE>outputStream.close();<NEW_LINE>} catch (IOException ex) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (JRException e) {<NEW_LINE>throw new ServletException(e);<NEW_LINE>} finally {<NEW_LINE>fbos.close();<NEW_LINE>fbos.dispose();<NEW_LINE>}<NEW_LINE>// else<NEW_LINE>// {<NEW_LINE>// response.setContentType("text/html");<NEW_LINE>// PrintWriter out = response.getWriter();<NEW_LINE>// out.println("<html>");<NEW_LINE>// out.println("<body bgcolor=\"white\">");<NEW_LINE>// out.println("<span class=\"bold\">Empty response.</span>");<NEW_LINE>// out.println("</body>");<NEW_LINE>// out.println("</html>");<NEW_LINE>// }<NEW_LINE>} else {<NEW_LINE>response.setContentType("application/pdf");<NEW_LINE>JRPdfExporter exporter = new JRPdfExporter(DefaultJasperReportsContext.getInstance());<NEW_LINE>exporter.setExporterInput(SimpleExporterInput.getInstance(jasperPrintList));<NEW_LINE><MASK><NEW_LINE>exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(outputStream));<NEW_LINE>try {<NEW_LINE>exporter.exportReport();<NEW_LINE>} catch (JRException e) {<NEW_LINE>throw new ServletException(e);<NEW_LINE>} finally {<NEW_LINE>if (outputStream != null) {<NEW_LINE>try {<NEW_LINE>outputStream.close();<NEW_LINE>} catch (IOException ex) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | OutputStream outputStream = response.getOutputStream(); |
1,334,578 | public com.amazonaws.services.fsx.model.InvalidPerUnitStorageThroughputException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.fsx.model.InvalidPerUnitStorageThroughputException invalidPerUnitStorageThroughputException = new com.amazonaws.services.<MASK><NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>} 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 invalidPerUnitStorageThroughputException;<NEW_LINE>} | fsx.model.InvalidPerUnitStorageThroughputException(null); |
1,853,059 | final DescribeUsersResult executeDescribeUsers(DescribeUsersRequest describeUsersRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeUsersRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeUsersRequest> request = null;<NEW_LINE>Response<DescribeUsersResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeUsersRequestMarshaller().marshall(super.beforeMarshalling(describeUsersRequest));<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, "ElastiCache");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeUsers");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DescribeUsersResult> responseHandler = new StaxResponseHandler<DescribeUsersResult>(new DescribeUsersResultStaxUnmarshaller());<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); |
358,673 | public DeleteMapResult deleteMap(DeleteMapRequest deleteMapRequest) throws AmazonServiceException, AmazonClientException {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteMapRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteMapRequest> request = null;<NEW_LINE>Response<DeleteMapResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteMapRequestMarshaller().marshall(deleteMapRequest);<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<DeleteMapResult, JsonUnmarshallerContext> unmarshaller = new DeleteMapResultJsonUnmarshaller();<NEW_LINE>JsonResponseHandler<DeleteMapResult> responseHandler = new JsonResponseHandler<DeleteMapResult>(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); |
493,880 | RemoteFile prepareRemoteFile(String tag, String section, String path, FileReference reference, boolean template, String localDir) {<NEW_LINE>String id = randomTag(s -> !ids.add(s));<NEW_LINE>String prefix = tag + "/" + section <MASK><NEW_LINE>if (localDir == null) {<NEW_LINE>localDir = LOCAL_STAGING_DIR + "/" + prefix;<NEW_LINE>}<NEW_LINE>ImmutableRemoteFile.Builder builder = ImmutableRemoteFile.builder().reference(reference).localPath(localDir + "/" + reference.filename());<NEW_LINE>if (reference.local()) {<NEW_LINE>// Local file? Then we need to upload it to S3.<NEW_LINE>if (!staging.isPresent()) {<NEW_LINE>throw new ConfigException("Please configure a S3 'staging' directory");<NEW_LINE>}<NEW_LINE>String baseKey = staging.get().getKey();<NEW_LINE>String key = (baseKey != null ? baseKey : "") + prefix + "/" + reference.filename();<NEW_LINE>builder.s3Uri(new AmazonS3URI("s3://" + staging.get().getBucket() + "/" + key));<NEW_LINE>} else {<NEW_LINE>builder.s3Uri(new AmazonS3URI(reference.reference().get()));<NEW_LINE>}<NEW_LINE>RemoteFile remoteFile = builder.build();<NEW_LINE>if (reference.local()) {<NEW_LINE>files.add(StagingFile.of(template, remoteFile));<NEW_LINE>}<NEW_LINE>return remoteFile;<NEW_LINE>} | + "/" + path + "/" + id; |
738,057 | private void classHeaderExtendsOrImplements(boolean isInterface, boolean isRecord) {<NEW_LINE>if (this.currentElement != null && this.currentToken == TokenNameIdentifier && this.cursorLocation + 1 >= this.scanner.startPosition && this.cursorLocation < this.scanner.currentPosition) {<NEW_LINE>this.pushIdentifier();<NEW_LINE>int index = -1;<NEW_LINE>if (!recoveredType.foundOpeningBrace) {<NEW_LINE>TypeDeclaration type = recoveredType.typeDeclaration;<NEW_LINE>if (!isInterface) {<NEW_LINE>char[][] keywords = new char[Keywords.COUNT][];<NEW_LINE>int count = 0;<NEW_LINE>if (type.superInterfaces == null) {<NEW_LINE>if (!isRecord) {<NEW_LINE>if (type.superclass == null) {<NEW_LINE>keywords[count++] = Keywords.EXTENDS;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>keywords[count++] = Keywords.IMPLEMENTS;<NEW_LINE>}<NEW_LINE>if (this.options.enablePreviewFeatures) {<NEW_LINE>boolean sealed = (type.modifiers & ExtraCompilerModifiers.AccSealed) != 0;<NEW_LINE>if (sealed)<NEW_LINE>keywords[count++] = RestrictedIdentifiers.PERMITS;<NEW_LINE>}<NEW_LINE>System.arraycopy(keywords, 0, keywords = new char[count][], 0, count);<NEW_LINE>if (count > 0) {<NEW_LINE>CompletionOnKeyword1 completionOnKeyword = new CompletionOnKeyword1(this.identifierStack[ptr], this.identifierPositionStack[ptr], keywords);<NEW_LINE>type.superclass = completionOnKeyword;<NEW_LINE>type<MASK><NEW_LINE>this.assistNode = completionOnKeyword;<NEW_LINE>this.lastCheckPoint = completionOnKeyword.sourceEnd + 1;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (type.superInterfaces == null) {<NEW_LINE>CompletionOnKeyword1 completionOnKeyword = new CompletionOnKeyword1(this.identifierStack[ptr], this.identifierPositionStack[ptr], Keywords.EXTENDS);<NEW_LINE>type.superInterfaces = new TypeReference[] { completionOnKeyword };<NEW_LINE>type.superInterfaces[0].bits |= ASTNode.IsSuperType;<NEW_LINE>this.assistNode = completionOnKeyword;<NEW_LINE>this.lastCheckPoint = completionOnKeyword.sourceEnd + 1;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .superclass.bits |= ASTNode.IsSuperType; |
710,848 | final CreateHumanTaskUiResult executeCreateHumanTaskUi(CreateHumanTaskUiRequest createHumanTaskUiRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createHumanTaskUiRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateHumanTaskUiRequest> request = null;<NEW_LINE>Response<CreateHumanTaskUiResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateHumanTaskUiRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createHumanTaskUiRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "SageMaker");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateHumanTaskUi");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateHumanTaskUiResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(<MASK><NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | false), new CreateHumanTaskUiResultJsonUnmarshaller()); |
563,857 | private static Triple<DataSource, DimFilter, List<PreJoinableClause>> flattenJoin(final JoinDataSource dataSource) {<NEW_LINE>DataSource current = dataSource;<NEW_LINE>DimFilter currentDimFilter = null;<NEW_LINE>final List<PreJoinableClause> preJoinableClauses = new ArrayList<>();<NEW_LINE>while (current instanceof JoinDataSource) {<NEW_LINE><MASK><NEW_LINE>current = joinDataSource.getLeft();<NEW_LINE>if (currentDimFilter != null) {<NEW_LINE>throw new IAE("Left filters are only allowed when left child is direct table access");<NEW_LINE>}<NEW_LINE>currentDimFilter = joinDataSource.getLeftFilter();<NEW_LINE>preJoinableClauses.add(new PreJoinableClause(joinDataSource.getRightPrefix(), joinDataSource.getRight(), joinDataSource.getJoinType(), joinDataSource.getConditionAnalysis()));<NEW_LINE>}<NEW_LINE>// Join clauses were added in the order we saw them while traversing down, but we need to apply them in the<NEW_LINE>// going-up order. So reverse them.<NEW_LINE>Collections.reverse(preJoinableClauses);<NEW_LINE>return Triple.of(current, currentDimFilter, preJoinableClauses);<NEW_LINE>} | final JoinDataSource joinDataSource = (JoinDataSource) current; |
1,788,907 | private TreeNode convertMethodDeclaration(ExecutableElement element, AbstractTypeDeclaration node) {<NEW_LINE>MethodDeclaration methodDecl = new MethodDeclaration(element);<NEW_LINE>convertBodyDeclaration(methodDecl, element);<NEW_LINE>HashMap<String, VariableElement> localVariableTable = new HashMap<>();<NEW_LINE>List<SingleVariableDeclaration<MASK><NEW_LINE>String name = element.getSimpleName().toString();<NEW_LINE>String descriptor = getMethodDescriptor(element);<NEW_LINE>if (element.getParameters().size() > 0) {<NEW_LINE>Iterator<ParameterDeclaration> paramsIterator = methodDecl.isConstructor() ? classFile.getConstructor(descriptor).getParameters().iterator() : classFile.getMethod(name, descriptor).getParameters().iterator();<NEW_LINE>// If classfile was compiled with -parameters flag; use the MethodNode<NEW_LINE>// to work around potential javac8 bug iterating over parameter names.<NEW_LINE>for (VariableElement param : element.getParameters()) {<NEW_LINE>SingleVariableDeclaration varDecl = (SingleVariableDeclaration) convert(param, methodDecl);<NEW_LINE>String nameDef = paramsIterator.next().getName();<NEW_LINE>// If element's name doesn't match the ParameterNode's name, use the latter.<NEW_LINE>if (!nameDef.equals(param.getSimpleName().toString())) {<NEW_LINE>param = GeneratedVariableElement.newParameter(nameDef, param.asType(), param.getEnclosingElement());<NEW_LINE>varDecl.setVariableElement(param);<NEW_LINE>}<NEW_LINE>parameters.add(varDecl);<NEW_LINE>localVariableTable.put(param.getSimpleName().toString(), param);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (element.isVarArgs()) {<NEW_LINE>SingleVariableDeclaration lastParam = parameters.get(parameters.size() - 1);<NEW_LINE>TypeMirror paramType = lastParam.getType().getTypeMirror();<NEW_LINE>assert paramType.getKind() == TypeKind.ARRAY;<NEW_LINE>TypeMirror varArgType = ((ArrayType) paramType).getComponentType();<NEW_LINE>lastParam.setType(Type.newType(varArgType));<NEW_LINE>lastParam.setIsVarargs(true);<NEW_LINE>}<NEW_LINE>if (!ElementUtil.isAbstract(element)) {<NEW_LINE>EntityDeclaration decl = methodDecl.isConstructor() ? classFile.getConstructor(descriptor) : classFile.getMethod(name, descriptor);<NEW_LINE>MethodTranslator translator = new MethodTranslator(parserEnv, translationEnv, element, node, localVariableTable);<NEW_LINE>methodDecl.setBody((Block) decl.acceptVisitor(translator, null));<NEW_LINE>}<NEW_LINE>return methodDecl;<NEW_LINE>} | > parameters = methodDecl.getParameters(); |
1,344,475 | public Action onFragment(final DirectBuffer buffer, final int offset, final int length, final Header header) {<NEW_LINE>final long currentPosition = lastMessagePosition;<NEW_LINE>final long index = buffer.getLong(offset + MESSAGE_INDEX_OFFSET, ByteOrder.LITTLE_ENDIAN);<NEW_LINE>if (index != nextMessageIndex) {<NEW_LINE>throw new IllegalStateException(<MASK><NEW_LINE>}<NEW_LINE>if (0 == batchIndex) {<NEW_LINE>final long timestamp = buffer.getLong(offset + TIMESTAMP_OFFSET, ByteOrder.LITTLE_ENDIAN);<NEW_LINE>timestamps.addLong(timestamp);<NEW_LINE>timestampPositions.addLong(currentPosition);<NEW_LINE>indexBuffer.putLong(MESSAGE_INDEX_OFFSET, nextMessageIndex, ByteOrder.LITTLE_ENDIAN);<NEW_LINE>indexBuffer.putLong(TIMESTAMP_OFFSET, timestamp, ByteOrder.LITTLE_ENDIAN);<NEW_LINE>}<NEW_LINE>final int positionOffset = HEADER_LENGTH + (batchIndex * SIZE_OF_LONG);<NEW_LINE>indexBuffer.putLong(positionOffset, currentPosition, ByteOrder.LITTLE_ENDIAN);<NEW_LINE>if (++batchIndex >= BATCH_SIZE) {<NEW_LINE>if (publication.offer(indexBuffer, 0, INDEX_BUFFER_CAPACITY) <= 0) {<NEW_LINE>--batchIndex;<NEW_LINE>return Action.ABORT;<NEW_LINE>}<NEW_LINE>batchIndex = 0;<NEW_LINE>}<NEW_LINE>messagePositions.addLong(currentPosition);<NEW_LINE>lastMessagePosition = header.position();<NEW_LINE>++nextMessageIndex;<NEW_LINE>return Action.CONTINUE;<NEW_LINE>} | "invalid index: expected=" + nextMessageIndex + " actual=" + index); |
1,703,449 | void updateIcon() {<NEW_LINE>final Object priorIcon = fFrame.getClientProperty(CACHED_FRAME_ICON_KEY);<NEW_LINE>if (priorIcon instanceof ImageIcon) {<NEW_LINE>setIcon((ImageIcon) priorIcon);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int width = fFrame.getWidth();<NEW_LINE>int height = fFrame.getHeight();<NEW_LINE>// Protect us from unsized frames, like in JCK test DefaultDesktopManager2008<NEW_LINE>if (width <= 0 || height <= 0) {<NEW_LINE>width = 128;<NEW_LINE>height = 128;<NEW_LINE>}<NEW_LINE>final Image fImage = new BufferedImage(<MASK><NEW_LINE>final Graphics g = fImage.getGraphics();<NEW_LINE>fFrame.paint(g);<NEW_LINE>g.dispose();<NEW_LINE>final float scale = (float) fDesktopIcon.getWidth() / (float) Math.max(width, height) * 0.89f;<NEW_LINE>// Sending in -1 for width xor height causes it to maintain aspect ratio<NEW_LINE>final ImageIcon icon = new ImageIcon(fImage.getScaledInstance((int) (width * scale), -1, Image.SCALE_SMOOTH));<NEW_LINE>fFrame.putClientProperty(CACHED_FRAME_ICON_KEY, icon);<NEW_LINE>setIcon(icon);<NEW_LINE>} | width, height, BufferedImage.TYPE_INT_ARGB_PRE); |
845,539 | private static <T> ImmutableSet<Class<? extends T>> providerClassesFromUrl(URL resourceUrl, Class<? extends T> service, ClassLoader loader, Optional<Pattern> allowedMissingClasses) throws IOException {<NEW_LINE>ImmutableSet.Builder<Class<? extends T>> providerClasses = ImmutableSet.builder();<NEW_LINE>URLConnection urlConnection = resourceUrl.openConnection();<NEW_LINE>urlConnection.setUseCaches(false);<NEW_LINE>List<String> lines;<NEW_LINE>try (<MASK><NEW_LINE>BufferedReader reader = new BufferedReader(new InputStreamReader(in, UTF_8))) {<NEW_LINE>lines = reader.lines().collect(toList());<NEW_LINE>}<NEW_LINE>List<String> classNames = lines.stream().map(SimpleServiceLoader::parseClassName).flatMap(Streams::stream).collect(toList());<NEW_LINE>for (String className : classNames) {<NEW_LINE>Class<?> c;<NEW_LINE>try {<NEW_LINE>c = Class.forName(className, false, loader);<NEW_LINE>} catch (ClassNotFoundException e) {<NEW_LINE>if (allowedMissingClasses.isPresent() && allowedMissingClasses.get().matcher(className).matches()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>throw new ServiceConfigurationError("Could not load " + className, e);<NEW_LINE>}<NEW_LINE>if (!service.isAssignableFrom(c)) {<NEW_LINE>throw new ServiceConfigurationError("Class " + className + " is not assignable to " + service.getName());<NEW_LINE>}<NEW_LINE>providerClasses.add(c.asSubclass(service));<NEW_LINE>}<NEW_LINE>return providerClasses.build();<NEW_LINE>} | InputStream in = urlConnection.getInputStream(); |
767,369 | private void serializeColumn(int position, final CharSequence token) throws SqlException {<NEW_LINE>if (!predicateContext.isActive()) {<NEW_LINE>throw SqlException.position(position).put("non-boolean column outside of predicate: ").put(token);<NEW_LINE>}<NEW_LINE>final int <MASK><NEW_LINE>if (index == -1) {<NEW_LINE>throw SqlException.invalidColumn(position, token);<NEW_LINE>}<NEW_LINE>final int columnType = metadata.getColumnType(index);<NEW_LINE>final int columnTypeTag = ColumnType.tagOf(columnType);<NEW_LINE>int typeCode = columnTypeCode(columnTypeTag);<NEW_LINE>if (typeCode == UNDEFINED_CODE) {<NEW_LINE>throw SqlException.position(position).put("unsupported column type: ").put(ColumnType.nameOf(columnTypeTag));<NEW_LINE>}<NEW_LINE>// In case of a top level boolean column, expand it to "boolean_column = true" expression.<NEW_LINE>if (predicateContext.singleBooleanColumn && columnTypeTag == ColumnType.BOOLEAN) {<NEW_LINE>// "true" constant<NEW_LINE>putOperand(IMM, I1_TYPE, 1);<NEW_LINE>// column<NEW_LINE>putOperand(MEM, typeCode, index);<NEW_LINE>// =<NEW_LINE>putOperator(EQ);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>putOperand(MEM, typeCode, index);<NEW_LINE>} | index = metadata.getColumnIndexQuiet(token); |
94,032 | public static QuerySavingsPlansDeductLogResponse unmarshall(QuerySavingsPlansDeductLogResponse querySavingsPlansDeductLogResponse, UnmarshallerContext _ctx) {<NEW_LINE>querySavingsPlansDeductLogResponse.setRequestId(_ctx.stringValue("QuerySavingsPlansDeductLogResponse.RequestId"));<NEW_LINE>querySavingsPlansDeductLogResponse.setCode(_ctx.stringValue("QuerySavingsPlansDeductLogResponse.Code"));<NEW_LINE>querySavingsPlansDeductLogResponse.setMessage(_ctx.stringValue("QuerySavingsPlansDeductLogResponse.Message"));<NEW_LINE>querySavingsPlansDeductLogResponse.setSuccess(_ctx.booleanValue("QuerySavingsPlansDeductLogResponse.Success"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setPageNum(_ctx.integerValue("QuerySavingsPlansDeductLogResponse.Data.PageNum"));<NEW_LINE>data.setPageSize(_ctx.integerValue("QuerySavingsPlansDeductLogResponse.Data.PageSize"));<NEW_LINE>data.setTotalCount(_ctx.integerValue("QuerySavingsPlansDeductLogResponse.Data.TotalCount"));<NEW_LINE>List<SavingsPlansDeductDetailResponse> items = new ArrayList<SavingsPlansDeductDetailResponse>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("QuerySavingsPlansDeductLogResponse.Data.Items.Length"); i++) {<NEW_LINE>SavingsPlansDeductDetailResponse savingsPlansDeductDetailResponse = new SavingsPlansDeductDetailResponse();<NEW_LINE>savingsPlansDeductDetailResponse.setEndTime(_ctx.stringValue("QuerySavingsPlansDeductLogResponse.Data.Items[" + i + "].EndTime"));<NEW_LINE>savingsPlansDeductDetailResponse.setStartTime(_ctx.stringValue("QuerySavingsPlansDeductLogResponse.Data.Items[" + i + "].StartTime"));<NEW_LINE>savingsPlansDeductDetailResponse.setSavingsType(_ctx.stringValue("QuerySavingsPlansDeductLogResponse.Data.Items[" + i + "].SavingsType"));<NEW_LINE>savingsPlansDeductDetailResponse.setUserId(_ctx.longValue("QuerySavingsPlansDeductLogResponse.Data.Items[" + i + "].UserId"));<NEW_LINE>savingsPlansDeductDetailResponse.setDiscountRate(_ctx.stringValue("QuerySavingsPlansDeductLogResponse.Data.Items[" + i + "].DiscountRate"));<NEW_LINE>savingsPlansDeductDetailResponse.setBillModule(_ctx.stringValue("QuerySavingsPlansDeductLogResponse.Data.Items[" + i + "].BillModule"));<NEW_LINE>savingsPlansDeductDetailResponse.setInstanceId(_ctx.stringValue("QuerySavingsPlansDeductLogResponse.Data.Items[" + i + "].InstanceId"));<NEW_LINE>savingsPlansDeductDetailResponse.setDeductInstanceId(_ctx.stringValue("QuerySavingsPlansDeductLogResponse.Data.Items[" + i + "].DeductInstanceId"));<NEW_LINE>savingsPlansDeductDetailResponse.setDeductCommodity(_ctx.stringValue<MASK><NEW_LINE>savingsPlansDeductDetailResponse.setDeductRate(_ctx.stringValue("QuerySavingsPlansDeductLogResponse.Data.Items[" + i + "].DeductRate"));<NEW_LINE>savingsPlansDeductDetailResponse.setDeductFee(_ctx.stringValue("QuerySavingsPlansDeductLogResponse.Data.Items[" + i + "].DeductFee"));<NEW_LINE>items.add(savingsPlansDeductDetailResponse);<NEW_LINE>}<NEW_LINE>data.setItems(items);<NEW_LINE>querySavingsPlansDeductLogResponse.setData(data);<NEW_LINE>return querySavingsPlansDeductLogResponse;<NEW_LINE>} | ("QuerySavingsPlansDeductLogResponse.Data.Items[" + i + "].DeductCommodity")); |
994,043 | final DescribeApplicationVersionResult executeDescribeApplicationVersion(DescribeApplicationVersionRequest describeApplicationVersionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeApplicationVersionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<DescribeApplicationVersionRequest> request = null;<NEW_LINE>Response<DescribeApplicationVersionResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeApplicationVersionRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeApplicationVersionRequest));<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, "Kinesis Analytics V2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeApplicationVersion");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeApplicationVersionResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeApplicationVersionResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.startEvent(Field.ClientExecuteTime); |
1,067,521 | public Status update(String table, String key, Map<String, ByteIterator> values) {<NEW_LINE>if (debug) {<NEW_LINE>System.out.println("Setting up put for key: " + key);<NEW_LINE>}<NEW_LINE>setTable(table);<NEW_LINE>final MutateRowRequest.Builder rowMutation = MutateRowRequest.newBuilder();<NEW_LINE>rowMutation.setRowKey(ByteString.copyFromUtf8(key));<NEW_LINE>rowMutation.setTableNameBytes(ByteStringer.wrap(lastTableBytes));<NEW_LINE>for (final Entry<String, ByteIterator> entry : values.entrySet()) {<NEW_LINE>final Mutation.<MASK><NEW_LINE>final SetCell.Builder setCellBuilder = mutationBuilder.getSetCellBuilder();<NEW_LINE>setCellBuilder.setFamilyNameBytes(ByteStringer.wrap(columnFamilyBytes));<NEW_LINE>setCellBuilder.setColumnQualifier(ByteStringer.wrap(entry.getKey().getBytes()));<NEW_LINE>setCellBuilder.setValue(ByteStringer.wrap(entry.getValue().toArray()));<NEW_LINE>// Bigtable uses a 1ms granularity<NEW_LINE>setCellBuilder.setTimestampMicros(System.currentTimeMillis() * 1000);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>if (clientSideBuffering) {<NEW_LINE>bulkMutation.add(rowMutation.build());<NEW_LINE>} else {<NEW_LINE>client.mutateRow(rowMutation.build());<NEW_LINE>}<NEW_LINE>return Status.OK;<NEW_LINE>} catch (RuntimeException e) {<NEW_LINE>System.err.println("Failed to insert key: " + key + " " + e.getMessage());<NEW_LINE>return Status.ERROR;<NEW_LINE>}<NEW_LINE>} | Builder mutationBuilder = rowMutation.addMutationsBuilder(); |
392,731 | public I_C_Queue_WorkPackage enqueueWorkPackage(@NonNull final I_C_Queue_WorkPackage workPackage, @NonNull final IWorkpackagePrioStrategy priority) {<NEW_LINE>// TODO: please really consider to move this method somewhere inside de.metas.async.api.impl.WorkPackageBuilder.build()<NEW_LINE>workPackage.setProcessed(false);<NEW_LINE>workPackage.setIsReadyForProcessing(false);<NEW_LINE>if (priority == NullWorkpackagePrio.INSTANCE) {<NEW_LINE>final String priorityDefault = getPriorityForNewWorkpackage(PRIORITY_AUTO);<NEW_LINE>workPackage.setPriority(priorityDefault);<NEW_LINE>} else {<NEW_LINE>final String priorityStr = getPriorityForNewWorkpackage(priority);<NEW_LINE>workPackage.setPriority(priorityStr);<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// C_Async_Batch_ID - get it from context if available<NEW_LINE>// set only if is not new workpackage; the first new one is always for the async batch itself and we do want to track it<NEW_LINE>if (!asyncBatchForNewWorkpackagesSet) {<NEW_LINE>final AsyncBatchId asyncBatchId = getAsyncBatchIdForNewWorkpackage();<NEW_LINE>workPackage.setC_Async_Batch_ID(AsyncBatchId.toRepoId(asyncBatchId));<NEW_LINE>}<NEW_LINE>// increase enqueued counter<NEW_LINE>final int enqueuedCount = asyncBatchBL.increaseEnqueued(workPackage);<NEW_LINE>workPackage.setBatchEnqueuedCount(enqueuedCount);<NEW_LINE>// Set User/Role<NEW_LINE>workPackage.setAD_User_ID(Env.getAD_User_ID(ctx));<NEW_LINE>workPackage.setAD_Role_ID(Env.getAD_Role_ID(ctx));<NEW_LINE>// task 09700<NEW_LINE>final UserId userIdInCharge = workPackageBL.getUserIdInCharge<MASK><NEW_LINE>if (userIdInCharge != null) {<NEW_LINE>workPackage.setAD_User_InCharge_ID(userIdInCharge.getRepoId());<NEW_LINE>}<NEW_LINE>saveWorkPackage(workPackage);<NEW_LINE>// task 09049<NEW_LINE>localPackagecount++;<NEW_LINE>//<NEW_LINE>// Statistics<NEW_LINE>final I_C_Queue_PackageProcessor queuePackageProcessor = queueProcessorDAO.getPackageProcessor(QueuePackageProcessorId.ofRepoId(workPackage.getC_Queue_PackageProcessor_ID()));<NEW_LINE>final IMutableQueueProcessorStatistics workpackageProcessorStatistics = workpackageProcessorFactory.getWorkpackageProcessorStatistics(queuePackageProcessor);<NEW_LINE>workpackageProcessorStatistics.incrementQueueSize();<NEW_LINE>return workPackage;<NEW_LINE>} | (workPackage).orElse(null); |
588,862 | // The phase concept please refer to AggregateInfo::AggPhase<NEW_LINE>private LogicalAggregationOperator createDistinctAggForFirstPhase(ColumnRefFactory columnRefFactory, List<ColumnRefOperator> groupKeys, Map<ColumnRefOperator, CallOperator> aggregationMap, AggType type) {<NEW_LINE>Set<ColumnRefOperator> newGroupKeys = Sets.newHashSet(groupKeys);<NEW_LINE>Map<ColumnRefOperator, CallOperator> localAggMap = Maps.newHashMap();<NEW_LINE>for (Map.Entry<ColumnRefOperator, CallOperator> entry : aggregationMap.entrySet()) {<NEW_LINE>ColumnRefOperator column = entry.getKey();<NEW_LINE>CallOperator aggregation = entry.getValue();<NEW_LINE>// Add distinct column to group by column<NEW_LINE>if (aggregation.isDistinct()) {<NEW_LINE>for (int i = 0; i < aggregation.getUsedColumns().cardinality(); ++i) {<NEW_LINE>newGroupKeys.add(columnRefFactory.getColumnRef(aggregation.getUsedColumns().getColumnIds()[i]));<NEW_LINE>}<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Type intermediateType = getIntermediateType(aggregation);<NEW_LINE>CallOperator callOperator;<NEW_LINE>if (!type.isLocal()) {<NEW_LINE>callOperator = new CallOperator(aggregation.getFnName(), aggregation.getType(), Lists.newArrayList(new ColumnRefOperator(column.getId(), aggregation.getType(), column.getName(), aggregation.isNullable())<MASK><NEW_LINE>} else {<NEW_LINE>callOperator = new CallOperator(aggregation.getFnName(), intermediateType, aggregation.getChildren(), aggregation.getFunction());<NEW_LINE>}<NEW_LINE>localAggMap.put(new ColumnRefOperator(column.getId(), intermediateType, column.getName(), column.isNullable()), callOperator);<NEW_LINE>}<NEW_LINE>return new LogicalAggregationOperator(type, Lists.newArrayList(newGroupKeys), localAggMap);<NEW_LINE>} | ), aggregation.getFunction()); |
948,114 | public static PropertiesResolver create(Configuration configuration, PropertiesDelegate delegate) {<NEW_LINE>return new PropertiesResolver() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public <T> T resolveProperty(String name, Class<T> type) {<NEW_LINE>return resolveProperty(name, null, type);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>public <T> T resolveProperty(String name, T defaultValue) {<NEW_LINE>return resolveProperty(name, defaultValue, (Class<T>) defaultValue.getClass());<NEW_LINE>}<NEW_LINE><NEW_LINE>private <T> T resolveProperty(final String name, Object defaultValue, final Class<T> type) {<NEW_LINE>// Check runtime configuration first<NEW_LINE>Object result = configuration.getProperty(name);<NEW_LINE>if (result != null) {<NEW_LINE>defaultValue = result;<NEW_LINE>}<NEW_LINE>// Check request properties next<NEW_LINE><MASK><NEW_LINE>if (result == null) {<NEW_LINE>result = defaultValue;<NEW_LINE>}<NEW_LINE>return (result == null) ? null : PropertiesHelper.convertValue(result, type);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>} | result = delegate.getProperty(name); |
1,358,946 | private int forwardMedia(data.media.Media media, FlatBufferBuilder fbb) {<NEW_LINE>int uri = fbb.createString(media.uri);<NEW_LINE>int title = media.title != null ? fbb.createString(media.title) : 0;<NEW_LINE>int format = fbb.createString(media.format);<NEW_LINE>int[] persons = new int[media.persons.size()];<NEW_LINE>for (int i = 0; i < media.persons.size(); i++) {<NEW_LINE>persons[i] = fbb.createString(media.persons.get(i));<NEW_LINE>}<NEW_LINE>int person = Media.createPersonsVector(fbb, persons);<NEW_LINE>byte <MASK><NEW_LINE>int copyright = media.copyright != null ? fbb.createString(media.copyright) : 0;<NEW_LINE>return Media.createMedia(fbb, uri, title, media.width, media.height, format, media.duration, media.size, media.bitrate, person, player, copyright);<NEW_LINE>} | player = forwardPlayer(media.player); |
368,694 | public AccountEnrollmentStatus unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>AccountEnrollmentStatus accountEnrollmentStatus = new AccountEnrollmentStatus();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("accountId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>accountEnrollmentStatus.setAccountId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("status", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>accountEnrollmentStatus.setStatus(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("statusReason", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>accountEnrollmentStatus.setStatusReason(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("lastUpdatedTimestamp", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>accountEnrollmentStatus.setLastUpdatedTimestamp(DateJsonUnmarshallerFactory.getInstance("unixTimestamp").unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return accountEnrollmentStatus;<NEW_LINE>} | String currentParentElement = context.getCurrentParentElement(); |
1,386,647 | public VersionedCatalog loadDefaultCatalog(final String uriString) throws CatalogApiException {<NEW_LINE>try {<NEW_LINE>final List<URI> xmlURIs;<NEW_LINE>if (uriString.endsWith(XML_EXTENSION)) {<NEW_LINE>// Assume its an xml file<NEW_LINE>xmlURIs = new ArrayList<URI>();<NEW_LINE>xmlURIs.add(new URI(uriString));<NEW_LINE>} else {<NEW_LINE>// Assume its a directory<NEW_LINE>final URL url = getURLFromString(uriString);<NEW_LINE>final String directoryContents = UriAccessor.accessUriAsString(uriString);<NEW_LINE>xmlURIs = findXmlReferences(directoryContents, url);<NEW_LINE>}<NEW_LINE>final DefaultVersionedCatalog result = new DefaultVersionedCatalog();<NEW_LINE>for (final URI u : xmlURIs) {<NEW_LINE>final StandaloneCatalog catalog = XMLLoader.getObjectFromUri(u, StandaloneCatalog.class);<NEW_LINE>result.add(new StandaloneCatalogWithPriceOverride(catalog, priceOverride, InternalCallContextFactory.INTERNAL_TENANT_RECORD_ID, internalCallContextFactory));<NEW_LINE>}<NEW_LINE>// Perform initialization and validation for VersionedCatalog<NEW_LINE>XMLLoader.initializeAndValidate(result);<NEW_LINE>return result;<NEW_LINE>} catch (final ValidationException e) {<NEW_LINE>logger.warn("Failed to load default catalog", e);<NEW_LINE>throw new CatalogApiException(e, ErrorCode.CAT_INVALID_DEFAULT, uriString);<NEW_LINE>} catch (final JAXBException e) {<NEW_LINE><MASK><NEW_LINE>throw new CatalogApiException(e, ErrorCode.CAT_INVALID_DEFAULT, uriString);<NEW_LINE>} catch (IllegalArgumentException e) {<NEW_LINE>logger.warn("Failed to load default catalog", e);<NEW_LINE>throw new CatalogApiException(e, ErrorCode.CAT_INVALID_DEFAULT, uriString);<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.warn("Failed to load default catalog", e);<NEW_LINE>throw new IllegalStateException(e);<NEW_LINE>}<NEW_LINE>} | logger.warn("Failed to load default catalog", e); |
1,197,466 | public void onRecordingDescriptor(final long controlSessionId, final long correlationId, final long recordingId, final long startTimestamp, final long stopTimestamp, final long startPosition, final long stopPosition, final int initialTermId, final int segmentFileLength, final int termBufferLength, final int mtuLength, final int sessionId, final int streamId, final String strippedChannel, final String originalChannel, final String sourceIdentity) {<NEW_LINE>srcStopPosition = stopPosition;<NEW_LINE>replayStreamId = streamId;<NEW_LINE>replaySessionId = sessionId;<NEW_LINE>if (NULL_VALUE == dstRecordingId) {<NEW_LINE>replayPosition = startPosition;<NEW_LINE>dstRecordingId = catalog.addNewRecording(startPosition, startPosition, startTimestamp, startTimestamp, initialTermId, segmentFileLength, termBufferLength, mtuLength, sessionId, <MASK><NEW_LINE>signal(startPosition, REPLICATE);<NEW_LINE>}<NEW_LINE>State nextState = State.EXTEND;<NEW_LINE>if (null != liveDestination) {<NEW_LINE>if (NULL_POSITION != stopPosition) {<NEW_LINE>state(State.DONE);<NEW_LINE>error("cannot live merge without active source recording", ArchiveException.GENERIC);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>nextState = State.SRC_RECORDING_POSITION;<NEW_LINE>}<NEW_LINE>if (startPosition == stopPosition || (NULL_VALUE != dstRecordingId && stopPosition == catalog.stopPosition(dstRecordingId))) {<NEW_LINE>signal(stopPosition, SYNC);<NEW_LINE>nextState = State.DONE;<NEW_LINE>}<NEW_LINE>state(nextState);<NEW_LINE>} | streamId, strippedChannel, originalChannel, sourceIdentity); |
1,271,248 | // may 5.0<NEW_LINE>private static void checkSupportForArtMethod() throws Exception {<NEW_LINE>try {<NEW_LINE>dexMethodIndexField = getField(artMethodClass, "dexMethodIndex");<NEW_LINE>} catch (NoSuchFieldException e) {<NEW_LINE>// may 4.4<NEW_LINE>dexMethodIndexField = getField(artMethodClass, "methodDexIndex");<NEW_LINE>}<NEW_LINE>dexCacheField = <MASK><NEW_LINE>Object dexCache = dexCacheField.get(testMethod.getDeclaringClass());<NEW_LINE>resolvedMethodsField = getField(dexCache.getClass(), "resolvedMethods");<NEW_LINE>if (resolvedMethodsField.get(dexCache) instanceof Object[]) {<NEW_LINE>canResolvedInJava = true;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>try {<NEW_LINE>dexMethodIndex = (int) dexMethodIndexField.get(testArtMethod);<NEW_LINE>} catch (Throwable e) {<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>fieldEntryPointFromCompiledCode = getField(artMethodClass, "entryPointFromQuickCompiledCode");<NEW_LINE>} catch (Throwable e) {<NEW_LINE>fieldEntryPointFromCompiledCode = getField(artMethodClass, "entryPointFromCompiledCode");<NEW_LINE>}<NEW_LINE>if (fieldEntryPointFromCompiledCode.getType() == int.class) {<NEW_LINE>entryPointFromCompiledCode = fieldEntryPointFromCompiledCode.getInt(testArtMethod);<NEW_LINE>} else if (fieldEntryPointFromCompiledCode.getType() == long.class) {<NEW_LINE>entryPointFromCompiledCode = fieldEntryPointFromCompiledCode.getLong(testArtMethod);<NEW_LINE>}<NEW_LINE>fieldEntryPointFromInterpreter = getField(artMethodClass, "entryPointFromInterpreter");<NEW_LINE>if (fieldEntryPointFromInterpreter.getType() == int.class) {<NEW_LINE>entryPointFromInterpreter = fieldEntryPointFromInterpreter.getInt(testArtMethod);<NEW_LINE>} else if (fieldEntryPointFromCompiledCode.getType() == long.class) {<NEW_LINE>entryPointFromInterpreter = fieldEntryPointFromInterpreter.getLong(testArtMethod);<NEW_LINE>}<NEW_LINE>} catch (Throwable e) {<NEW_LINE>}<NEW_LINE>} | getField(Class.class, "dexCache"); |
812,182 | protected String rrToString() {<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>sb.append(alg);<NEW_LINE>sb.append(" ");<NEW_LINE>if (Options.check("multiline")) {<NEW_LINE>sb.append("(\n\t");<NEW_LINE>}<NEW_LINE>sb.append(timeSigned.getEpochSecond());<NEW_LINE>sb.append(" ");<NEW_LINE>sb.append((int) fudge.getSeconds());<NEW_LINE>sb.append(" ");<NEW_LINE>sb.append(signature.length);<NEW_LINE>if (Options.check("multiline")) {<NEW_LINE>sb.append("\n");<NEW_LINE>sb.append(base64.formatString(signature, 64, "\t", false));<NEW_LINE>} else {<NEW_LINE>sb.append(" ");<NEW_LINE>sb.append(base64.toString(signature));<NEW_LINE>}<NEW_LINE>sb.append(" ");<NEW_LINE>sb.append<MASK><NEW_LINE>sb.append(" ");<NEW_LINE>if (other == null) {<NEW_LINE>sb.append(0);<NEW_LINE>} else {<NEW_LINE>sb.append(other.length);<NEW_LINE>if (Options.check("multiline")) {<NEW_LINE>sb.append("\n\n\n\t");<NEW_LINE>} else {<NEW_LINE>sb.append(" ");<NEW_LINE>}<NEW_LINE>if (error == Rcode.BADTIME) {<NEW_LINE>if (other.length != 6) {<NEW_LINE>sb.append("<invalid BADTIME other data>");<NEW_LINE>} else {<NEW_LINE>long time = ((long) (other[0] & 0xFF) << 40) + ((long) (other[1] & 0xFF) << 32) + ((other[2] & 0xFF) << 24) + ((other[3] & 0xFF) << 16) + ((other[4] & 0xFF) << 8) + (other[5] & 0xFF);<NEW_LINE>sb.append("<server time: ");<NEW_LINE>sb.append(Instant.ofEpochSecond(time));<NEW_LINE>sb.append(">");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>sb.append("<");<NEW_LINE>sb.append(base64.toString(other));<NEW_LINE>sb.append(">");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (Options.check("multiline")) {<NEW_LINE>sb.append(" )");<NEW_LINE>}<NEW_LINE>return sb.toString();<NEW_LINE>} | (Rcode.TSIGstring(error)); |
341,297 | public void validateConverters(Element element, ElementValidation valid) {<NEW_LINE>TypeMirror httpMessageConverterType = annotationHelper.<MASK><NEW_LINE>TypeMirror httpMessageConverterTypeErased = annotationHelper.getTypeUtils().erasure(httpMessageConverterType);<NEW_LINE>List<DeclaredType> converters = annotationHelper.extractAnnotationClassArrayParameter(element, annotationHelper.getTarget(), "converters");<NEW_LINE>if (converters == null || converters.isEmpty()) {<NEW_LINE>valid.addError(element, "At least one converter is required");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (DeclaredType converterType : converters) {<NEW_LINE>TypeMirror erasedConverterType = annotationHelper.getTypeUtils().erasure(converterType);<NEW_LINE>if (annotationHelper.isSubtype(erasedConverterType, httpMessageConverterTypeErased)) {<NEW_LINE>Element converterElement = converterType.asElement();<NEW_LINE>if (converterElement.getKind().isClass()) {<NEW_LINE>if (!annotationHelper.isAbstract(converterElement)) {<NEW_LINE>if (converterElement.getAnnotation(EBean.class) == null) {<NEW_LINE>List<ExecutableElement> constructors = ElementFilter.constructorsIn(converterElement.getEnclosedElements());<NEW_LINE>boolean hasPublicWithNoArgumentConstructor = false;<NEW_LINE>for (ExecutableElement constructor : constructors) {<NEW_LINE>if (annotationHelper.isPublic(constructor) && constructor.getParameters().isEmpty()) {<NEW_LINE>hasPublicWithNoArgumentConstructor = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!hasPublicWithNoArgumentConstructor) {<NEW_LINE>valid.addError("The converter class must have a public no argument constructor");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>typeIsValid(EBean.class, converterType, valid);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>valid.addError("The converter class must not be abstract");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>valid.addError("The converter class must be a class");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>valid.addError("The converter class must be a subtype of " + HTTP_MESSAGE_CONVERTER);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | typeElementFromQualifiedName(HTTP_MESSAGE_CONVERTER).asType(); |
1,284,671 | private void processMethods(DexHeader header, TaskMonitor monitor, MessageLog log) throws Exception {<NEW_LINE>monitor.setMessage("DEX: processing methods");<NEW_LINE>monitor.setMaximum(header.getMethodIdsSize());<NEW_LINE>monitor.setProgress(0);<NEW_LINE>Address address = baseAddress.add(header.getMethodIdsOffset());<NEW_LINE>int methodIndex = 0;<NEW_LINE>for (MethodIDItem item : header.getMethods()) {<NEW_LINE>monitor.checkCanceled();<NEW_LINE>monitor.incrementProgress(1);<NEW_LINE>DataType dataType = item.toDataType();<NEW_LINE>api.createData(address, dataType);<NEW_LINE>fragmentManager.methodsAddressSet.add(address, address.add(dataType.getLength() - 1));<NEW_LINE>StringBuilder builder = new StringBuilder();<NEW_LINE>builder.append("Method Index: 0x" + Integer.toHexString(methodIndex) + "\n");<NEW_LINE>builder.append("Class: " + DexUtil.convertTypeIndexToString(header, item.getClassIndex()) + "\n");<NEW_LINE>builder.append("Prototype: " + DexUtil.convertPrototypeIndexToString(header, item.getProtoIndex()) + "\n");<NEW_LINE>builder.append("Name: " + DexUtil.convertToString(header, item.getNameIndex()) + "\n");<NEW_LINE>api.setPlateComment(<MASK><NEW_LINE>Address methodIndexAddress = DexUtil.toLookupAddress(program, methodIndex);<NEW_LINE>if (program.getMemory().getInt(methodIndexAddress) == -1) {<NEW_LINE>// Add placeholder symbol for external functions<NEW_LINE>String methodName = DexUtil.convertToString(header, item.getNameIndex());<NEW_LINE>String className = DexUtil.convertTypeIndexToString(header, item.getClassIndex());<NEW_LINE>Namespace classNameSpace = DexUtil.createNameSpaceFromMangledClassName(program, className);<NEW_LINE>if (classNameSpace != null) {<NEW_LINE>Address externalAddress = DexUtil.toLookupAddress(program, methodIndex);<NEW_LINE>Symbol methodSymbol = createMethodSymbol(externalAddress, methodName, classNameSpace, log);<NEW_LINE>if (methodSymbol != null) {<NEW_LINE>String externalName = methodSymbol.getName(true);<NEW_LINE>program.getReferenceManager().addExternalReference(methodIndexAddress, "EXTERNAL.dex-" + methodIndex, externalName, null, SourceType.ANALYSIS, 0, RefType.DATA);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>api.createData(methodIndexAddress, new PointerDataType());<NEW_LINE>++methodIndex;<NEW_LINE>address = address.add(dataType.getLength());<NEW_LINE>}<NEW_LINE>} | address, builder.toString()); |
51,911 | private void readMimeTypesFromLoaders() {<NEW_LINE>// NOI18N<NEW_LINE>FileObject[] children = FileUtil.getConfigFile("Loaders").getChildren();<NEW_LINE>for (int i = 0; i < children.length; i++) {<NEW_LINE>FileObject child = children[i];<NEW_LINE>String mime1 = child.getNameExt();<NEW_LINE>FileObject[] subchildren = child.getChildren();<NEW_LINE>for (int j = 0; j < subchildren.length; j++) {<NEW_LINE>FileObject subchild = subchildren[j];<NEW_LINE>// NOI18N<NEW_LINE>FileObject factoriesFO = subchild.getFileObject("Factories");<NEW_LINE>if (factoriesFO != null && factoriesFO.getChildren().length > 0) {<NEW_LINE>// add only MIME types where some loader exists<NEW_LINE>// NOI18N<NEW_LINE>mimeTypes.add(mime1 + <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// NOI18N<NEW_LINE>mimeTypes.remove("content/unknown");<NEW_LINE>} | "/" + subchild.getNameExt()); |
1,654,799 | private void proposeNewMethod(char[] token, ReferenceBinding reference) {<NEW_LINE>if (!this.requestor.isIgnored(CompletionProposal.POTENTIAL_METHOD_DECLARATION)) {<NEW_LINE>int relevance = computeBaseRelevance();<NEW_LINE>relevance += computeRelevanceForResolution();<NEW_LINE>relevance += computeRelevanceForInterestingProposal();<NEW_LINE>// no access restriction for new method<NEW_LINE>relevance += computeRelevanceForRestrictions(IAccessRule.K_ACCESSIBLE);<NEW_LINE>InternalCompletionProposal proposal = createProposal(CompletionProposal.POTENTIAL_METHOD_DECLARATION, this.actualCompletionPosition);<NEW_LINE>proposal.setDeclarationSignature(getSignature(reference));<NEW_LINE>proposal.setSignature(createMethodSignature(CharOperation.NO_CHAR_CHAR, CharOperation.NO_CHAR_CHAR, CharOperation.NO_CHAR, VOID));<NEW_LINE>proposal.setDeclarationPackageName(reference.qualifiedPackageName());<NEW_LINE>proposal.<MASK><NEW_LINE>// proposal.setPackageName(null);<NEW_LINE>proposal.setTypeName(VOID);<NEW_LINE>proposal.setName(token);<NEW_LINE>// proposal.setParameterPackageNames(null);<NEW_LINE>// proposal.setParameterTypeNames(null);<NEW_LINE>// proposal.setPackageName(null);<NEW_LINE>proposal.setCompletion(token);<NEW_LINE>proposal.setFlags(Flags.AccPublic);<NEW_LINE>proposal.setReplaceRange(this.startPosition - this.offset, this.endPosition - this.offset);<NEW_LINE>proposal.setTokenRange(this.tokenStart - this.offset, this.tokenEnd - this.offset);<NEW_LINE>proposal.setRelevance(relevance);<NEW_LINE>this.requestor.accept(proposal);<NEW_LINE>if (DEBUG) {<NEW_LINE>this.printDebug(proposal);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | setDeclarationTypeName(reference.qualifiedSourceName()); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.