idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
940,356 | public boolean isValid() {<NEW_LINE>if (!super.isValid())<NEW_LINE>return false;<NEW_LINE>Document document = PsiDocumentManager.getInstance(getProject()<MASK><NEW_LINE>if (document == null) {<NEW_LINE>myCachedResult = null;<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Boolean cachedResult = myCachedResult;<NEW_LINE>if (document.getModificationStamp() == myTimestamp && cachedResult != null) {<NEW_LINE>return cachedResult;<NEW_LINE>}<NEW_LINE>myTimestamp = document.getModificationStamp();<NEW_LINE>Segment segment = getSegment();<NEW_LINE>if (segment == null) {<NEW_LINE>myCachedResult = false;<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>VirtualFile file = getPsiFile().getVirtualFile();<NEW_LINE>Segment searchOffset;<NEW_LINE>if (myAnchor != null) {<NEW_LINE>searchOffset = myAnchor.getRange();<NEW_LINE>if (searchOffset == null) {<NEW_LINE>myCachedResult = false;<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>searchOffset = segment;<NEW_LINE>}<NEW_LINE>int offset = searchOffset.getStartOffset();<NEW_LINE>Long data = myFindModel.getUserData(ourDocumentTimestampKey);<NEW_LINE>if (data == null || data != myTimestamp) {<NEW_LINE>data = myTimestamp;<NEW_LINE>FindManagerImpl.clearPreviousFindData(myFindModel);<NEW_LINE>}<NEW_LINE>myFindModel.putUserData(ourDocumentTimestampKey, data);<NEW_LINE>FindResult result;<NEW_LINE>do {<NEW_LINE>result = myFindManager.findString(document.getCharsSequence(), offset, myFindModel, file);<NEW_LINE>offset = result.getEndOffset() == offset ? offset + 1 : result.getEndOffset();<NEW_LINE>if (!result.isStringFound()) {<NEW_LINE>myCachedResult = false;<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} while (result.getStartOffset() < segment.getStartOffset());<NEW_LINE>boolean ret = segment.getStartOffset() == result.getStartOffset() && segment.getEndOffset() == result.getEndOffset();<NEW_LINE>myCachedResult = ret;<NEW_LINE>return ret;<NEW_LINE>} | ).getDocument(getPsiFile()); |
203,741 | private void jitWalkResolveMethodFrame_walkD(WalkState walkState) throws CorruptDataException {<NEW_LINE>pendingSendScanCursor = pendingSendScanCursor.sub(1);<NEW_LINE>if (!floatRegistersRemaining.eq(0)) {<NEW_LINE>UDATA fpParmNumber = new UDATA(J9SW_JIT_FLOAT_ARGUMENT_REGISTER_COUNT).sub(floatRegistersRemaining);<NEW_LINE>if ((walkState.flags & J9_STACKWALK_ITERATE_O_SLOTS) != 0) {<NEW_LINE>try {<NEW_LINE>UDATAPointer fprSave = UDATAPointer.cast(jitFPRParmAddress(walkState, fpParmNumber));<NEW_LINE>if (!J9BuildFlags.env_data64) {<NEW_LINE>WALK_NAMED_I_SLOT(walkState, PointerPointer.cast(fprSave.add(1)), "JIT-sig-reg-");<NEW_LINE>}<NEW_LINE>WALK_NAMED_I_SLOT(walkState, PointerPointer.cast(fprSave), "JIT-sig-reg-");<NEW_LINE>} catch (CorruptDataException ex) {<NEW_LINE>handleOSlotsCorruption(walkState, "JITStackWalker_29_V0", "jitWalkResolveMethodFrame_walkD", ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>if ((walkState.flags & J9_STACKWALK_ITERATE_O_SLOTS) != 0) {<NEW_LINE>try {<NEW_LINE>if (!J9BuildFlags.env_data64) {<NEW_LINE>WALK_NAMED_I_SLOT(walkState, PointerPointer.cast(pendingSendScanCursor.add(1)), "JIT-sig-reg-");<NEW_LINE>}<NEW_LINE>WALK_NAMED_I_SLOT(walkState, PointerPointer.cast(pendingSendScanCursor), "JIT-sig-stk-");<NEW_LINE>} catch (CorruptDataException ex) {<NEW_LINE>handleOSlotsCorruption(walkState, "JITStackWalker_29_V0", "jitWalkResolveMethodFrame_walkD", ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | floatRegistersRemaining = floatRegistersRemaining.sub(1); |
886,667 | public boolean updateProjectTree(final Module[] modules, final ModuleGroup group) {<NEW_LINE>// isn't visible<NEW_LINE>if (myRoot.getChildCount() == 0)<NEW_LINE>return false;<NEW_LINE>final MyNode[] nodes <MASK><NEW_LINE>int i = 0;<NEW_LINE>for (Module module : modules) {<NEW_LINE>MyNode node = findModuleNode(module);<NEW_LINE>LOG.assertTrue(node != null, "Module " + module.getName() + " is not in project.");<NEW_LINE>node.removeFromParent();<NEW_LINE>nodes[i++] = node;<NEW_LINE>}<NEW_LINE>for (final MyNode moduleNode : nodes) {<NEW_LINE>final String[] groupPath = myPlainMode ? null : group != null ? group.getGroupPath() : null;<NEW_LINE>if (groupPath == null || groupPath.length == 0) {<NEW_LINE>addNode(moduleNode, myRoot);<NEW_LINE>} else {<NEW_LINE>final MyNode moduleGroupNode = ModuleGroupUtil.updateModuleGroupPath(new ModuleGroup(groupPath), myRoot, g -> findNodeByObject(myRoot, g), it -> addNode(it.getChild(), it.getParent()), moduleGroup -> {<NEW_LINE>final NamedConfigurable moduleGroupConfigurable = createModuleGroupConfigurable(moduleGroup);<NEW_LINE>return new MyNode(moduleGroupConfigurable, true);<NEW_LINE>});<NEW_LINE>addNode(moduleNode, moduleGroupNode);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>TreeUtil.sort(myRoot, getNodeComparator());<NEW_LINE>((DefaultTreeModel) myTree.getModel()).reload(myRoot);<NEW_LINE>return true;<NEW_LINE>} | = new MyNode[modules.length]; |
873,851 | public static <T extends Prediction> Prediction voteOnFeature(List<T> predictions, double[] weights) {<NEW_LINE>Preconditions.checkArgument(!predictions.isEmpty(), "No predictions");<NEW_LINE>Preconditions.checkArgument(predictions.size() == weights.length, "%s predictions but %s weights?", predictions.<MASK><NEW_LINE>switch(predictions.get(0).getFeatureType()) {<NEW_LINE>case NUMERIC:<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>List<NumericPrediction> numericVotes = (List<NumericPrediction>) predictions;<NEW_LINE>return voteOnNumericFeature(numericVotes, weights);<NEW_LINE>case CATEGORICAL:<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>List<CategoricalPrediction> categoricalVotes = (List<CategoricalPrediction>) predictions;<NEW_LINE>return voteOnCategoricalFeature(categoricalVotes, weights);<NEW_LINE>default:<NEW_LINE>throw new IllegalStateException();<NEW_LINE>}<NEW_LINE>} | size(), weights.length); |
1,105,299 | // Complete the hourglassSum function below.<NEW_LINE>static int hourglassSum(int[][] arr) {<NEW_LINE>int[] sum = new int[16];<NEW_LINE><MASK><NEW_LINE>int k = 0;<NEW_LINE>for (int i = 0; i < arr.length - 2; i++) {<NEW_LINE>for (int j = 0; j < arr[0].length - 2; j++) {<NEW_LINE>sum[k] += arr[i][j] + arr[i][j + 1] + arr[i][j + 2];<NEW_LINE>sum[k] += arr[i + 1][j + 1];<NEW_LINE>sum[k] += arr[i + 2][j] + arr[i + 2][j + 1] + arr[i + 2][j + 2];<NEW_LINE>k++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int max = sum[0];<NEW_LINE>for (int val : sum) if (max < val)<NEW_LINE>max = val;<NEW_LINE>return max;<NEW_LINE>} | Arrays.fill(sum, 0); |
1,684,307 | public static void assignGroupToAppInstance(DateraObject.DateraConnection conn, String group, String appInstance) throws DateraObject.DateraError, UnsupportedEncodingException {<NEW_LINE>DateraObject.InitiatorGroup initiatorGroup = getInitiatorGroup(conn, group);<NEW_LINE>if (initiatorGroup == null) {<NEW_LINE>throw new CloudRuntimeException("Initator group " + group + " not found ");<NEW_LINE>}<NEW_LINE>Map<String, DateraObject.InitiatorGroup> initiatorGroups = getAppInstanceInitiatorGroups(conn, appInstance);<NEW_LINE>if (initiatorGroups == null) {<NEW_LINE>throw new CloudRuntimeException("Initator group not found for appInstnace " + appInstance);<NEW_LINE>}<NEW_LINE>for (DateraObject.InitiatorGroup ig : initiatorGroups.values()) {<NEW_LINE>if (ig.getName().equals(group)) {<NEW_LINE>// already assigned<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>HttpPut url = new HttpPut(generateApiUrl("app_instances", appInstance, "storage_instances", DateraObject.DEFAULT_STORAGE_NAME, "acl_policy", "initiator_groups"));<NEW_LINE>url.setEntity(new StringEntity(gson.toJson(new DateraObject.InitiatorGroup(initiatorGroup.getPath(), DateraObject<MASK><NEW_LINE>executeApiRequest(conn, url);<NEW_LINE>} | .DateraOperation.ADD)))); |
1,437,294 | // processes Topo_graph and removes edges that border faces with good<NEW_LINE>// parentage<NEW_LINE>// If bAllowBrokenFaces is True the function will break face structure for<NEW_LINE>// dissolved faces. Only face parentage will be uasable.<NEW_LINE>void dissolveCommonEdges_() {<NEW_LINE>int visitedEdges = m_topo_graph.createUserIndexForHalfEdges();<NEW_LINE>AttributeStreamOfInt32 edgesToDelete = new AttributeStreamOfInt32(0);<NEW_LINE>// Now extract paths that<NEW_LINE>for (int cluster = m_topo_graph.getFirstCluster(); cluster != -1; cluster = m_topo_graph.getNextCluster(cluster)) {<NEW_LINE>int firstHalfEdge = m_topo_graph.getClusterHalfEdge(cluster);<NEW_LINE>int half_edge = firstHalfEdge;<NEW_LINE>if (firstHalfEdge == -1)<NEW_LINE>continue;<NEW_LINE>do {<NEW_LINE>int visited = m_topo_graph.getHalfEdgeUserIndex(half_edge, visitedEdges);<NEW_LINE>if (visited != 1) {<NEW_LINE>int halfEdgeTwin = m_topo_graph.getHalfEdgeTwin(half_edge);<NEW_LINE>m_topo_graph.setHalfEdgeUserIndex(halfEdgeTwin, visitedEdges, 1);<NEW_LINE>m_topo_graph.<MASK><NEW_LINE>int parentage = m_topo_graph.getHalfEdgeFaceParentage(half_edge);<NEW_LINE>if (isGoodParentage(parentage)) {<NEW_LINE>int twinParentage = m_topo_graph.getHalfEdgeFaceParentage(halfEdgeTwin);<NEW_LINE>if (isGoodParentage(twinParentage)) {<NEW_LINE>// This half_edge pair is a border between two faces<NEW_LINE>// that share the parentage or it is a dangling edge<NEW_LINE>// remember for<NEW_LINE>edgesToDelete.add(half_edge);<NEW_LINE>// subsequent delete<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>half_edge = m_topo_graph.getHalfEdgeNext(m_topo_graph.getHalfEdgeTwin(half_edge));<NEW_LINE>} while (half_edge != firstHalfEdge);<NEW_LINE>}<NEW_LINE>m_topo_graph.deleteUserIndexForHalfEdges(visitedEdges);<NEW_LINE>m_topo_graph.deleteEdgesBreakFaces_(edgesToDelete);<NEW_LINE>} | setHalfEdgeUserIndex(half_edge, visitedEdges, 1); |
874,912 | private void populateTagNameComponents() {<NEW_LINE>// Get the tag names in use for the current case.<NEW_LINE>tagNames = new ArrayList<>();<NEW_LINE>Map<TagName, Boolean> <MASK><NEW_LINE>try {<NEW_LINE>// There may not be a case open when configuring report modules for Command Line execution<NEW_LINE>tagNames = Case.getCurrentCaseThrows().getServices().getTagsManager().getTagNamesInUse();<NEW_LINE>for (TagName tagName : tagNames) {<NEW_LINE>tagsNamesListModel.addElement(tagName);<NEW_LINE>}<NEW_LINE>} catch (TskCoreException ex) {<NEW_LINE>Logger.getLogger(SaveTaggedHashesToHashDbConfigPanel.class.getName()).log(Level.SEVERE, "Failed to get tag names", ex);<NEW_LINE>} catch (NoCurrentCaseException ex) {<NEW_LINE>// There may not be a case open when configuring report modules for Command Line execution<NEW_LINE>if (Case.isCaseOpen()) {<NEW_LINE>Logger.getLogger(SaveTaggedHashesToHashDbConfigPanel.class.getName()).log(Level.SEVERE, "Exception while getting open case.", ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Preserve the previous selections. Note that tagNameSelections is a<NEW_LINE>// LinkedHashMap so that order is preserved and the tagNames and tagNameSelections<NEW_LINE>// containers are "parallel" containers.<NEW_LINE>for (TagName tagName : tagNames) {<NEW_LINE>if (tagNameSelections.get(tagName) != null && Objects.equals(tagNameSelections.get(tagName), Boolean.TRUE)) {<NEW_LINE>updatedTagNameSelections.put(tagName, Boolean.TRUE);<NEW_LINE>} else {<NEW_LINE>updatedTagNameSelections.put(tagName, Boolean.FALSE);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>tagNameSelections = updatedTagNameSelections;<NEW_LINE>} | updatedTagNameSelections = new LinkedHashMap<>(); |
464,939 | Job fillInJob(ResultSet rs, boolean withDate) throws SQLException {<NEW_LINE>Job job = new Job();<NEW_LINE>job.setId(rs.getLong("JOB_ID"));<NEW_LINE>job.setParentId(rs.getLong("PARENT_JOB_ID"));<NEW_LINE>job.setSeq(rs.getInt("JOB_NO"));<NEW_LINE>job.setServer(rs.getString("SERVER"));<NEW_LINE>job.setObjectSchema(rs.getString("OBJECT_SCHEMA"));<NEW_LINE>job.setObjectName(rs.getString("OBJECT_NAME"));<NEW_LINE>job.setNewObjectName(rs.getString("NEW_OBJECT_NAME"));<NEW_LINE>job.setType(JobType.valueOf(rs.getString("JOB_TYPE")));<NEW_LINE>job.setPhase(JobPhase.valueOf(<MASK><NEW_LINE>job.setState(JobState.valueOf(rs.getString("STATE")));<NEW_LINE>job.setPhysicalObjectDone(rs.getString("PHYSICAL_OBJECT_DONE"));<NEW_LINE>job.setProgress(rs.getInt("PROGRESS"));<NEW_LINE>job.setDdlStmt(rs.getString("DDL_STMT"));<NEW_LINE>if (withDate) {<NEW_LINE>long gmtCreated = rs.getLong("GMT_CREATED");<NEW_LINE>long gmtModified = rs.getLong("GMT_MODIFIED");<NEW_LINE>long gmtCurrent = System.currentTimeMillis();<NEW_LINE>job.setGmtCreated(DATE_FORMATTER.format(new Date(gmtCreated)));<NEW_LINE>job.setGmtModified(DATE_FORMATTER.format(new Date(gmtModified)));<NEW_LINE>switch(job.getState()) {<NEW_LINE>case PENDING:<NEW_LINE>case STAGED:<NEW_LINE>case COMPLETED:<NEW_LINE>job.setElapsedTime(gmtModified - gmtCreated);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>job.setElapsedTime(gmtCurrent - gmtCreated);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>job.setRemark(rs.getString("REMARK"));<NEW_LINE>job.setBackfillProgress(rs.getString("RESERVED_GSI_INT"));<NEW_LINE>job.setFlag(rs.getInt("RESERVED_DDL_INT"));<NEW_LINE>return job;<NEW_LINE>} | rs.getString("PHASE"))); |
1,039,963 | final ListTopicsDetectionJobsResult executeListTopicsDetectionJobs(ListTopicsDetectionJobsRequest listTopicsDetectionJobsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listTopicsDetectionJobsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListTopicsDetectionJobsRequest> request = null;<NEW_LINE>Response<ListTopicsDetectionJobsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListTopicsDetectionJobsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listTopicsDetectionJobsRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Comprehend");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListTopicsDetectionJobs");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListTopicsDetectionJobsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListTopicsDetectionJobsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden()); |
118,597 | public void write(DataOutput out) throws IOException {<NEW_LINE>super.write(out);<NEW_LINE>Text.writeString(out, backupTimestamp);<NEW_LINE>jobInfo.write(out);<NEW_LINE>out.writeBoolean(allowLoad);<NEW_LINE>Text.writeString(out, state.name());<NEW_LINE>if (backupMeta != null) {<NEW_LINE>out.writeBoolean(true);<NEW_LINE>backupMeta.write(out);<NEW_LINE>} else {<NEW_LINE>out.writeBoolean(false);<NEW_LINE>}<NEW_LINE>fileMapping.write(out);<NEW_LINE>out.writeLong(metaPreparedTime);<NEW_LINE>out.writeLong(snapshotFinishedTime);<NEW_LINE>out.writeLong(downloadFinishedTime);<NEW_LINE>out.writeInt(restoreReplicationNum);<NEW_LINE>out.writeInt(restoredPartitions.size());<NEW_LINE>for (Pair<String, Partition> entry : restoredPartitions) {<NEW_LINE>Text.writeString(out, entry.first);<NEW_LINE>entry.second.write(out);<NEW_LINE>}<NEW_LINE>out.writeInt(restoredTbls.size());<NEW_LINE>for (OlapTable tbl : restoredTbls) {<NEW_LINE>tbl.write(out);<NEW_LINE>}<NEW_LINE>out.writeInt(restoredVersionInfo.<MASK><NEW_LINE>for (long tblId : restoredVersionInfo.rowKeySet()) {<NEW_LINE>out.writeLong(tblId);<NEW_LINE>out.writeInt(restoredVersionInfo.row(tblId).size());<NEW_LINE>for (Map.Entry<Long, Long> entry : restoredVersionInfo.row(tblId).entrySet()) {<NEW_LINE>out.writeLong(entry.getKey());<NEW_LINE>out.writeLong(entry.getValue());<NEW_LINE>// write a version_hash for compatibility<NEW_LINE>out.writeLong(0);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>out.writeInt(snapshotInfos.rowKeySet().size());<NEW_LINE>for (long tabletId : snapshotInfos.rowKeySet()) {<NEW_LINE>out.writeLong(tabletId);<NEW_LINE>Map<Long, SnapshotInfo> map = snapshotInfos.row(tabletId);<NEW_LINE>out.writeInt(map.size());<NEW_LINE>for (Map.Entry<Long, SnapshotInfo> entry : map.entrySet()) {<NEW_LINE>out.writeLong(entry.getKey());<NEW_LINE>entry.getValue().write(out);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | rowKeySet().size()); |
756,744 | public void marshall(ParallelDataProperties parallelDataProperties, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (parallelDataProperties == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(parallelDataProperties.getArn(), ARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(parallelDataProperties.getDescription(), DESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(parallelDataProperties.getStatus(), STATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(parallelDataProperties.getSourceLanguageCode(), SOURCELANGUAGECODE_BINDING);<NEW_LINE>protocolMarshaller.marshall(parallelDataProperties.getTargetLanguageCodes(), TARGETLANGUAGECODES_BINDING);<NEW_LINE>protocolMarshaller.marshall(parallelDataProperties.getParallelDataConfig(), PARALLELDATACONFIG_BINDING);<NEW_LINE>protocolMarshaller.marshall(parallelDataProperties.getMessage(), MESSAGE_BINDING);<NEW_LINE>protocolMarshaller.marshall(parallelDataProperties.getImportedDataSize(), IMPORTEDDATASIZE_BINDING);<NEW_LINE>protocolMarshaller.marshall(parallelDataProperties.getImportedRecordCount(), IMPORTEDRECORDCOUNT_BINDING);<NEW_LINE>protocolMarshaller.marshall(parallelDataProperties.getFailedRecordCount(), FAILEDRECORDCOUNT_BINDING);<NEW_LINE>protocolMarshaller.marshall(parallelDataProperties.getSkippedRecordCount(), SKIPPEDRECORDCOUNT_BINDING);<NEW_LINE>protocolMarshaller.marshall(parallelDataProperties.getEncryptionKey(), ENCRYPTIONKEY_BINDING);<NEW_LINE>protocolMarshaller.marshall(parallelDataProperties.getCreatedAt(), CREATEDAT_BINDING);<NEW_LINE>protocolMarshaller.marshall(parallelDataProperties.getLastUpdatedAt(), LASTUPDATEDAT_BINDING);<NEW_LINE>protocolMarshaller.marshall(parallelDataProperties.getLatestUpdateAttemptStatus(), LATESTUPDATEATTEMPTSTATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(parallelDataProperties.getLatestUpdateAttemptAt(), LATESTUPDATEATTEMPTAT_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | parallelDataProperties.getName(), NAME_BINDING); |
287,182 | protected void onInfoSystemResultsReported(InfoRequestData infoRequestData) {<NEW_LINE>InfoRequestData sentLoggedOp = InfoSystem.get().<MASK><NEW_LINE>if (sentLoggedOp != null && sentLoggedOp.getType() == InfoRequestData.INFOREQUESTDATA_TYPE_RELATIONSHIPS && (sentLoggedOp.getHttpType() == InfoRequestData.HTTPTYPE_DELETE || sentLoggedOp.getHttpType() == InfoRequestData.HTTPTYPE_POST)) {<NEW_LINE>User.getSelf().done(new DoneCallback<User>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onDone(User user) {<NEW_LINE>String requestId = InfoSystem.get().resolveFollowings(user);<NEW_LINE>if (requestId != null) {<NEW_LINE>mCorrespondingRequestIds.add(requestId);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>if (mCorrespondingRequestIds.contains(infoRequestData.getRequestId())) {<NEW_LINE>if (infoRequestData.getType() == InfoRequestData.INFOREQUESTDATA_TYPE_USERS_FOLLOWS) {<NEW_LINE>mShowFakeFollowing = false;<NEW_LINE>mShowFakeNotFollowing = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>showContentHeader(mUser);<NEW_LINE>} | getSentLoggedOpById(infoRequestData.getRequestId()); |
1,246,191 | private void poll(MemPoolTracker tracker) {<NEW_LINE>MemoryUsage usage = tracker.poolBean.getUsage();<NEW_LINE>MemoryUsage peakUsage <MASK><NEW_LINE>MemoryUsage collectionUsage = tracker.poolBean.getCollectionUsage();<NEW_LINE>long ts = System.currentTimeMillis();<NEW_LINE>MemoryUsageBean busage = usage == null ? null : new MemoryUsageBean(usage);<NEW_LINE>MemoryUsageBean bpeakUsage = peakUsage == null ? null : new MemoryUsageBean(peakUsage);<NEW_LINE>MemoryUsageBean bcollectionUsage = collectionUsage == null ? null : new MemoryUsageBean(collectionUsage);<NEW_LINE>if (busage != null && !busage.equals(tracker.lastMemUsage)) {<NEW_LINE>tracker.lastMemUsage = busage;<NEW_LINE>fireUsageEvent(ts, tracker);<NEW_LINE>}<NEW_LINE>if (bpeakUsage != null && !bpeakUsage.equals(tracker.lastMemPeak)) {<NEW_LINE>tracker.lastMemPeak = bpeakUsage;<NEW_LINE>firePeakUsageEvent(ts, tracker);<NEW_LINE>}<NEW_LINE>if (bcollectionUsage != null && !bcollectionUsage.equals(tracker.lastMemCollection)) {<NEW_LINE>tracker.lastMemCollection = bcollectionUsage;<NEW_LINE>fireCollectionUsageEvent(ts, tracker);<NEW_LINE>}<NEW_LINE>} | = tracker.poolBean.getPeakUsage(); |
1,588,662 | private MethodTree genJAXP_ParseURLMethod(TreeMaker make) {<NEW_LINE>// NOI18N<NEW_LINE>String parsletParam = model.hasParslets() ? ", parslet" : "";<NEW_LINE>StringBuffer sb = new StringBuffer("{");<NEW_LINE>sb.append("\n" + M_PARSE + "(new " + SAX_INPUT_SOURCE + "(url.toExternalForm()), handler" + parsletParam + ");");<NEW_LINE>sb.append("}\n");<NEW_LINE>// method params<NEW_LINE>List parList = new ArrayList();<NEW_LINE>Tree tree = make.Identifier("java.net.URL");<NEW_LINE>VariableTree par1 = make.Variable(make.Modifiers(EnumSet.of(Modifier.FINAL)), "url", tree, null);<NEW_LINE>parList.add(par1);<NEW_LINE>tree = make.Identifier(model.getHandler());<NEW_LINE>par1 = make.Variable(make.Modifiers(EnumSet.of(Modifier.FINAL)<MASK><NEW_LINE>parList.add(par1);<NEW_LINE>if (model.hasParslets()) {<NEW_LINE>tree = make.Identifier(model.getParslet());<NEW_LINE>par1 = make.Variable(make.Modifiers(EnumSet.of(Modifier.FINAL)), "parslet", tree, null);<NEW_LINE>parList.add(par1);<NEW_LINE>}<NEW_LINE>ModifiersTree mods = make.Modifiers(EnumSet.of(Modifier.PUBLIC, Modifier.STATIC));<NEW_LINE>MethodTree method = make.Method(mods, M_PARSE, make.PrimitiveType(TypeKind.VOID), Collections.<TypeParameterTree>emptyList(), parList, exceptions, sb.toString(), null);<NEW_LINE>// NOI18N<NEW_LINE>String // NOI18N<NEW_LINE>commentText = // NOI18N<NEW_LINE>"\nThe recognizer entry method taking a URL.\n" + "@param url URL source to be parsed.\n" + JAXP_PARSE_EXCEPTIONS_DOC;<NEW_LINE>Comment comment = Comment.create(Comment.Style.JAVADOC, -2, -2, -2, commentText);<NEW_LINE>make.addComment(method, comment, true);<NEW_LINE>return method;<NEW_LINE>} | ), "handler", tree, null); |
341,905 | private void compressStream(PRStream stream) throws IOException {<NEW_LINE>PdfObject pdfSubType = stream.get(PdfName.SUBTYPE);<NEW_LINE>System.out.println(stream.type());<NEW_LINE>if (pdfSubType != null && pdfSubType.toString().equals(PdfName.IMAGE.toString())) {<NEW_LINE>PdfImageObject image = new PdfImageObject(stream);<NEW_LINE>byte[] imageBytes = image.getImageAsBytes();<NEW_LINE>Bitmap bmp;<NEW_LINE>bmp = BitmapFactory.decodeByteArray(imageBytes, 0, imageBytes.length);<NEW_LINE>if (bmp == null)<NEW_LINE>return;<NEW_LINE>int width = bmp.getWidth();<NEW_LINE><MASK><NEW_LINE>Bitmap outBitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);<NEW_LINE>Canvas outCanvas = new Canvas(outBitmap);<NEW_LINE>outCanvas.drawBitmap(bmp, 0f, 0f, null);<NEW_LINE>ByteArrayOutputStream imgBytes = new ByteArrayOutputStream();<NEW_LINE>outBitmap.compress(Bitmap.CompressFormat.JPEG, quality, imgBytes);<NEW_LINE>stream.clear();<NEW_LINE>stream.setData(imgBytes.toByteArray(), false, PRStream.BEST_COMPRESSION);<NEW_LINE>stream.put(PdfName.TYPE, PdfName.XOBJECT);<NEW_LINE>stream.put(PdfName.SUBTYPE, PdfName.IMAGE);<NEW_LINE>stream.put(PdfName.FILTER, PdfName.DCTDECODE);<NEW_LINE>stream.put(PdfName.WIDTH, new PdfNumber(width));<NEW_LINE>stream.put(PdfName.HEIGHT, new PdfNumber(height));<NEW_LINE>stream.put(PdfName.BITSPERCOMPONENT, new PdfNumber(8));<NEW_LINE>stream.put(PdfName.COLORSPACE, PdfName.DEVICERGB);<NEW_LINE>}<NEW_LINE>} | int height = bmp.getHeight(); |
1,589,860 | /*<NEW_LINE>* superSimpleName / superQualification / simpleName / enclosingTypeName / typeParameters / pkgName / superClassOrInterface classOrInterface modifiers<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public void decodeIndexKey(char[] key) {<NEW_LINE>int slash = CharOperation.indexOf(SEPARATOR, key, 0);<NEW_LINE>this.superSimpleName = CharOperation.subarray(key, 0, slash);<NEW_LINE>// some values may not have been know when indexed so decode as null<NEW_LINE>int start = slash + 1;<NEW_LINE>slash = CharOperation.indexOf(SEPARATOR, key, start);<NEW_LINE>this.superQualification = slash == start ? null : CharOperation.subarray(key, start, slash);<NEW_LINE>slash = CharOperation.indexOf(SEPARATOR, key, start = slash + 1);<NEW_LINE>this.simpleName = CharOperation.subarray(key, start, slash);<NEW_LINE>start = ++slash;<NEW_LINE>if (key[start] == SEPARATOR) {<NEW_LINE>this.enclosingTypeName = null;<NEW_LINE>} else {<NEW_LINE>slash = CharOperation.<MASK><NEW_LINE>if (slash == (start + 1) && key[start] == ZERO_CHAR) {<NEW_LINE>this.enclosingTypeName = ONE_ZERO;<NEW_LINE>} else {<NEW_LINE>char[] names = CharOperation.subarray(key, start, slash);<NEW_LINE>this.enclosingTypeName = names;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>start = ++slash;<NEW_LINE>if (key[start] == SEPARATOR) {<NEW_LINE>this.typeParameterSignatures = null;<NEW_LINE>} else {<NEW_LINE>slash = CharOperation.indexOf(SEPARATOR, key, start);<NEW_LINE>this.typeParameterSignatures = CharOperation.splitOn(',', key, start, slash);<NEW_LINE>}<NEW_LINE>start = ++slash;<NEW_LINE>if (key[start] == SEPARATOR) {<NEW_LINE>this.pkgName = null;<NEW_LINE>} else {<NEW_LINE>slash = CharOperation.indexOf(SEPARATOR, key, start);<NEW_LINE>if (slash == (start + 1) && key[start] == ZERO_CHAR) {<NEW_LINE>this.pkgName = this.superQualification;<NEW_LINE>} else {<NEW_LINE>char[] names = CharOperation.subarray(key, start, slash);<NEW_LINE>this.pkgName = names;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>this.superClassOrInterface = key[slash + 1];<NEW_LINE>this.classOrInterface = key[slash + 2];<NEW_LINE>// implicit cast to int type<NEW_LINE>this.modifiers = key[slash + 3];<NEW_LINE>} | indexOf(SEPARATOR, key, start); |
723,371 | ArrayList<Object> new138() /* reduce AAdynamicinvokeexpr3InvokeExpr */<NEW_LINE>{<NEW_LINE>@SuppressWarnings("hiding")<NEW_LINE>ArrayList<Object> nodeList = new ArrayList<Object>();<NEW_LINE>@SuppressWarnings("unused")<NEW_LINE>ArrayList<Object> nodeArrayList9 = pop();<NEW_LINE>@SuppressWarnings("unused")<NEW_LINE>ArrayList<MASK><NEW_LINE>@SuppressWarnings("unused")<NEW_LINE>ArrayList<Object> nodeArrayList7 = pop();<NEW_LINE>@SuppressWarnings("unused")<NEW_LINE>ArrayList<Object> nodeArrayList6 = pop();<NEW_LINE>@SuppressWarnings("unused")<NEW_LINE>ArrayList<Object> nodeArrayList5 = pop();<NEW_LINE>@SuppressWarnings("unused")<NEW_LINE>ArrayList<Object> nodeArrayList4 = pop();<NEW_LINE>@SuppressWarnings("unused")<NEW_LINE>ArrayList<Object> nodeArrayList3 = pop();<NEW_LINE>@SuppressWarnings("unused")<NEW_LINE>ArrayList<Object> nodeArrayList2 = pop();<NEW_LINE>@SuppressWarnings("unused")<NEW_LINE>ArrayList<Object> nodeArrayList1 = pop();<NEW_LINE>PInvokeExpr pinvokeexprNode1;<NEW_LINE>{<NEW_LINE>// Block<NEW_LINE>TDynamicinvoke tdynamicinvokeNode2;<NEW_LINE>TStringConstant tstringconstantNode3;<NEW_LINE>PUnnamedMethodSignature punnamedmethodsignatureNode4;<NEW_LINE>TLParen tlparenNode5;<NEW_LINE>@SuppressWarnings("unused")<NEW_LINE>Object nullNode6 = null;<NEW_LINE>TRParen trparenNode7;<NEW_LINE>PMethodSignature pmethodsignatureNode8;<NEW_LINE>TLParen tlparenNode9;<NEW_LINE>PArgList parglistNode10;<NEW_LINE>TRParen trparenNode11;<NEW_LINE>tdynamicinvokeNode2 = (TDynamicinvoke) nodeArrayList1.get(0);<NEW_LINE>tstringconstantNode3 = (TStringConstant) nodeArrayList2.get(0);<NEW_LINE>punnamedmethodsignatureNode4 = (PUnnamedMethodSignature) nodeArrayList3.get(0);<NEW_LINE>tlparenNode5 = (TLParen) nodeArrayList4.get(0);<NEW_LINE>trparenNode7 = (TRParen) nodeArrayList5.get(0);<NEW_LINE>pmethodsignatureNode8 = (PMethodSignature) nodeArrayList6.get(0);<NEW_LINE>tlparenNode9 = (TLParen) nodeArrayList7.get(0);<NEW_LINE>parglistNode10 = (PArgList) nodeArrayList8.get(0);<NEW_LINE>trparenNode11 = (TRParen) nodeArrayList9.get(0);<NEW_LINE>pinvokeexprNode1 = new ADynamicInvokeExpr(tdynamicinvokeNode2, tstringconstantNode3, punnamedmethodsignatureNode4, tlparenNode5, null, trparenNode7, pmethodsignatureNode8, tlparenNode9, parglistNode10, trparenNode11);<NEW_LINE>}<NEW_LINE>nodeList.add(pinvokeexprNode1);<NEW_LINE>return nodeList;<NEW_LINE>} | <Object> nodeArrayList8 = pop(); |
1,233,570 | public void initScene() {<NEW_LINE>mDirectionalLight = new DirectionalLight();<NEW_LINE>mDirectionalLight.setLookAt(<MASK><NEW_LINE>mDirectionalLight.enableLookAt();<NEW_LINE>mDirectionalLight.setPosition(-4, 10, -4);<NEW_LINE>mDirectionalLight.setPower(2);<NEW_LINE>getCurrentScene().addLight(mDirectionalLight);<NEW_LINE>getCurrentScene().setBackgroundColor(0x393939);<NEW_LINE>animateCamera();<NEW_LINE>mOtherCamera = new Camera();<NEW_LINE>mOtherCamera.setPosition(4, 2, -10);<NEW_LINE>mOtherCamera.setFarPlane(10);<NEW_LINE>mOtherCamera.enableLookAt();<NEW_LINE>mSphere = createAnimatedSphere();<NEW_LINE>DebugVisualizer debugViz = new DebugVisualizer(this);<NEW_LINE>debugViz.addChild(new GridFloor(20, 0x555555, 1, 20));<NEW_LINE>debugViz.addChild(new DebugLight(mDirectionalLight, 0x999900, 1));<NEW_LINE>debugViz.addChild(new DebugCamera(mOtherCamera, 0x000000, 1));<NEW_LINE>debugViz.addChild(new CoordinateTrident());<NEW_LINE>getCurrentScene().addChild(debugViz);<NEW_LINE>} | 1, -1, -1); |
1,309,671 | private static boolean isRhsValue(Cursor tree) {<NEW_LINE>if (!(tree.getValue() instanceof J.Identifier)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Cursor parent = dropParentWhile(J.Parentheses.class::isInstance, tree.getParent());<NEW_LINE>assert parent != null;<NEW_LINE>if (parent.getValue() instanceof J.Assignment) {<NEW_LINE>if (dropParentUntil(J.ControlParentheses.class::isInstance, parent) != null) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>J.Assignment assignment = parent.getValue();<NEW_LINE>return assignment.getVariable() != tree.getValue();<NEW_LINE>}<NEW_LINE>if (parent.getValue() instanceof J.VariableDeclarations.NamedVariable) {<NEW_LINE>J.VariableDeclarations.NamedVariable namedVariable = parent.getValue();<NEW_LINE>return namedVariable.getName() != tree.getValue();<NEW_LINE>}<NEW_LINE>if (parent.getValue() instanceof J.AssignmentOperation) {<NEW_LINE>J.AssignmentOperation assignmentOperation = parent.getValue();<NEW_LINE>if (assignmentOperation.getVariable() == tree.getValue()) {<NEW_LINE>J grandParent = parent.dropParentUntil(J.class::isInstance).getValue();<NEW_LINE>return (grandParent instanceof <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return !(isUnaryIncrementKind.test(parent) && parent.dropParentUntil(J.class::isInstance).getValue() instanceof J.Block);<NEW_LINE>} | Expression || grandParent instanceof J.Return); |
297,913 | private static void fillVariantsByReference(@Nullable PsiReference reference, @NotNull PsiFile file, @NotNull CompletionResultSet result) {<NEW_LINE>if (reference == null)<NEW_LINE>return;<NEW_LINE>if (reference instanceof PsiMultiReference) {<NEW_LINE>PsiReference[] references = ((PsiMultiReference) reference).getReferences();<NEW_LINE>ContainerUtil.sort(references, PsiMultiReference.COMPARATOR);<NEW_LINE>fillVariantsByReference(ArrayUtil.getFirstElement(references), file, result);<NEW_LINE>} else if (reference instanceof GoReference) {<NEW_LINE>GoReferenceExpression refExpression = ObjectUtils.tryCast(reference.getElement(), GoReferenceExpression.class);<NEW_LINE>GoStructLiteralCompletion.Variants variants = GoStructLiteralCompletion.allowedVariants(refExpression);<NEW_LINE>fillStructFieldNameVariants(file, result, variants, refExpression);<NEW_LINE>if (variants != GoStructLiteralCompletion.Variants.FIELD_NAME_ONLY) {<NEW_LINE>((GoReference) reference).processResolveVariants(new MyGoScopeProcessor(result, file, false));<NEW_LINE>}<NEW_LINE>} else if (reference instanceof GoTypeReference) {<NEW_LINE><MASK><NEW_LINE>PsiElement spec = PsiTreeUtil.getParentOfType(element, GoFieldDeclaration.class, GoTypeSpec.class);<NEW_LINE>boolean insideParameter = PsiTreeUtil.getParentOfType(element, GoParameterDeclaration.class) != null;<NEW_LINE>((GoTypeReference) reference).processResolveVariants(new MyGoScopeProcessor(result, file, true) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected boolean accept(@NotNull PsiElement e) {<NEW_LINE>return e != spec && !(insideParameter && (e instanceof GoNamedSignatureOwner || e instanceof GoVarDefinition || e instanceof GoConstDefinition));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} else if (reference instanceof GoCachedReference) {<NEW_LINE>((GoCachedReference) reference).processResolveVariants(new MyGoScopeProcessor(result, file, false));<NEW_LINE>}<NEW_LINE>} | PsiElement element = reference.getElement(); |
345,836 | private void insertSessionAttributes(JdbcSession session, List<String> attributeNames) {<NEW_LINE>Assert.notEmpty(attributeNames, "attributeNames must not be null or empty");<NEW_LINE>try (LobCreator lobCreator = this.lobHandler.getLobCreator()) {<NEW_LINE>if (attributeNames.size() > 1) {<NEW_LINE>try {<NEW_LINE>this.jdbcOperations.batchUpdate(this.createSessionAttributeQuery, new BatchPreparedStatementSetter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void setValues(PreparedStatement ps, int i) throws SQLException {<NEW_LINE>String attributeName = attributeNames.get(i);<NEW_LINE>ps.setString(1, session.primaryKey);<NEW_LINE>ps.setString(2, attributeName);<NEW_LINE>lobCreator.setBlobAsBytes(ps, 3, serialize(<MASK><NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public int getBatchSize() {<NEW_LINE>return attributeNames.size();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (DuplicateKeyException ex) {<NEW_LINE>throw ex;<NEW_LINE>} catch (DataIntegrityViolationException ex) {<NEW_LINE>// parent record not found - we are ignoring this error because we<NEW_LINE>// assume that a concurrent request has removed the session<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>this.jdbcOperations.update(this.createSessionAttributeQuery, (ps) -> {<NEW_LINE>String attributeName = attributeNames.get(0);<NEW_LINE>ps.setString(1, session.primaryKey);<NEW_LINE>ps.setString(2, attributeName);<NEW_LINE>lobCreator.setBlobAsBytes(ps, 3, serialize(session.getAttribute(attributeName)));<NEW_LINE>});<NEW_LINE>} catch (DuplicateKeyException ex) {<NEW_LINE>throw ex;<NEW_LINE>} catch (DataIntegrityViolationException ex) {<NEW_LINE>// parent record not found - we are ignoring this error because we<NEW_LINE>// assume that a concurrent request has removed the session<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | session.getAttribute(attributeName))); |
1,704,663 | final DeleteNotificationResult executeDeleteNotification(DeleteNotificationRequest deleteNotificationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteNotificationRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteNotificationRequest> request = null;<NEW_LINE>Response<DeleteNotificationResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteNotificationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteNotificationRequest));<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(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Budgets");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteNotification");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteNotificationResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteNotificationResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | HandlerContextKey.SIGNING_REGION, getSigningRegion()); |
922,559 | public ListBotsResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ListBotsResult listBotsResult = new ListBotsResult();<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 listBotsResult;<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("botSummaries", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listBotsResult.setBotSummaries(new ListUnmarshaller<BotSummary>(BotSummaryJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("nextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listBotsResult.setNextToken(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 listBotsResult;<NEW_LINE>} | class).unmarshall(context)); |
254,649 | private void action_loadBOM() {<NEW_LINE>// m_frame.setBusy(true);<NEW_LINE>m_frame.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));<NEW_LINE>reload = false;<NEW_LINE>int M_Product_ID = getM_Product_ID();<NEW_LINE>if (M_Product_ID == 0)<NEW_LINE>return;<NEW_LINE>MProduct M_Product = MProduct.get(getCtx(), M_Product_ID);<NEW_LINE>treeInfo.setText(" Current Selection: " + M_Product.getValue());<NEW_LINE>Vector<Object> line = new Vector<Object>(17);<NEW_LINE>// 0 Select<NEW_LINE>line.add(new Boolean(false));<NEW_LINE>// 1 IsActive<NEW_LINE>line.add(new Boolean(M_Product.isActive()));<NEW_LINE>// 2 Line<NEW_LINE>line.<MASK><NEW_LINE>KeyNamePair pp = new KeyNamePair(M_Product.getM_Product_ID(), M_Product.getValue().concat("_").concat(M_Product.getName()));<NEW_LINE>// 3 M_Product_ID<NEW_LINE>line.add(pp);<NEW_LINE>MUOM u = new MUOM(M_Product.getCtx(), M_Product.getC_UOM_ID(), M_Product.get_TrxName());<NEW_LINE>KeyNamePair uom = new KeyNamePair(M_Product.getC_UOM_ID(), u.getUOMSymbol());<NEW_LINE>// 4 C_UOM_ID<NEW_LINE>line.add(uom);<NEW_LINE>// 5 QtyBOM<NEW_LINE>line.add(Env.ONE);<NEW_LINE>DefaultMutableTreeNode parent = new DefaultMutableTreeNode(line);<NEW_LINE>m_root = (DefaultMutableTreeNode) parent.getRoot();<NEW_LINE>dataBOM.clear();<NEW_LINE>if (isImplosion()) {<NEW_LINE>for (MProductBOM bomline : getParentBOMs(M_Product_ID)) {<NEW_LINE>addParent(bomline, parent);<NEW_LINE>}<NEW_LINE>m_tree = new myJTree(parent);<NEW_LINE>m_tree.addMouseListener(mouseListener);<NEW_LINE>} else {<NEW_LINE>for (MProductBOM bom : getChildBOMs(M_Product_ID, true)) {<NEW_LINE>addChild(bom, parent);<NEW_LINE>}<NEW_LINE>m_tree = new myJTree(parent);<NEW_LINE>m_tree.addMouseListener(mouseListener);<NEW_LINE>}<NEW_LINE>m_tree.addTreeSelectionListener(this);<NEW_LINE>treePane.getViewport().add(m_tree, null);<NEW_LINE>loadTableBOM();<NEW_LINE>dataPane.getViewport().add(tableBOM, null);<NEW_LINE>// 4Layers - Set divider location<NEW_LINE>splitPane.setDividerLocation(DIVIDER_LOCATION);<NEW_LINE>// 4Layers - end<NEW_LINE>// Popup<NEW_LINE>// if (m_selected_id != 0)<NEW_LINE>// {<NEW_LINE>// }<NEW_LINE>// m_frame.setBusy(false);<NEW_LINE>m_frame.setCursor(Cursor.getDefaultCursor());<NEW_LINE>} | add(new Integer(0)); |
1,736,793 | public String[] introspectSelf() {<NEW_LINE>List<String> output = new ArrayList<String>();<NEW_LINE>if (isInbound()) {<NEW_LINE>output.add(HOST_NAME + "=" + this.hostname);<NEW_LINE>output.add(PORT + "=" + this.port);<NEW_LINE>output.add(MAX_CONNS + "=" + this.maxOpenConnections);<NEW_LINE>output.add(ADDR_EXC_LIST + "=" + debugStringArray(this.addressExcludeList));<NEW_LINE>output.add(NAME_EXC_LIST + "=" + debugStringArray(this.hostNameExcludeList));<NEW_LINE>output.add(ADDR_INC_LIST + "=" + debugStringArray(this.addressIncludeList));<NEW_LINE>output.add(NAME_INC_LIST + "=" <MASK><NEW_LINE>output.add(BACKLOG + "=" + this.listenBacklog);<NEW_LINE>output.add(NEW_BUFF_SIZE + "=" + this.newConnectionBufferSize);<NEW_LINE>output.add(PORT_OPEN_RETRIES + "=" + this.portOpenRetries);<NEW_LINE>} else {<NEW_LINE>// outbound<NEW_LINE>}<NEW_LINE>// common parms for both inbound and outbound<NEW_LINE>output.add(REUSE_ADDR + "=" + this.soReuseAddress);<NEW_LINE>output.add(INACTIVITY_TIMEOUT + "=" + this.inactivityTimeout);<NEW_LINE>output.add(GROUPNAME + "=" + this.workGroupName);<NEW_LINE>output.add(DIRECT_BUFFS + "=" + this.allocateBuffersDirect);<NEW_LINE>output.add(NO_DELAY + "=" + this.tcpNoDelay);<NEW_LINE>output.add(RCV_BUFF_SIZE + "=" + this.receiveBufferSize);<NEW_LINE>output.add(SEND_BUFF_SIZE + "=" + this.sendBufferSize);<NEW_LINE>output.add(COMM_OPTION + "=" + this.commOption);<NEW_LINE>output.add(LINGER + "=" + this.soLinger);<NEW_LINE>return output.toArray(new String[output.size()]);<NEW_LINE>} | + debugStringArray(this.hostNameIncludeList)); |
650,260 | public UpdateEnrollmentStatusResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>UpdateEnrollmentStatusResult updateEnrollmentStatusResult = new UpdateEnrollmentStatusResult();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return updateEnrollmentStatusResult;<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("status", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>updateEnrollmentStatusResult.setStatus(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("statusReason", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>updateEnrollmentStatusResult.setStatusReason(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return updateEnrollmentStatusResult;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
1,027,957 | public void parse(String mappingStr) {<NEW_LINE>StringTokenizer tokenizer = new StringTokenizer(mappingStr, ";");<NEW_LINE>while (tokenizer.hasMoreElements()) {<NEW_LINE>String mapping = tokenizer.nextToken();<NEW_LINE>String[] mappingGroups = mapping.split(",");<NEW_LINE>String mappedGroup = null;<NEW_LINE>int indexOfArrow = mapping.indexOf("->");<NEW_LINE>if (indexOfArrow > 0 && mappingGroups != null && (mappingGroups.length > 0)) {<NEW_LINE>String tmpGroup = <MASK><NEW_LINE>mappedGroup = tmpGroup.trim();<NEW_LINE>}<NEW_LINE>validate(mappedGroup, mappingGroups);<NEW_LINE>for (String grp : mappingGroups) {<NEW_LINE>int aIndex = grp.indexOf("->");<NEW_LINE>String theGroup = (aIndex > 0) ? grp.substring(0, aIndex).trim() : grp.trim();<NEW_LINE>List<String> mappedGroupList = groupMappingTable.get(theGroup);<NEW_LINE>if (mappedGroupList == null) {<NEW_LINE>mappedGroupList = new ArrayList<>();<NEW_LINE>}<NEW_LINE>mappedGroupList.add(mappedGroup);<NEW_LINE>groupMappingTable.put(theGroup, mappedGroupList);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | mapping.substring(indexOfArrow + 2); |
1,200,920 | /*<NEW_LINE>* @see com.sitewhere.microservice.api.device.IDeviceManagement#listAreas(com.<NEW_LINE>* sitewhere.spi.search.area.IAreaSearchCriteria)<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public ISearchResults<RdbArea> listAreas(IAreaSearchCriteria criteria) throws SiteWhereException {<NEW_LINE>return getEntityManagerProvider().findWithCriteria(criteria, new IRdbQueryProvider<RdbArea>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void addPredicates(CriteriaBuilder cb, List<Predicate> predicates, Root<RdbArea> root) throws SiteWhereException {<NEW_LINE>if ((criteria.getRootOnly() != null) && (criteria.getRootOnly().booleanValue() == true)) {<NEW_LINE>Path<UUID> path = root.get("parentId");<NEW_LINE>predicates.add(cb.isNull(path));<NEW_LINE>} else if (criteria.getParentAreaToken() != null) {<NEW_LINE>RdbArea parentArea = getAreaByToken(criteria.getParentAreaToken());<NEW_LINE>if (parentArea == null) {<NEW_LINE>throw new SiteWhereSystemException(ErrorCode.InvalidAreaToken, ErrorLevel.ERROR);<NEW_LINE>}<NEW_LINE>Path<UUID> path = root.get("parentId");<NEW_LINE>predicates.add(cb.equal(path, parentArea.getId()));<NEW_LINE>}<NEW_LINE>if (criteria.getAreaTypeToken() != null) {<NEW_LINE>RdbAreaType areaType = getAreaTypeByToken(criteria.getAreaTypeToken());<NEW_LINE>if (areaType == null) {<NEW_LINE>throw new SiteWhereSystemException(ErrorCode.InvalidAreaTypeToken, ErrorLevel.ERROR);<NEW_LINE>}<NEW_LINE>Path<UUID> <MASK><NEW_LINE>predicates.add(cb.equal(path, areaType.getId()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public CriteriaQuery<RdbArea> addSort(CriteriaBuilder cb, Root<RdbArea> root, CriteriaQuery<RdbArea> query) {<NEW_LINE>return query.orderBy(cb.asc(root.get("name")));<NEW_LINE>}<NEW_LINE>}, RdbArea.class);<NEW_LINE>} | path = root.get("areaTypeId"); |
193,530 | public PackageImportJobInputConfig unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>PackageImportJobInputConfig packageImportJobInputConfig = new PackageImportJobInputConfig();<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("PackageVersionInputConfig", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>packageImportJobInputConfig.setPackageVersionInputConfig(PackageVersionInputConfigJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return packageImportJobInputConfig;<NEW_LINE>} | String currentParentElement = context.getCurrentParentElement(); |
750,870 | private MappingModelList createList(@NonNull ConfirmPaymentState state) {<NEW_LINE>MappingModelList list = new MappingModelList();<NEW_LINE>FormatterOptions options = FormatterOptions.defaults();<NEW_LINE>switch(state.getFeeStatus()) {<NEW_LINE>case STILL_LOADING:<NEW_LINE>case ERROR:<NEW_LINE>list.add(new ConfirmPaymentAdapter.LoadingItem());<NEW_LINE>break;<NEW_LINE>case NOT_SET:<NEW_LINE>case SET:<NEW_LINE>list.add(new ConfirmPaymentAdapter.LineItem(getToPayeeDescription(requireContext(), state), state.getAmount().toString(options)));<NEW_LINE>if (state.getExchange() != null) {<NEW_LINE>list.add(new ConfirmPaymentAdapter.LineItem(getString(R.string.ConfirmPayment__estimated_s, state.getExchange().getCurrency().getCurrencyCode()), FiatMoneyUtil.format(getResources(), state.getExchange(), FiatMoneyUtil.formatOptions().withDisplayTime(false))));<NEW_LINE>}<NEW_LINE>list.add(new ConfirmPaymentAdapter.LineItem(getString(R.string.ConfirmPayment__network_fee), state.getFee().toString(options)));<NEW_LINE>list.add(new ConfirmPaymentAdapter.Divider());<NEW_LINE>list.add(new ConfirmPaymentAdapter.TotalLineItem(getString(R.string.ConfirmPayment__total_amount), state.getTotal().toString(options)));<NEW_LINE>}<NEW_LINE>list.add(new ConfirmPaymentAdapter.ConfirmPaymentStatus(state.getStatus(), state.getFeeStatus()<MASK><NEW_LINE>return list;<NEW_LINE>} | , state.getBalance())); |
453,431 | public void customLoadLogic(ParsedNode parsedNode, ResourceAccessor resourceAccessor) throws ParsedNodeException {<NEW_LINE>ParsedNode paramsNode = parsedNode.getChild(null, "params");<NEW_LINE>if (paramsNode == null) {<NEW_LINE>paramsNode = parsedNode;<NEW_LINE>}<NEW_LINE>for (ParsedNode child : paramsNode.getChildren(null, "param")) {<NEW_LINE>Object value = child.getValue();<NEW_LINE>if (value == null) {<NEW_LINE>value = child.getChildValue(null, "value");<NEW_LINE>}<NEW_LINE>if (value != null) {<NEW_LINE>value = value.toString();<NEW_LINE>}<NEW_LINE>String paramName = child.getChildValue(null, "name", String.class);<NEW_LINE>if (paramName == null) {<NEW_LINE>throw new ParsedNodeException("Custom change param " + child + " does not have a 'name' attribute");<NEW_LINE>}<NEW_LINE>this.setParam(paramName, (String) value);<NEW_LINE>}<NEW_LINE>CustomChange customChange = null;<NEW_LINE>try {<NEW_LINE>Boolean osgiPlatform = Scope.getCurrentScope().get(Scope.Attr.osgiPlatform, Boolean.class);<NEW_LINE>if (Boolean.TRUE.equals(osgiPlatform)) {<NEW_LINE>customChange = (CustomChange) OsgiUtil.loadClass(className).getConstructor().newInstance();<NEW_LINE>} else {<NEW_LINE>customChange = (CustomChange) Class.forName(className, false, Scope.getCurrentScope().getClassLoader()).getConstructor().newInstance();<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new UnexpectedLiquibaseException(e);<NEW_LINE>}<NEW_LINE>for (ParsedNode node : parsedNode.getChildren()) {<NEW_LINE>Object value = node.getValue();<NEW_LINE>if ((value != null) && ObjectUtil.hasProperty(customChange, node.getName())) {<NEW_LINE>this.setParam(node.getName(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ), value.toString()); |
814,589 | private static List<Target> requireTargets(List<Target> targets, TenantAndApplicationId application, Optional<InstanceName> instanceName, Scope scope, boolean certificateName) {<NEW_LINE>if (!certificateName && targets.isEmpty())<NEW_LINE>throw new IllegalArgumentException("At least one target must be given for " + scope + " endpoints");<NEW_LINE>if (scope == Scope.zone && targets.size() != 1)<NEW_LINE>throw new IllegalArgumentException("Exactly one target must be given for " + scope + " endpoints");<NEW_LINE>for (var target : targets) {<NEW_LINE>if (scope == Scope.application) {<NEW_LINE>TenantAndApplicationId owner = TenantAndApplicationId.from(target.<MASK><NEW_LINE>if (!owner.equals(application)) {<NEW_LINE>throw new IllegalArgumentException("Endpoint has target owned by " + owner + ", which does not match application of this endpoint: " + application);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>ApplicationId owner = target.deployment.applicationId();<NEW_LINE>ApplicationId instance = application.instance(instanceName.get());<NEW_LINE>if (!owner.equals(instance)) {<NEW_LINE>throw new IllegalArgumentException("Endpoint has target owned by " + owner + ", which does not match instance of this endpoint: " + instance);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return targets;<NEW_LINE>} | deployment().applicationId()); |
470,775 | void processExtends(HashMapWrappedVirtualObject minBounds, HashMapWrappedVirtualObject maxBounds, double[] transformationMatrix, DoubleBuffer vertices, int index, GenerateGeometryResult generateGeometryResult) throws BimserverDatabaseException {<NEW_LINE>double x = vertices.get(index);<NEW_LINE>double y = vertices.get(index + 1);<NEW_LINE>double z = vertices.get(index + 2);<NEW_LINE>double[] result = new double[4];<NEW_LINE>Matrix.multiplyMV(result, 0, transformationMatrix, 0, new double[] { x, y, z, 1 }, 0);<NEW_LINE>x = result[0];<NEW_LINE>y = result[1];<NEW_LINE>z = result[2];<NEW_LINE>minBounds.set("x", Math.min(x, (double) minBounds.eGet("x")));<NEW_LINE>minBounds.set("y", Math.min(y, (double) minBounds.eGet("y")));<NEW_LINE>minBounds.set("z", Math.min(z, (double) minBounds.eGet("z")));<NEW_LINE>maxBounds.set("x", Math.max(x, (double) maxBounds.eGet("x")));<NEW_LINE>maxBounds.set("y", Math.max(y, (double) <MASK><NEW_LINE>maxBounds.set("z", Math.max(z, (double) maxBounds.eGet("z")));<NEW_LINE>generateGeometryResult.setMinX(Math.min(x, generateGeometryResult.getMinX()));<NEW_LINE>generateGeometryResult.setMinY(Math.min(y, generateGeometryResult.getMinY()));<NEW_LINE>generateGeometryResult.setMinZ(Math.min(z, generateGeometryResult.getMinZ()));<NEW_LINE>generateGeometryResult.setMaxX(Math.max(x, generateGeometryResult.getMaxX()));<NEW_LINE>generateGeometryResult.setMaxY(Math.max(y, generateGeometryResult.getMaxY()));<NEW_LINE>generateGeometryResult.setMaxZ(Math.max(z, generateGeometryResult.getMaxZ()));<NEW_LINE>} | maxBounds.eGet("y"))); |
1,517,058 | protected com.liferay.portal.model.UserTrackerPath[] findByUserTrackerId_PrevAndNext(String userTrackerPathId, String userTrackerId, OrderByComparator obc) throws NoSuchUserTrackerPathException, SystemException {<NEW_LINE>com.liferay.portal.model.UserTrackerPath userTrackerPath = findByPrimaryKey(userTrackerPathId);<NEW_LINE>int count = countByUserTrackerId(userTrackerId);<NEW_LINE>Session session = null;<NEW_LINE>try {<NEW_LINE>session = openSession();<NEW_LINE>StringBuffer query = new StringBuffer();<NEW_LINE>query.append("FROM UserTrackerPath IN CLASS com.liferay.portal.ejb.UserTrackerPathHBM WHERE ");<NEW_LINE>query.append("userTrackerId = ?");<NEW_LINE>query.append(" ");<NEW_LINE>if (obc != null) {<NEW_LINE>query.append("ORDER BY " + obc.getOrderBy());<NEW_LINE>}<NEW_LINE>Query q = session.createQuery(query.toString());<NEW_LINE>int queryPos = 0;<NEW_LINE>q.setString(queryPos++, userTrackerId);<NEW_LINE>com.liferay.portal.model.UserTrackerPath[] array = new com.liferay.portal.model.UserTrackerPath[3];<NEW_LINE><MASK><NEW_LINE>if (sr.first()) {<NEW_LINE>while (true) {<NEW_LINE>UserTrackerPathHBM userTrackerPathHBM = (UserTrackerPathHBM) sr.get(0);<NEW_LINE>if (userTrackerPathHBM == null) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>com.liferay.portal.model.UserTrackerPath curUserTrackerPath = UserTrackerPathHBMUtil.model(userTrackerPathHBM);<NEW_LINE>int value = obc.compare(userTrackerPath, curUserTrackerPath);<NEW_LINE>if (value == 0) {<NEW_LINE>if (!userTrackerPath.equals(curUserTrackerPath)) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>array[1] = curUserTrackerPath;<NEW_LINE>if (sr.previous()) {<NEW_LINE>array[0] = UserTrackerPathHBMUtil.model((UserTrackerPathHBM) sr.get(0));<NEW_LINE>}<NEW_LINE>sr.next();<NEW_LINE>if (sr.next()) {<NEW_LINE>array[2] = UserTrackerPathHBMUtil.model((UserTrackerPathHBM) sr.get(0));<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (count == 1) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>count = (int) Math.ceil(count / 2.0);<NEW_LINE>if (value < 0) {<NEW_LINE>if (!sr.scroll(count * -1)) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (!sr.scroll(count)) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return array;<NEW_LINE>} catch (HibernateException he) {<NEW_LINE>throw new SystemException(he);<NEW_LINE>} finally {<NEW_LINE>HibernateUtil.closeSession(session);<NEW_LINE>}<NEW_LINE>} | ScrollableResults sr = q.scroll(); |
1,840,424 | public void run() {<NEW_LINE>log.debug("+++++ Started server job {}", server);<NEW_LINE>try {<NEW_LINE>final ThreadPoolExecutor executor = queryExecutorRepository.getExecutor(server);<NEW_LINE>for (Query query : server.getQueries()) {<NEW_LINE>ProcessQueryThread pqt = new ProcessQueryThread(resultProcessor, server, query);<NEW_LINE>try {<NEW_LINE>executor.submit(pqt);<NEW_LINE>} catch (RejectedExecutionException ree) {<NEW_LINE>log.error("Could not submit query {}. You could try to size the 'queryProcessorExecutor' to a larger size.", pqt, ree);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>log.debug("+++++ Finished server job {}", server);<NEW_LINE>} catch (Exception e) {<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.<MASK><NEW_LINE>} else {<NEW_LINE>log.warn("+++++ Failed server job {}: {} {}", server, e.getClass().getName(), e.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | warn("+++++ Failed server job " + server, e); |
456,247 | public static ListAllImsUsersResponse unmarshall(ListAllImsUsersResponse listAllImsUsersResponse, UnmarshallerContext context) {<NEW_LINE>listAllImsUsersResponse.setRequestId(context.stringValue("ListAllImsUsersResponse.RequestId"));<NEW_LINE>listAllImsUsersResponse.setSuccess(context.booleanValue("ListAllImsUsersResponse.Success"));<NEW_LINE>listAllImsUsersResponse.setCode(context.stringValue("ListAllImsUsersResponse.Code"));<NEW_LINE>listAllImsUsersResponse.setMessage(context.stringValue("ListAllImsUsersResponse.Message"));<NEW_LINE>listAllImsUsersResponse.setHttpStatusCode(context.integerValue("ListAllImsUsersResponse.HttpStatusCode"));<NEW_LINE>Users users = new Users();<NEW_LINE>users.setTotalCount(context.integerValue("ListAllImsUsersResponse.Users.TotalCount"));<NEW_LINE>users.setPageNumber<MASK><NEW_LINE>users.setPageSize(context.integerValue("ListAllImsUsersResponse.Users.PageSize"));<NEW_LINE>List<User> list = new ArrayList<User>();<NEW_LINE>for (int i = 0; i < context.lengthValue("ListAllImsUsersResponse.Users.List.Length"); i++) {<NEW_LINE>User user = new User();<NEW_LINE>user.setUserId(context.stringValue("ListAllImsUsersResponse.Users.List[" + i + "].UserId"));<NEW_LINE>user.setUserPrincipalName(context.stringValue("ListAllImsUsersResponse.Users.List[" + i + "].UserPrincipalName"));<NEW_LINE>user.setDisplayName(context.stringValue("ListAllImsUsersResponse.Users.List[" + i + "].DisplayName"));<NEW_LINE>user.setPhone(context.stringValue("ListAllImsUsersResponse.Users.List[" + i + "].Phone"));<NEW_LINE>user.setEmail(context.stringValue("ListAllImsUsersResponse.Users.List[" + i + "].Email"));<NEW_LINE>list.add(user);<NEW_LINE>}<NEW_LINE>users.setList(list);<NEW_LINE>listAllImsUsersResponse.setUsers(users);<NEW_LINE>return listAllImsUsersResponse;<NEW_LINE>} | (context.integerValue("ListAllImsUsersResponse.Users.PageNumber")); |
507,577 | private void updateRelativeSize(boolean isRelativeSize, String direction) {<NEW_LINE>if (isRelativeSize && hasCaption()) {<NEW_LINE>captionWrap.getStyle().setProperty(direction, getWidget().getElement().getStyle().getProperty(direction));<NEW_LINE>captionWrap.addClassName("v-has-" + direction);<NEW_LINE>} else if (hasCaption()) {<NEW_LINE>if (direction.equals("height")) {<NEW_LINE>captionWrap.getStyle().clearHeight();<NEW_LINE>} else {<NEW_LINE>captionWrap.getStyle().clearWidth();<NEW_LINE>}<NEW_LINE>captionWrap.removeClassName("v-has-" + direction);<NEW_LINE>captionWrap.getStyle().clearPaddingTop();<NEW_LINE>captionWrap.getStyle().clearPaddingRight();<NEW_LINE>captionWrap.getStyle().clearPaddingBottom();<NEW_LINE>captionWrap.getStyle().clearPaddingLeft();<NEW_LINE>caption.getStyle().clearMarginTop();<NEW_LINE>caption.getStyle().clearMarginRight();<NEW_LINE>caption.getStyle().clearMarginBottom();<NEW_LINE>caption<MASK><NEW_LINE>}<NEW_LINE>} | .getStyle().clearMarginLeft(); |
1,464,041 | public okhttp3.Call readNamespacedLeaseCall(String name, String namespace, String pretty, final ApiCallback _callback) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/apis/coordination.k8s.io/v1/namespaces/{namespace}/leases/{name}".replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString())).replaceAll("\\{" + "namespace" + "\\}", localVarApiClient.escapeString(namespace.toString()));<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();<NEW_LINE>if (pretty != null) {<NEW_LINE>localVarQueryParams.addAll(localVarApiClient<MASK><NEW_LINE>}<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, String> localVarCookieParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = { "application/json", "application/yaml", "application/vnd.kubernetes.protobuf" };<NEW_LINE>final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>if (localVarAccept != null) {<NEW_LINE>localVarHeaderParams.put("Accept", localVarAccept);<NEW_LINE>}<NEW_LINE>final String[] localVarContentTypes = {};<NEW_LINE>final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>String[] localVarAuthNames = new String[] { "BearerToken" };<NEW_LINE>return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);<NEW_LINE>} | .parameterToPair("pretty", pretty)); |
432,480 | public void addDownload(final HttpMetadata metadata, final String file) {<NEW_LINE>if (refreshCallback != null) {<NEW_LINE>if (refreshCallback.isValidLink(metadata)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// HttpMetadata md = HttpMetadata.load(refreshCallback.getId());<NEW_LINE>// if (md.getType() == metadata.getType()) {<NEW_LINE>// if (md instanceof DashMetadata) {<NEW_LINE>// DashMetadata dm1 = (DashMetadata) md;<NEW_LINE>// DashMetadata dm2 = (DashMetadata) metadata;<NEW_LINE>// if (dm1.getLen1() == dm2.getLen1() && dm1.getLen2() ==<NEW_LINE>// dm2.getLen2()) {<NEW_LINE>// if(refreshCallback.isValidLink(metadata))<NEW_LINE>// dm1.setUrl(dm2.getUrl());<NEW_LINE>// dm1.setUrl2(dm2.getUrl2());<NEW_LINE>// dm1.setHeaders(dm2.getHeaders());<NEW_LINE>// dm1.setLen1(dm2.getLen1());<NEW_LINE>// dm1.setLen2(dm2.getLen2());<NEW_LINE>// dm1.save();<NEW_LINE>// }<NEW_LINE>// } else if (md instanceof HlsMetadata) {<NEW_LINE>// HlsMetadata hm1 = (HlsMetadata) md;<NEW_LINE>// HlsMetadata hm2 = (HlsMetadata) metadata;<NEW_LINE>// hm1<NEW_LINE>// }<NEW_LINE>// }<NEW_LINE>}<NEW_LINE>SwingUtilities.invokeLater(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>String fileName;<NEW_LINE>String folderPath;<NEW_LINE>if (StringUtils.isNullOrEmptyOrBlank(file)) {<NEW_LINE>if (metadata != null) {<NEW_LINE>fileName = XDMUtils.getFileName(metadata.getUrl());<NEW_LINE>} else {<NEW_LINE>fileName = null;<NEW_LINE>}<NEW_LINE>folderPath = null;<NEW_LINE>} else {<NEW_LINE>var path = Paths.get(file);<NEW_LINE>fileName = path.getFileName().toString();<NEW_LINE>var parentPath = path.getParent();<NEW_LINE>if (parentPath != null && parentPath.isAbsolute()) {<NEW_LINE>folderPath = parentPath.toString();<NEW_LINE>} else {<NEW_LINE>String downloadFolderPath;<NEW_LINE>if (Config.getInstance().isForceSingleFolder()) {<NEW_LINE>downloadFolderPath = Config.getInstance().getDownloadFolder();<NEW_LINE>} else {<NEW_LINE>var category = XDMUtils.findCategory(file);<NEW_LINE>downloadFolderPath = XDMApp.<MASK><NEW_LINE>}<NEW_LINE>if (parentPath != null) {<NEW_LINE>folderPath = Paths.get(downloadFolderPath, parentPath.toString()).toString();<NEW_LINE>} else {<NEW_LINE>folderPath = downloadFolderPath;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (metadata != null && (Config.getInstance().isQuietMode() || Config.getInstance().isDownloadAutoStart())) {<NEW_LINE>createDownload(fileName, folderPath, metadata, true, "", 0, 0);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>new NewDownloadWindow(metadata, fileName, folderPath).setVisible(true);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | getInstance().getFolder(category); |
1,423,123 | protected TaskManager createTaskManagerImpl(TaskConfiguration taskConfig) {<NEW_LINE>MapWriterConfiguration configuration = new MapWriterConfiguration();<NEW_LINE>configuration.addOutputFile(getStringArgument(taskConfig, PARAM_OUTFILE, Constants.DEFAULT_PARAM_OUTFILE));<NEW_LINE>// must be set before loading tag mapping file<NEW_LINE>configuration.setTagValues(getBooleanArgument(taskConfig, PARAM_TAG_VALUES, false));<NEW_LINE>configuration.loadTagMappingFile(getStringArgument(taskConfig, PARAM_TAG_MAPPING_FILE, null));<NEW_LINE>configuration.addMapStartPosition(getStringArgument(taskConfig, PARAM_MAP_START_POSITION, null));<NEW_LINE>configuration.addMapStartZoom(getStringArgument(taskConfig, PARAM_MAP_START_ZOOM, null));<NEW_LINE>configuration.addBboxConfiguration(getStringArgument(taskConfig, PARAM_BBOX, null));<NEW_LINE>configuration.addZoomIntervalConfiguration(getStringArgument(taskConfig, PARAM_ZOOMINTERVAL_CONFIG, null));<NEW_LINE>configuration.setComment(getStringArgument(taskConfig, PARAM_COMMENT, null));<NEW_LINE>configuration.setDebugStrings(getBooleanArgument(taskConfig, PARAM_DEBUG_INFO, false));<NEW_LINE>configuration.setPolygonClipping(getBooleanArgument(taskConfig, PARAM_POLYGON_CLIPPING, true));<NEW_LINE>configuration.setPolylabel(getBooleanArgument(taskConfig, PARAM_POLYLABEL, false));<NEW_LINE>configuration.setProgressLogs(getBooleanArgument(taskConfig, PARAM_PROGRESS_LOGS, true));<NEW_LINE>configuration.setWayClipping(getBooleanArgument(taskConfig, PARAM_WAY_CLIPPING, true));<NEW_LINE>configuration.setLabelPosition(getBooleanArgument(taskConfig, PARAM_LABEL_POSITION, false));<NEW_LINE>// boolean waynodeCompression = getBooleanArgument(taskConfig, PARAM_WAYNODE_COMPRESSION,<NEW_LINE>// true);<NEW_LINE>configuration.setSimplification(getDoubleArgument(taskConfig, PARAM_SIMPLIFICATION_FACTOR, Constants.DEFAULT_SIMPLIFICATION_FACTOR));<NEW_LINE>configuration.setSimplificationMaxZoom((byte) getIntegerArgument(taskConfig, PARAM_SIMPLIFICATION_MAX_ZOOM, Constants.DEFAULT_SIMPLIFICATION_MAX_ZOOM));<NEW_LINE>configuration.setSkipInvalidRelations(getBooleanArgument(taskConfig, PARAM_SKIP_INVALID_RELATIONS, false));<NEW_LINE>configuration.setDataProcessorType(getStringArgument(taskConfig, PARAM_TYPE, Constants.DEFAULT_PARAM_TYPE));<NEW_LINE>configuration.setBboxEnlargement(getIntegerArgument(taskConfig, PARAM_BBOX_ENLARGEMENT, Constants.DEFAULT_PARAM_BBOX_ENLARGEMENT));<NEW_LINE>configuration.addPreferredLanguages(getStringArgument<MASK><NEW_LINE>configuration.addEncodingChoice(getStringArgument(taskConfig, PARAM_ENCODING, Constants.DEFAULT_PARAM_ENCODING));<NEW_LINE>// Use 1 thread to avoid OOM when processing ways, see #920<NEW_LINE>configuration.setThreads(getIntegerArgument(taskConfig, PARAM_THREADS, 1));<NEW_LINE>configuration.validate();<NEW_LINE>MapFileWriterTask task = new MapFileWriterTask(configuration);<NEW_LINE>return new SinkManager(taskConfig.getId(), task, taskConfig.getPipeArgs());<NEW_LINE>} | (taskConfig, PARAM_PREFERRED_LANGUAGES, null)); |
810,926 | // parse an IborCapFloor<NEW_LINE>private static IborCapFloor parseIborCapFloor(CsvRow row) {<NEW_LINE>PayReceive payReceive = row.getValue(DIRECTION_FIELD, LoaderUtils::parsePayReceive);<NEW_LINE>Currency currency = row.<MASK><NEW_LINE>ValueSchedule strike = ValueSchedule.of(row.getValue(STRIKE_FIELD, LoaderUtils::parseDoublePercent));<NEW_LINE>double notional = row.getValue(NOTIONAL_FIELD, LoaderUtils::parseDouble);<NEW_LINE>IborIndex iborIndex = parseIborIndex(row);<NEW_LINE>PeriodicSchedule paymentSchedule = parseSchedule(row, currency);<NEW_LINE>IborCapFloorLeg.Builder capFloorLegBuilder = IborCapFloorLeg.builder().payReceive(payReceive).paymentSchedule(paymentSchedule).currency(currency).notional(ValueSchedule.of(notional)).calculation(IborRateCalculation.of(iborIndex));<NEW_LINE>String capFloorType = row.getValue(CAP_FLOOR_FIELD);<NEW_LINE>if (capFloorType.toUpperCase(Locale.ENGLISH).equals("CAP")) {<NEW_LINE>capFloorLegBuilder.capSchedule(strike);<NEW_LINE>} else if (capFloorType.toUpperCase(Locale.ENGLISH).equals("FLOOR")) {<NEW_LINE>capFloorLegBuilder.floorSchedule(strike);<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("Unknown CapFloor value, must be 'Cap' or 'Floor' but was '" + capFloorType + "'; " + "parser is case insensitive.");<NEW_LINE>}<NEW_LINE>IborCapFloorLeg iborCapFloorLeg = capFloorLegBuilder.build();<NEW_LINE>return IborCapFloor.of(iborCapFloorLeg);<NEW_LINE>} | getValue(CURRENCY_FIELD, LoaderUtils::parseCurrency); |
1,171,211 | public List<Object> apply(Object wrapped) throws RuntimeException {<NEW_LINE>// apply processSdt to any sdt<NEW_LINE>// which might be a conditional|repeat<NEW_LINE>Object o = XmlUtils.unwrap(wrapped);<NEW_LINE>if (o instanceof SdtElement) {<NEW_LINE>SdtPr sdtPr = OpenDoPEHandler.getSdtPr(o);<NEW_LINE>if (sdtPr.getDataBinding() == null) {<NEW_LINE>// a real binding attribute trumps any tag<NEW_LINE>try {<NEW_LINE>return processBindingRoleIfAny<MASK><NEW_LINE>} catch (Docx4JException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// log.warn("TODO: Handle " + o.getClass().getName() +<NEW_LINE>// " (if that's an sdt)");<NEW_LINE>}<NEW_LINE>// Otherwise just preserve the content<NEW_LINE>List<Object> newContent = new ArrayList<Object>();<NEW_LINE>// we want the JAXBElement (if any)<NEW_LINE>newContent.add(wrapped);<NEW_LINE>return newContent;<NEW_LINE>} | (wordMLPackage, (SdtElement) o); |
257,200 | public void doSave(IProgressMonitor progressMonitor) {<NEW_LINE>// Save only resources that have actually changed.<NEW_LINE>//<NEW_LINE>final Map<Object, Object> saveOptions = new HashMap<Object, Object>();<NEW_LINE>saveOptions.put(Resource.OPTION_SAVE_ONLY_IF_CHANGED, Resource.OPTION_SAVE_ONLY_IF_CHANGED_MEMORY_BUFFER);<NEW_LINE>// Do the work within an operation because this is a long running activity that modifies the workbench.<NEW_LINE>//<NEW_LINE>WorkspaceModifyOperation operation = new WorkspaceModifyOperation() {<NEW_LINE><NEW_LINE>// This is the method that gets invoked when the operation runs.<NEW_LINE>//<NEW_LINE>@Override<NEW_LINE>public void execute(IProgressMonitor monitor) {<NEW_LINE>// Save the resources to the file system.<NEW_LINE>//<NEW_LINE>boolean first = true;<NEW_LINE>for (Resource resource : editingDomain.getResourceSet().getResources()) {<NEW_LINE>if ((first || !resource.getContents().isEmpty() || isPersisted(resource)) && !editingDomain.isReadOnly(resource)) {<NEW_LINE>try {<NEW_LINE>long timeStamp = resource.getTimeStamp();<NEW_LINE>resource.save(saveOptions);<NEW_LINE>if (resource.getTimeStamp() != timeStamp) {<NEW_LINE>savedResources.add(resource);<NEW_LINE>}<NEW_LINE>} catch (Exception exception) {<NEW_LINE>resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));<NEW_LINE>}<NEW_LINE>first = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>updateProblemIndication = false;<NEW_LINE>try {<NEW_LINE>// This runs the options, and shows progress.<NEW_LINE>//<NEW_LINE>new ProgressMonitorDialog(getSite().getShell()).run(true, false, operation);<NEW_LINE>// Refresh the necessary state.<NEW_LINE>//<NEW_LINE>((BasicCommandStack) editingDomain.getCommandStack()).saveIsDone();<NEW_LINE>firePropertyChange(IEditorPart.PROP_DIRTY);<NEW_LINE>} catch (Exception exception) {<NEW_LINE>// Something went wrong that shouldn't.<NEW_LINE>//<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>updateProblemIndication = true;<NEW_LINE>updateProblemIndication();<NEW_LINE>} | OpenDDSEditorPlugin.INSTANCE.log(exception); |
348,073 | public void onMethodCall(MethodCall call, Result result) {<NEW_LINE>switch(call.method) {<NEW_LINE>case "getUrl":<NEW_LINE>{<NEW_LINE>Kraken kraken = getKraken();<NEW_LINE>result.success(kraken == null ? "" : kraken.getUrl());<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case "getDynamicLibraryPath":<NEW_LINE>{<NEW_LINE>Kraken kraken = getKraken();<NEW_LINE>result.success(kraken == null ? "" : kraken.getDynamicLibraryPath());<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case "invokeMethod":<NEW_LINE>{<NEW_LINE>Kraken kraken = getKraken();<NEW_LINE>if (kraken != null) {<NEW_LINE>String method = call.argument("method");<NEW_LINE>Object <MASK><NEW_LINE>assert method != null;<NEW_LINE>MethodCall callWrap = new MethodCall(method, args);<NEW_LINE>kraken._handleMethodCall(callWrap, result);<NEW_LINE>} else {<NEW_LINE>result.error("Kraken instance not found.", null, null);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case "getTemporaryDirectory":<NEW_LINE>result.success(getTemporaryDirectory());<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>result.notImplemented();<NEW_LINE>}<NEW_LINE>} | args = call.argument("args"); |
806,414 | protected void decodeHave(BTHave have) {<NEW_LINE>final <MASK><NEW_LINE>have.destroy();<NEW_LINE>if (is_metadata_download) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if ((pieceNumber >= nbPieces) || (pieceNumber < 0)) {<NEW_LINE>closeConnectionInternally("invalid pieceNumber: " + pieceNumber);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (closing)<NEW_LINE>return;<NEW_LINE>if (peerHavePieces == null)<NEW_LINE>peerHavePieces = new BitFlags(nbPieces);<NEW_LINE>if (!peerHavePieces.flags[pieceNumber]) {<NEW_LINE>if (!interested_in_other_peer && diskManager.isInteresting(pieceNumber) && !is_download_disabled) {<NEW_LINE>connection.getOutgoingMessageQueue().addMessage(new BTInterested(other_peer_interested_version), false);<NEW_LINE>interested_in_other_peer = true;<NEW_LINE>}<NEW_LINE>peerHavePieces.set(pieceNumber);<NEW_LINE>final int pieceLength = manager.getPieceLength(pieceNumber);<NEW_LINE>manager.havePiece(pieceNumber, pieceLength, this);<NEW_LINE>// maybe a seed using lazy bitfield, or suddenly became a seed;<NEW_LINE>checkSeed();<NEW_LINE>if (other_peer_interested_in_me) {<NEW_LINE>if (isSeed() || isRelativeSeed()) {<NEW_LINE>// never consider seeds interested<NEW_LINE>other_peer_interested_in_me = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>peer_stats.hasNewPiece(pieceLength);<NEW_LINE>}<NEW_LINE>} | int pieceNumber = have.getPieceNumber(); |
680,197 | public ProcessStatus handleRestValidateCode(final PwmRequest pwmRequest) throws PwmUnrecoverableException, IOException, ServletException, ChaiUnavailableException {<NEW_LINE>final PwmDomain pwmDomain = pwmRequest.getPwmDomain();<NEW_LINE>final PwmSession pwmSession = pwmRequest.getPwmSession();<NEW_LINE>final OTPUserRecord otpUserRecord = pwmSession.getUserInfo().getOtpUserRecord();<NEW_LINE>final OtpService otpService = pwmDomain.getOtpService();<NEW_LINE>final String bodyString = pwmRequest.readRequestBodyAsString();<NEW_LINE>final Map<String, String> clientValues = JsonFactory.get().deserializeStringMap(bodyString);<NEW_LINE>final String code = Validator.sanitizeInputValue(pwmRequest.getAppConfig(), clientValues<MASK><NEW_LINE>try {<NEW_LINE>final boolean passed = otpService.validateToken(pwmRequest.getLabel(), pwmSession.getUserInfo().getUserIdentity(), otpUserRecord, code, false);<NEW_LINE>final RestResultBean restResultBean = RestResultBean.withData(passed, Boolean.class);<NEW_LINE>LOGGER.trace(pwmRequest, () -> "returning result for restValidateCode: " + JsonFactory.get().serialize(restResultBean));<NEW_LINE>pwmRequest.outputJsonResult(restResultBean);<NEW_LINE>} catch (final PwmOperationalException e) {<NEW_LINE>final String errorMsg = "error during otp code validation: " + e.getMessage();<NEW_LINE>LOGGER.error(pwmRequest, () -> errorMsg);<NEW_LINE>pwmRequest.outputJsonResult(RestResultBean.fromError(new ErrorInformation(PwmError.ERROR_INTERNAL, errorMsg), pwmRequest));<NEW_LINE>}<NEW_LINE>return ProcessStatus.Continue;<NEW_LINE>} | .get("code"), 1024); |
1,446,773 | // GEN-LAST:event_cancelButtonActionPerformed<NEW_LINE>@NbBundle.Messages({ "GetTagNameDialog.tagNameAlreadyExists.message=Tag name must be unique. A tag with this name already exists.", "GetTagNameDialog.tagNameAlreadyExists.title=Duplicate Tag Name", "GetTagNameDialog.tagDescriptionIllegalCharacters.message=Tag descriptions may not contain commas (,) or semicolons (;)", "GetTagNameDialog.tagDescriptionIllegalCharacters.title=Invalid character in tag description" })<NEW_LINE>private void okButtonActionPerformed(java.awt.event.ActionEvent evt) {<NEW_LINE>// GEN-FIRST:event_okButtonActionPerformed<NEW_LINE>String tagDisplayName = tagNameField.getText();<NEW_LINE>String userTagDescription = descriptionTextArea.getText();<NEW_LINE>TskData.FileKnown status = notableCheckbox.isSelected() ? TskData.FileKnown.BAD : TskData.FileKnown.UNKNOWN;<NEW_LINE>if (tagDisplayName.isEmpty()) {<NEW_LINE>JOptionPane.showMessageDialog(this, NbBundle.getMessage(this.getClass(), "GetTagNameDialog.mustSupplyTtagName.msg"), NbBundle.getMessage(this.getClass(), "GetTagNameDialog.tagNameErr"), JOptionPane.ERROR_MESSAGE);<NEW_LINE>} else if (TagsManager.containsIllegalCharacters(tagDisplayName)) {<NEW_LINE>JOptionPane.showMessageDialog(this, NbBundle.getMessage(this.getClass(), "GetTagNameDialog.illegalChars.msg"), NbBundle.getMessage(this.getClass(), "GetTagNameDialog.illegalCharsErr"), JOptionPane.ERROR_MESSAGE);<NEW_LINE>} else if (userTagDescription.contains(",") || userTagDescription.contains(";")) {<NEW_LINE>JOptionPane.showMessageDialog(this, NbBundle.getMessage(this.getClass(), "GetTagNameDialog.tagDescriptionIllegalCharacters.message"), NbBundle.getMessage(this.getClass(), "GetTagNameDialog.tagDescriptionIllegalCharacters.title"), JOptionPane.ERROR_MESSAGE);<NEW_LINE>} else {<NEW_LINE>tagName = tagNamesMap.get(tagDisplayName);<NEW_LINE>if (tagName == null) {<NEW_LINE>AddTagNameWorker worker = new AddTagNameWorker(tagDisplayName, userTagDescription, <MASK><NEW_LINE>okButton.setEnabled(false);<NEW_LINE>cancelButton.setEnabled(false);<NEW_LINE>setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));<NEW_LINE>worker.execute();<NEW_LINE>} else {<NEW_LINE>JOptionPane.showMessageDialog(this, NbBundle.getMessage(this.getClass(), "GetTagNameDialog.tagNameAlreadyExists.message"), NbBundle.getMessage(this.getClass(), "GetTagNameDialog.tagNameAlreadyExists.title"), JOptionPane.INFORMATION_MESSAGE);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | status, TagName.HTML_COLOR.NONE); |
1,486,921 | private static Set<String> scanBootstrapClasses() throws Exception {<NEW_LINE>int vmVersion = VMUtil.getVmVersion();<NEW_LINE>Set<String> classes = new LinkedHashSet<>(4096, 1F);<NEW_LINE>if (vmVersion < 9) {<NEW_LINE>Method method = ClassLoader.class.getDeclaredMethod("getBootstrapClassPath");<NEW_LINE>method.setAccessible(true);<NEW_LINE>Field field = URLClassLoader.class.getDeclaredField("ucp");<NEW_LINE>field.setAccessible(true);<NEW_LINE>Object bootstrapClasspath = method.invoke(null);<NEW_LINE>URLClassLoader dummyLoader = new URLClassLoader(new URL[0]);<NEW_LINE>Field modifiers = Field.class.getDeclaredField("modifiers");<NEW_LINE>modifiers.setAccessible(true);<NEW_LINE>modifiers.setInt(field, field.getModifiers() & ~Modifier.FINAL);<NEW_LINE>// Change the URLClassPath in the dummy loader to the bootstrap one.<NEW_LINE>field.set(dummyLoader, bootstrapClasspath);<NEW_LINE>URL[] urls = dummyLoader.getURLs();<NEW_LINE>for (URL url : urls) {<NEW_LINE>String protocol = url.getProtocol();<NEW_LINE>JarFile jar = null;<NEW_LINE>if ("jar".equals(protocol)) {<NEW_LINE>jar = ((JarURLConnection) url.openConnection()).getJarFile();<NEW_LINE>} else if ("file".equals(protocol)) {<NEW_LINE>File file = new File(url.toURI());<NEW_LINE>if (!file.isFile())<NEW_LINE>continue;<NEW_LINE>jar = new JarFile(file);<NEW_LINE>}<NEW_LINE>if (jar == null)<NEW_LINE>continue;<NEW_LINE>try {<NEW_LINE>Enumeration<? extends JarEntry> enumeration = jar.entries();<NEW_LINE>while (enumeration.hasMoreElements()) {<NEW_LINE>JarEntry entry = enumeration.nextElement();<NEW_LINE><MASK><NEW_LINE>if (name.endsWith(".class")) {<NEW_LINE>classes.add(name.substring(0, name.length() - 6));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>jar.close();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return classes;<NEW_LINE>} else {<NEW_LINE>Set<ModuleReference> references = ModuleFinder.ofSystem().findAll();<NEW_LINE>for (ModuleReference ref : references) {<NEW_LINE>try (ModuleReader mr = ref.open()) {<NEW_LINE>mr.list().forEach(s -> {<NEW_LINE>classes.add(s.substring(0, s.length() - 6));<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return classes;<NEW_LINE>} | String name = entry.getName(); |
1,090,553 | private void begin(final boolean headers, final CSVFormat format) {<NEW_LINE>try {<NEW_LINE>this.parseLine = new ParseCSVLine(format);<NEW_LINE>this.format = format;<NEW_LINE>// read the column heads<NEW_LINE>if (headers) {<NEW_LINE>final String line = this.reader.readLine();<NEW_LINE>// Are we trying to parse an empty file?<NEW_LINE>if (line == null) {<NEW_LINE>this.columnNames.clear();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final List<String> tok = <MASK><NEW_LINE>int i = 0;<NEW_LINE>this.columnNames.clear();<NEW_LINE>for (final String header : tok) {<NEW_LINE>this.columnNames.add(header.toLowerCase());<NEW_LINE>this.columns.put(header.toLowerCase(), i++);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>this.data = null;<NEW_LINE>} catch (final IOException e) {<NEW_LINE>throw new EncogError(e);<NEW_LINE>}<NEW_LINE>} | this.parseLine.parse(line); |
1,504,516 | protected void debug() {<NEW_LINE>if (tc.isDebugEnabled()) {<NEW_LINE>Tr.debug(tc, "" + this);<NEW_LINE>Tr.debug(tc, KEY_clientId + " = " + clientId);<NEW_LINE>Tr.debug(tc, KEY_clientSecret + <MASK><NEW_LINE>Tr.debug(tc, KEY_loginDialogEndpoint + " = " + authorizationEndpoint);<NEW_LINE>Tr.debug(tc, KEY_tokenEndpoint + " = " + tokenEndpoint);<NEW_LINE>Tr.debug(tc, KEY_userApi + " = " + userApi);<NEW_LINE>Tr.debug(tc, "userApiConfigs = " + (userApiConfigs == null ? "null" : userApiConfigs.length));<NEW_LINE>Tr.debug(tc, KEY_permissions + " = " + scope);<NEW_LINE>Tr.debug(tc, KEY_userNameAttribute + " = " + userNameAttribute);<NEW_LINE>Tr.debug(tc, KEY_mapToUserRegistry + " = " + mapToUserRegistry);<NEW_LINE>Tr.debug(tc, KEY_sslRef + " = " + sslRef);<NEW_LINE>Tr.debug(tc, KEY_authFilterRef + " = " + authFilterRef);<NEW_LINE>Tr.debug(tc, CFG_KEY_jwtRef + " = " + jwtRef);<NEW_LINE>Tr.debug(tc, CFG_KEY_jwtClaims + " = " + ((jwtClaims == null) ? null : Arrays.toString(jwtClaims)));<NEW_LINE>Tr.debug(tc, KEY_isClientSideRedirectSupported + " = " + isClientSideRedirectSupported);<NEW_LINE>Tr.debug(tc, KEY_displayName + " = " + displayName);<NEW_LINE>Tr.debug(tc, KEY_website + " = " + website);<NEW_LINE>Tr.debug(tc, KEY_tokenEndpointAuthMethod + " = " + tokenEndpointAuthMethod);<NEW_LINE>Tr.debug(tc, KEY_redirectToRPHostAndPort + " = " + redirectToRPHostAndPort);<NEW_LINE>}<NEW_LINE>} | " is null = " + (clientSecret == null)); |
446,111 | private static final void maybeAddSubkey(List<Subkey> subkeys, PGPPublicKey masterpk, PGPPublicKey subkey, StringBuilder errors) throws PGPException, SignatureException, IOException {<NEW_LINE>Iterator<PGPSignature> sigit = Util.getTypedIterator(subkey.getSignatures(), PGPSignature.class);<NEW_LINE>if (sigit == null) {<NEW_LINE>errors.append("Reject subkey " + nicePk(subkey) + " because no binding signatures were found.\n");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>PGPSignature validSig = null;<NEW_LINE>long validTs = -1L;<NEW_LINE>while (sigit.hasNext()) {<NEW_LINE>PGPSignature sig = sigit.next();<NEW_LINE>switch(sig.getSignatureType()) {<NEW_LINE>case PGPSignature.SUBKEY_BINDING:<NEW_LINE>case PGPSignature.SUBKEY_REVOCATION:<NEW_LINE>if (isGoodSubkeySignature(sig, masterpk, subkey, errors)) {<NEW_LINE>if (sig.getSignatureType() == PGPSignature.SUBKEY_REVOCATION) {<NEW_LINE>// Reject this subkey permanently.<NEW_LINE>errors.append("Subkey " + nicePk(subkey) + " revoked by " + niceSig(sig) + "\n");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// signing subkeys must have an embedded back signature.<NEW_LINE>if (!Util.hasKeyFlag(sig, KeyFlags.SIGN_DATA) || isGoodBackSignature(sig, masterpk, subkey, errors)) {<NEW_LINE>long ts = getSignatureTimestamp(sig, errors);<NEW_LINE>if (ts > validTs) {<NEW_LINE>validSig = sig;<NEW_LINE>validTs = ts;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>errors.append("Ignore " + niceSig(sig) + " for subkey " + nicePk(subkey) + "\n");<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// We need atleast one good binding.<NEW_LINE>if (validSig == null) {<NEW_LINE>errors.append("Subkey " + nicePk(subkey) + " rejected because no valid binding signatures were found.\n");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>subkeys.add(<MASK><NEW_LINE>} | new Subkey(subkey, validSig)); |
122,362 | final DeleteConnectionResult executeDeleteConnection(DeleteConnectionRequest deleteConnectionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteConnectionRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteConnectionRequest> request = null;<NEW_LINE>Response<DeleteConnectionResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteConnectionRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteConnectionRequest));<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, "EventBridge");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteConnection");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteConnectionResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteConnectionResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); |
1,380,632 | public OutputStream createOutputStream(final long l) throws IOException {<NEW_LINE>try (Tx tx = StructrApp.getInstance().tx()) {<NEW_LINE>if (structrFile == null) {<NEW_LINE>final Folder parentFolder = (Folder) FileHelper.getFileByAbsolutePath(securityContext, StringUtils.substringBeforeLast(newPath, "/"));<NEW_LINE>try {<NEW_LINE>structrFile = FileHelper.createFile(securityContext, new byte[0], null, File.class, getName(), false);<NEW_LINE>structrFile.setProperty(AbstractNode.type, File.class.getSimpleName());<NEW_LINE>structrFile.setProperty(AbstractNode.owner, owner.getStructrUser());<NEW_LINE>if (parentFolder != null) {<NEW_LINE>structrFile.setParent(parentFolder);<NEW_LINE>}<NEW_LINE>} catch (FrameworkException ex) {<NEW_LINE>logger.error("", ex);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>tx.success();<NEW_LINE>return ((<MASK><NEW_LINE>} catch (FrameworkException fex) {<NEW_LINE>logger.error(null, fex);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | File) structrFile).getOutputStream(); |
1,851,465 | private void processBlockRegistrations(NetData.NetMessage message) {<NEW_LINE>for (NetData.BlockFamilyRegisteredMessage blockFamily : message.getBlockFamilyRegisteredList()) {<NEW_LINE>if (blockFamily.getBlockIdCount() != blockFamily.getBlockUriCount()) {<NEW_LINE>logger.error("Received block registration with mismatched id<->uri mapping");<NEW_LINE>} else if (blockFamily.getBlockUriCount() == 0) {<NEW_LINE>logger.error("Received empty block registration");<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>BlockUri family = new BlockUri(blockFamily.getBlockUri(0)).getFamilyUri();<NEW_LINE>Map<String, Integer<MASK><NEW_LINE>for (int i = 0; i < blockFamily.getBlockIdCount(); ++i) {<NEW_LINE>registrationMap.put(blockFamily.getBlockUri(i), blockFamily.getBlockId(i));<NEW_LINE>}<NEW_LINE>blockManager.receiveFamilyRegistration(family, registrationMap);<NEW_LINE>} catch (BlockUriParseException e) {<NEW_LINE>logger.error("Received invalid block uri {}", blockFamily.getBlockUri(0));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | > registrationMap = Maps.newHashMap(); |
1,113,186 | public synchronized void paintComponent(Graphics g) {<NEW_LINE>super.paintComponent(g);<NEW_LINE>if (input == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Graphics2D g2 = (Graphics2D) g;<NEW_LINE>Rectangle r = getVisibleRect();<NEW_LINE>render(r);<NEW_LINE>g2.drawImage(workImage, r.<MASK><NEW_LINE>if (showCrude && crudePoints != null) {<NEW_LINE>for (Point2D_I32 p : crudePoints) {<NEW_LINE>// put it in the center of a pixel<NEW_LINE>int x = (int) Math.round(p.x * scale + 0.5 * scale);<NEW_LINE>int y = (int) Math.round(p.y * scale + 0.5 * scale);<NEW_LINE>VisualizeFeatures.drawPoint(g2, x, y, Color.GRAY);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (showRefined && refinedPoints != null) {<NEW_LINE>for (Point2D_F64 p : refinedPoints) {<NEW_LINE>// put it in the center of a pixel<NEW_LINE>int x = (int) Math.round(p.x * scale + 0.5 * scale);<NEW_LINE>int y = (int) Math.round(p.y * scale + 0.5 * scale);<NEW_LINE>VisualizeFeatures.drawPoint(g2, x, y, Color.RED);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | x, r.y, null); |
626,892 | private Object readResolve() throws Exception {<NEW_LINE>final boolean trace = TraceComponent.isAnyTracingEnabled();<NEW_LINE>if (trace && tc.isEntryEnabled())<NEW_LINE>Tr.entry(this, tc, "readResolve", filter, resourceRefInfo);<NEW_LINE>Object dataSource;<NEW_LINE>BundleContext bundleContext = WSJdbcWrapper.priv.getBundleContext(FrameworkUtil<MASK><NEW_LINE>ServiceReference<DataSourceService> dssvcRef = null;<NEW_LINE>try {<NEW_LINE>Collection<ServiceReference<DataSourceService>> srs = WSJdbcWrapper.priv.getServiceReferences(bundleContext, DataSourceService.class, filter);<NEW_LINE>if (srs.isEmpty())<NEW_LINE>throw new IllegalStateException(filter);<NEW_LINE>dssvcRef = srs.iterator().next();<NEW_LINE>DataSourceService dssvc = WSJdbcWrapper.priv.getService(bundleContext, dssvcRef);<NEW_LINE>dataSource = dssvc.createResource((ResourceRefInfo) resourceRefInfo);<NEW_LINE>} catch (Exception x) {<NEW_LINE>if (trace && tc.isEntryEnabled())<NEW_LINE>Tr.exit(this, tc, "readResolve", x);<NEW_LINE>throw x;<NEW_LINE>} finally {<NEW_LINE>if (dssvcRef != null)<NEW_LINE>bundleContext.ungetService(dssvcRef);<NEW_LINE>}<NEW_LINE>if (trace && tc.isEntryEnabled())<NEW_LINE>Tr.exit(this, tc, "readResolve", dataSource);<NEW_LINE>return dataSource;<NEW_LINE>} | .getBundle(DataSourceService.class)); |
1,828,142 | ActionResult<Wo> execute(EffectivePerson effectivePerson, JsonElement jsonElement) throws Exception {<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>Wi wi = this.convertToWrapIn(jsonElement, Wi.class);<NEW_LINE>ActionResult<Wo> result = new ActionResult<>();<NEW_LINE>Wo wo = new Wo();<NEW_LINE>Business business = new Business(emc);<NEW_LINE>Person person = business.person().pick(wi.getPerson());<NEW_LINE>if (null == person) {<NEW_LINE>wo.setValue(false);<NEW_LINE>logger.warn("user {} append personAttribute {} fail, person {} not exist.", effectivePerson.getDistinguishedName(), StringUtils.join(wi.getAttributeList(), ","), wi.getPerson());<NEW_LINE>} else if ((!effectivePerson.isManager()) && effectivePerson.isNotPerson(person.getDistinguishedName())) {<NEW_LINE>wo.setValue(false);<NEW_LINE>logger.warn("user {} append personAttribute person: {}, value: {} fail, permission denied.", effectivePerson.getDistinguishedName(), wi.getPerson(), StringUtils.join(wi.getAttributeList(), ","));<NEW_LINE>} else {<NEW_LINE>emc.beginTransaction(PersonAttribute.class);<NEW_LINE>PersonAttribute personAttribute = this.get(business, person, wi.getName());<NEW_LINE>if (null == personAttribute) {<NEW_LINE>personAttribute = new PersonAttribute();<NEW_LINE>personAttribute.setAttributeList(ListTools.trim(wi.getAttributeList(), true, false));<NEW_LINE>personAttribute.setName(wi.getName());<NEW_LINE>personAttribute.setPerson(person.getId());<NEW_LINE>emc.persist(personAttribute, CheckPersistType.all);<NEW_LINE>} else {<NEW_LINE>List<String> list = new ArrayList<>();<NEW_LINE>list.addAll(personAttribute.getAttributeList());<NEW_LINE>list.addAll(wi.getAttributeList());<NEW_LINE>personAttribute.setAttributeList(ListTools.trim(list, true, false));<NEW_LINE>personAttribute.setName(wi.getName());<NEW_LINE>personAttribute.setPerson(person.getId());<NEW_LINE>emc.check(personAttribute, CheckPersistType.all);<NEW_LINE>}<NEW_LINE>wo.setValue(true);<NEW_LINE>emc.commit();<NEW_LINE>CacheManager.notify(PersonAttribute.class);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>result.setData(wo);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>} | CacheManager.notify(Person.class); |
190,409 | protected // -------------------------------------------------------------------------<NEW_LINE>boolean findInClass(final String clazz, final MethodModel methodModel) {<NEW_LINE>if (clazz == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>FileObject ejbClassFO = model.runReadAction(new MetadataModelAction<EjbJarMetadata, FileObject>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public FileObject run(EjbJarMetadata metadata) throws Exception {<NEW_LINE>return metadata.findResource(Utils.toResourceName(ejbClass));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>final boolean[] result = new boolean[] { false };<NEW_LINE>JavaSource javaSource = JavaSource.forFileObject(ejbClassFO);<NEW_LINE>javaSource.runUserActionTask(new Task<CompilationController>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run(CompilationController controller) throws IOException {<NEW_LINE><MASK><NEW_LINE>result[0] = methodFindInClass(controller, clazz, methodModel) != null;<NEW_LINE>}<NEW_LINE>}, true);<NEW_LINE>return result[0];<NEW_LINE>} catch (IOException e) {<NEW_LINE>Exceptions.printStackTrace(e);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} | controller.toPhase(Phase.ELEMENTS_RESOLVED); |
446,712 | public static DescribePdnsRequestStatisticsResponse unmarshall(DescribePdnsRequestStatisticsResponse describePdnsRequestStatisticsResponse, UnmarshallerContext _ctx) {<NEW_LINE>describePdnsRequestStatisticsResponse.setRequestId(_ctx.stringValue("DescribePdnsRequestStatisticsResponse.RequestId"));<NEW_LINE>describePdnsRequestStatisticsResponse.setTotalCount(_ctx.longValue("DescribePdnsRequestStatisticsResponse.TotalCount"));<NEW_LINE>describePdnsRequestStatisticsResponse.setPageSize(_ctx.longValue("DescribePdnsRequestStatisticsResponse.PageSize"));<NEW_LINE>describePdnsRequestStatisticsResponse.setPageNumber(_ctx.longValue("DescribePdnsRequestStatisticsResponse.PageNumber"));<NEW_LINE>List<StatisticItem> data = new ArrayList<StatisticItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribePdnsRequestStatisticsResponse.Data.Length"); i++) {<NEW_LINE>StatisticItem statisticItem = new StatisticItem();<NEW_LINE>statisticItem.setUdpTotalCount(_ctx.longValue("DescribePdnsRequestStatisticsResponse.Data[" + i + "].UdpTotalCount"));<NEW_LINE>statisticItem.setIpCount(_ctx.longValue("DescribePdnsRequestStatisticsResponse.Data[" + i + "].IpCount"));<NEW_LINE>statisticItem.setDomainName(_ctx.stringValue("DescribePdnsRequestStatisticsResponse.Data[" + i + "].DomainName"));<NEW_LINE>statisticItem.setV6HttpCount(_ctx.longValue("DescribePdnsRequestStatisticsResponse.Data[" + i + "].V6HttpCount"));<NEW_LINE>statisticItem.setV4Count(_ctx.longValue("DescribePdnsRequestStatisticsResponse.Data[" + i + "].V4Count"));<NEW_LINE>statisticItem.setHttpsCount(_ctx.longValue("DescribePdnsRequestStatisticsResponse.Data[" + i + "].HttpsCount"));<NEW_LINE>statisticItem.setV4HttpsCount(_ctx.longValue("DescribePdnsRequestStatisticsResponse.Data[" + i + "].V4HttpsCount"));<NEW_LINE>statisticItem.setV6Count(_ctx.longValue("DescribePdnsRequestStatisticsResponse.Data[" + i + "].V6Count"));<NEW_LINE>statisticItem.setSubDomain(_ctx.stringValue("DescribePdnsRequestStatisticsResponse.Data[" + i + "].SubDomain"));<NEW_LINE>statisticItem.setTotalCount(_ctx.longValue<MASK><NEW_LINE>statisticItem.setV4HttpCount(_ctx.longValue("DescribePdnsRequestStatisticsResponse.Data[" + i + "].V4HttpCount"));<NEW_LINE>statisticItem.setThreatCount(_ctx.longValue("DescribePdnsRequestStatisticsResponse.Data[" + i + "].ThreatCount"));<NEW_LINE>statisticItem.setMaxThreatLevel(_ctx.stringValue("DescribePdnsRequestStatisticsResponse.Data[" + i + "].MaxThreatLevel"));<NEW_LINE>statisticItem.setHttpCount(_ctx.longValue("DescribePdnsRequestStatisticsResponse.Data[" + i + "].HttpCount"));<NEW_LINE>statisticItem.setV6HttpsCount(_ctx.longValue("DescribePdnsRequestStatisticsResponse.Data[" + i + "].V6HttpsCount"));<NEW_LINE>statisticItem.setDohTotalCount(_ctx.longValue("DescribePdnsRequestStatisticsResponse.Data[" + i + "].DohTotalCount"));<NEW_LINE>List<ThreatItem> threatInfo = new ArrayList<ThreatItem>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribePdnsRequestStatisticsResponse.Data[" + i + "].ThreatInfo.Length"); j++) {<NEW_LINE>ThreatItem threatItem = new ThreatItem();<NEW_LINE>threatItem.setThreatLevel(_ctx.stringValue("DescribePdnsRequestStatisticsResponse.Data[" + i + "].ThreatInfo[" + j + "].ThreatLevel"));<NEW_LINE>threatItem.setThreatType(_ctx.stringValue("DescribePdnsRequestStatisticsResponse.Data[" + i + "].ThreatInfo[" + j + "].ThreatType"));<NEW_LINE>threatInfo.add(threatItem);<NEW_LINE>}<NEW_LINE>statisticItem.setThreatInfo(threatInfo);<NEW_LINE>data.add(statisticItem);<NEW_LINE>}<NEW_LINE>describePdnsRequestStatisticsResponse.setData(data);<NEW_LINE>return describePdnsRequestStatisticsResponse;<NEW_LINE>} | ("DescribePdnsRequestStatisticsResponse.Data[" + i + "].TotalCount")); |
394,138 | private String printAnr(String scene, int[] processStat, long[] memoryInfo, Thread.State state, StringBuilder stack, boolean isForeground, long stackSize, String stackKey, String dumpStack, long inputCost, long animationCost, long traversalCost, long stackCost) {<NEW_LINE>StringBuilder print = new StringBuilder();<NEW_LINE>print.append(String.format("-\n>>>>>>>>>>>>>>>>>>>>>>> maybe happens ANR(%s ms)! <<<<<<<<<<<<<<<<<<<<<<<\n", stackCost));<NEW_LINE>print.append("|* [Status]").append("\n");<NEW_LINE>print.append("|*\t\tScene: ").append(scene).append("\n");<NEW_LINE>print.append("|*\t\tForeground: ").append(isForeground).append("\n");<NEW_LINE>print.append("|*\t\tPriority: ").append(processStat[0]).append("\tNice: ").append(processStat[1]).append("\n");<NEW_LINE>print.append("|*\t\tis64BitRuntime: ").append(DeviceUtil.is64BitRuntime()).append("\n");<NEW_LINE>print.append("|* [Memory]").append("\n");<NEW_LINE>print.append("|*\t\tDalvikHeap: ").append(memoryInfo[0]).append("kb\n");<NEW_LINE>print.append("|*\t\tNativeHeap: ").append(memoryInfo[1]).append("kb\n");<NEW_LINE>print.append("|*\t\tVmSize: ").append(memoryInfo[2]).append("kb\n");<NEW_LINE>print.append("|* [doFrame]").append("\n");<NEW_LINE>print.append<MASK><NEW_LINE>print.append("|*\t\t").append(inputCost).append(":").append(animationCost).append(":").append(traversalCost).append("\n");<NEW_LINE>print.append("|* [Thread]").append("\n");<NEW_LINE>print.append(String.format("|*\t\tStack(%s): ", state)).append(dumpStack);<NEW_LINE>print.append("|* [Trace]").append("\n");<NEW_LINE>if (stackSize > 0) {<NEW_LINE>print.append("|*\t\tStackKey: ").append(stackKey).append("\n");<NEW_LINE>print.append(stack.toString());<NEW_LINE>} else {<NEW_LINE>print.append(String.format("AppMethodBeat is close[%s].", AppMethodBeat.getInstance().isAlive())).append("\n");<NEW_LINE>}<NEW_LINE>print.append("=========================================================================");<NEW_LINE>return print.toString();<NEW_LINE>} | ("|*\t\tinputCost:animationCost:traversalCost").append("\n"); |
172,364 | public static void sendMessage(String[] addressList, String title, String content) throws AddressException {<NEW_LINE>Address[] addresses <MASK><NEW_LINE>for (int i = 0; i < addressList.length; i++) {<NEW_LINE>addresses[i] = new InternetAddress(addressList[i]);<NEW_LINE>}<NEW_LINE>// Sender's email ID needs to be mentioned<NEW_LINE>String from = "rap@domain.com";<NEW_LINE>final String username = PRIVATE_CONFIG.mailUserName;<NEW_LINE>final String password = PRIVATE_CONFIG.mailPassword;<NEW_LINE>// Get system properties<NEW_LINE>Properties props = System.getProperties();<NEW_LINE>// Setup mail server<NEW_LINE>props.put("mail.smtp.host", "smtp-inc.domain.com");<NEW_LINE>props.put("mail.smtp.port", "25");<NEW_LINE>props.put("mail.smtp.auth", "true");<NEW_LINE>props.put("mail.smtp.starttls.enable", "true");<NEW_LINE>// Get the default Session object.<NEW_LINE>Session session = Session.getDefaultInstance(props, new javax.mail.Authenticator() {<NEW_LINE><NEW_LINE>protected PasswordAuthentication getPasswordAuthentication() {<NEW_LINE>return new PasswordAuthentication(username, password);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>try {<NEW_LINE>// Create a default MimeMessage object.<NEW_LINE>MimeMessage message = new MimeMessage(session);<NEW_LINE>// Set From: header field of the header.<NEW_LINE>message.setFrom(new InternetAddress(from));<NEW_LINE>// Set To: header field of the header.<NEW_LINE>message.addRecipients(Message.RecipientType.BCC, addresses);<NEW_LINE>// Set Subject: header field<NEW_LINE>message.setSubject(title, "UTF-8");<NEW_LINE>// Now set the actual message<NEW_LINE>message.setText(content, "UTF-8");<NEW_LINE>// Send message<NEW_LINE>Transport.send(message);<NEW_LINE>} catch (MessagingException mex) {<NEW_LINE>mex.printStackTrace();<NEW_LINE>}<NEW_LINE>} | = new Address[addressList.length]; |
462,598 | public void marshall(XavcHdProfileSettings xavcHdProfileSettings, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (xavcHdProfileSettings == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(xavcHdProfileSettings.getBitrateClass(), BITRATECLASS_BINDING);<NEW_LINE>protocolMarshaller.marshall(xavcHdProfileSettings.getFlickerAdaptiveQuantization(), FLICKERADAPTIVEQUANTIZATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(xavcHdProfileSettings.getGopBReference(), GOPBREFERENCE_BINDING);<NEW_LINE>protocolMarshaller.marshall(xavcHdProfileSettings.getGopClosedCadence(), GOPCLOSEDCADENCE_BINDING);<NEW_LINE>protocolMarshaller.marshall(xavcHdProfileSettings.getHrdBufferSize(), HRDBUFFERSIZE_BINDING);<NEW_LINE>protocolMarshaller.marshall(xavcHdProfileSettings.getInterlaceMode(), INTERLACEMODE_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(xavcHdProfileSettings.getSlices(), SLICES_BINDING);<NEW_LINE>protocolMarshaller.marshall(xavcHdProfileSettings.getTelecine(), TELECINE_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | xavcHdProfileSettings.getQualityTuningLevel(), QUALITYTUNINGLEVEL_BINDING); |
900,383 | boolean onMouseEvent(MouseEvent e) {<NEW_LINE>Point p = e.getPoint();<NEW_LINE>p = SwingUtilities.convertPoint((Component) e.getSource(), p, this);<NEW_LINE>int selRow = getSelectedRow();<NEW_LINE>int selCol = getSelectedColumn();<NEW_LINE>if (selRow < 0 || selCol < 0)<NEW_LINE>return false;<NEW_LINE>Rectangle rect = getCellRect(selRow, selCol, false);<NEW_LINE>if (rect.contains(p)) {<NEW_LINE>Dimension size = btnClose.getPreferredSize();<NEW_LINE>int x = rect.x + rect.width - size.width;<NEW_LINE>int y = rect.y + (rect.height - size.height) / 2;<NEW_LINE>Rectangle btnRect = new Rectangle(x, y, size.width, size.height);<NEW_LINE>boolean inButton = btnRect.contains(p);<NEW_LINE>boolean mustRepaint = inCloseButtonRect != inButton;<NEW_LINE>inCloseButtonRect = inButton;<NEW_LINE>if (inButton) {<NEW_LINE>if (e.getID() == MouseEvent.MOUSE_PRESSED) {<NEW_LINE>Item item = (Item) getModel(<MASK><NEW_LINE>TabData tab = item.getTabData();<NEW_LINE>int tabIndex = controller.getTabModel().indexOf(tab);<NEW_LINE>if (tabIndex >= 0) {<NEW_LINE>TabActionEvent tae = new TabActionEvent(this, TabbedContainer.COMMAND_CLOSE, tabIndex);<NEW_LINE>controller.postActionEvent(tae);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (mustRepaint && lastRow == selRow && lastCol == selCol)<NEW_LINE>repaint(btnRect);<NEW_LINE>lastCol = selCol;<NEW_LINE>lastRow = selRow;<NEW_LINE>return inButton;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | ).getValueAt(selRow, selCol); |
799,588 | private void insertAttribute(TypeDB.Transaction transaction, DataProto.Item.Attribute attrMsg) {<NEW_LINE>AttributeType type = transaction.concepts().getAttributeType(attrMsg.getLabel());<NEW_LINE>if (type == null)<NEW_LINE>throw TypeDBException.of(TYPE_NOT_FOUND, attrMsg.getLabel());<NEW_LINE>DataProto.ValueObject valueMsg = attrMsg.getValue();<NEW_LINE>Attribute attribute;<NEW_LINE>switch(valueMsg.getValueCase()) {<NEW_LINE>case STRING:<NEW_LINE>attribute = type.asString().put(valueMsg.getString());<NEW_LINE>break;<NEW_LINE>case BOOLEAN:<NEW_LINE>attribute = type.asBoolean().put(valueMsg.getBoolean());<NEW_LINE>break;<NEW_LINE>case LONG:<NEW_LINE>attribute = type.asLong().put(valueMsg.getLong());<NEW_LINE>break;<NEW_LINE>case DOUBLE:<NEW_LINE>attribute = type.asDouble().put(valueMsg.getDouble());<NEW_LINE>break;<NEW_LINE>case DATETIME:<NEW_LINE>attribute = type.asDateTime().put(Instant.ofEpochMilli(valueMsg.getDatetime()).atZone(ZoneId.of("Z")).toLocalDateTime());<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw TypeDBException.of(INVALID_DATA);<NEW_LINE>}<NEW_LINE>recordAttributeIDMapping(attribute.getIID(<MASK><NEW_LINE>status.attributeCount.incrementAndGet();<NEW_LINE>} | ), attrMsg.getId()); |
915,438 | public String convertIndexToColorName(int colorIndex) {<NEW_LINE>SparseArray<String> colors = new SparseArray<>();<NEW_LINE>colors.put(0, "green");<NEW_LINE><MASK><NEW_LINE>colors.put(2, "red");<NEW_LINE>colors.put(3, "blue");<NEW_LINE>colors.put(4, "indigo");<NEW_LINE>colors.put(5, "blue-grey");<NEW_LINE>colors.put(6, "cyan");<NEW_LINE>colors.put(7, "teal");<NEW_LINE>colors.put(8, "purple");<NEW_LINE>colors.put(9, "deep-purple");<NEW_LINE>colors.put(10, "lime");<NEW_LINE>colors.put(11, "pink");<NEW_LINE>colors.put(12, "light-blue");<NEW_LINE>colors.put(13, "light-green");<NEW_LINE>colors.put(14, "deep-orange");<NEW_LINE>colors.put(15, "brown");<NEW_LINE>colors.put(16, "amber");<NEW_LINE>String colorName = colors.get(colorIndex);<NEW_LINE>if (colorName != null)<NEW_LINE>return colorName;<NEW_LINE>else<NEW_LINE>return "green";<NEW_LINE>} | colors.put(1, "orange"); |
386,568 | public synchronized boolean startup(@NonNull final RunMode runMode) {<NEW_LINE>//<NEW_LINE>// Check if already started<NEW_LINE>// NOTE: we can't rely on log != null, because the start could be canceled after log was initialized<NEW_LINE>if (started) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>// needed<NEW_LINE>startAddOns();<NEW_LINE>//<NEW_LINE>// Setup context provider (task 08859)<NEW_LINE>if (RunMode.SWING_CLIENT == runMode) {<NEW_LINE>Env.setContextProvider(new SwingContextProvider());<NEW_LINE>} else if (RunMode.BACKEND == runMode) {<NEW_LINE>Env.setContextProvider(new ThreadLocalContextProvider());<NEW_LINE>} else {<NEW_LINE>// don't set the context provider but assume it was already configured.<NEW_LINE>}<NEW_LINE>Env.initContextProvider();<NEW_LINE>Services.setServiceNameAutoDetectPolicy(new DefaultServiceNamePolicy());<NEW_LINE>Check.setDefaultExClass(AdempiereException.class);<NEW_LINE>// task 06952<NEW_LINE>Services.getInterceptor().registerInterceptor(Cached.class, new CacheInterceptor());<NEW_LINE>// NOTE: this method is called more then one, which leads to multiple Services instances.<NEW_LINE>// If those services contains internal variables (for state) we will have different service implementations with different states<NEW_LINE>// which will lead us to weird behaviour<NEW_LINE>// So, instead of manually instantiating and registering here the services, it's much more safer to use AutodetectServices.<NEW_LINE>Services.setAutodetectServices(true);<NEW_LINE>// we need this during AIT<NEW_LINE>Services.registerService(IDeveloperModeBL.class, DeveloperModeBL.instance);<NEW_LINE>final boolean runmodeClient = runMode == RunMode.SWING_CLIENT;<NEW_LINE>LogManager.initialize(runmodeClient);<NEW_LINE>Ini.setRunMode(runMode);<NEW_LINE>// Greeting<NEW_LINE>logger.info(getSummaryAscii());<NEW_LINE>// System properties<NEW_LINE>Ini.loadProperties();<NEW_LINE>// Update logging configuration from Ini file (applies only if we are running the swing client)<NEW_LINE>if (runmodeClient) {<NEW_LINE>LogManager.updateConfigurationFromIni();<NEW_LINE>} else {<NEW_LINE>LogManager.setLevel(Level.INFO);<NEW_LINE>}<NEW_LINE>// Set UI<NEW_LINE>if (runmodeClient) {<NEW_LINE>if (logger.isTraceEnabled()) {<NEW_LINE>logger.trace(<MASK><NEW_LINE>}<NEW_LINE>// metas: load plaf from last session<NEW_LINE>AdempierePLAF.setPLAF();<NEW_LINE>}<NEW_LINE>// Set Default Database Connection from Ini<NEW_LINE>DB.setDBTarget(CConnection.get());<NEW_LINE>// metas<NEW_LINE>MLanguage.setBaseLanguage();<NEW_LINE>// startAddOns(); // metas<NEW_LINE>// if (isClient) // don't test connection<NEW_LINE>// return false; // need to call<NEW_LINE>//<NEW_LINE>// return startupEnvironment(isClient);<NEW_LINE>started = true;<NEW_LINE>final boolean rv;<NEW_LINE>if (runmodeClient) {<NEW_LINE>rv = false;<NEW_LINE>} else {<NEW_LINE>rv = startupEnvironment(runMode);<NEW_LINE>}<NEW_LINE>return rv;<NEW_LINE>} | "{}", System.getProperties()); |
140,458 | @Path("/{paymentId:" + UUID_PATTERN + "}/" + CUSTOM_FIELDS)<NEW_LINE>@Consumes(APPLICATION_JSON)<NEW_LINE>@Produces(APPLICATION_JSON)<NEW_LINE>@ApiOperation(value = "Add custom fields to payment", response = CustomField.class, responseContainer = "List")<NEW_LINE>@ApiResponses(value = { @ApiResponse(code = 201, message = "Custom field created successfully"), @ApiResponse(code = 400, message = "Invalid payment id supplied") })<NEW_LINE>public Response createPaymentCustomFields(@PathParam(ID_PARAM_NAME) final UUID id, final List<CustomFieldJson> customFields, @HeaderParam(HDR_CREATED_BY) final String createdBy, @HeaderParam(HDR_REASON) final String reason, @HeaderParam(HDR_COMMENT) final String comment, @javax.ws.rs.core.Context final HttpServletRequest request, @javax.ws.rs.core.Context final UriInfo uriInfo) throws CustomFieldApiException {<NEW_LINE>return super.createCustomFields(id, customFields, context.createCallContextNoAccountId(createdBy, reason, comment<MASK><NEW_LINE>} | , request), uriInfo, request); |
866,805 | public final void evaluateTrue(MatchedEventMap matchEvent, EvalStateNode fromNode, boolean isQuitted, EventBean optionalTriggeringEvent) {<NEW_LINE>AgentInstanceContext agentInstanceContext = evalFollowedByNode<MASK><NEW_LINE>Integer index = nodes.get(fromNode);<NEW_LINE>agentInstanceContext.getInstrumentationProvider().qPatternFollowedByEvaluateTrue(evalFollowedByNode.factoryNode, matchEvent, index);<NEW_LINE>if (isQuitted) {<NEW_LINE>nodes.remove(fromNode);<NEW_LINE>}<NEW_LINE>// the node may already have quit as a result of an outer state quitting this state,<NEW_LINE>// however the callback may still be received; It is fine to ignore this callback.<NEW_LINE>if (index == null) {<NEW_LINE>agentInstanceContext.getInstrumentationProvider().aPatternFollowedByEvaluateTrue(false);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// If the match came from the very last filter, need to escalate<NEW_LINE>int numChildNodes = evalFollowedByNode.getChildNodes().length;<NEW_LINE>boolean isFollowedByQuitted = false;<NEW_LINE>if (index == (numChildNodes - 1)) {<NEW_LINE>if (nodes.isEmpty()) {<NEW_LINE>isFollowedByQuitted = true;<NEW_LINE>agentInstanceContext.getAuditProvider().patternInstance(false, evalFollowedByNode.factoryNode, agentInstanceContext);<NEW_LINE>}<NEW_LINE>agentInstanceContext.getAuditProvider().patternTrue(evalFollowedByNode.getFactoryNode(), this, matchEvent, isFollowedByQuitted, agentInstanceContext);<NEW_LINE>this.getParentEvaluator().evaluateTrue(matchEvent, this, isFollowedByQuitted, optionalTriggeringEvent);<NEW_LINE>} else {<NEW_LINE>// Else start a new sub-expression for the next-in-line filter<NEW_LINE>EvalNode child = evalFollowedByNode.getChildNodes()[index + 1];<NEW_LINE>EvalStateNode childState = child.newState(this);<NEW_LINE>nodes.put(childState, index + 1);<NEW_LINE>childState.start(matchEvent);<NEW_LINE>}<NEW_LINE>agentInstanceContext.getInstrumentationProvider().aPatternFollowedByEvaluateTrue(isFollowedByQuitted);<NEW_LINE>} | .getContext().getAgentInstanceContext(); |
1,698,909 | public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) {<NEW_LINE>ServerAuthDialogBinding binding = ServerAuthDialogBinding.inflate(requireActivity().getLayoutInflater());<NEW_LINE>dialogView = binding.getRoot();<NEW_LINE>Settings generalSettings = settingsProvider.getUnprotectedSettings();<NEW_LINE>binding.usernameEdit.setText(generalSettings.getString(ProjectKeys.KEY_USERNAME));<NEW_LINE>binding.passwordEdit.setText(generalSettings.getString(ProjectKeys.KEY_PASSWORD));<NEW_LINE>return new MaterialAlertDialogBuilder(requireContext()).setTitle(R.string.server_requires_auth).setMessage(requireContext().getString(R.string.server_auth_credentials, generalSettings.getString(ProjectKeys.KEY_SERVER_URL))).setView(dialogView).setPositiveButton(R.string.ok, (dialogInterface, i) -> {<NEW_LINE>generalSettings.save(ProjectKeys.KEY_USERNAME, binding.usernameEdit.<MASK><NEW_LINE>generalSettings.save(ProjectKeys.KEY_PASSWORD, binding.passwordEdit.getText().toString());<NEW_LINE>}).create();<NEW_LINE>} | getText().toString()); |
113,099 | private void initializeMetaIfNeeded() throws IOException {<NEW_LINE>if (!this.metaStore.exists(SnapshotManager.QUERY_SNAPSHOT_INFO_PATH)) {<NEW_LINE>SnapshotInfo snapshotInfo = new SnapshotInfo(-1L, -1L);<NEW_LINE>byte[] b = this.objectMapper.writeValueAsBytes(snapshotInfo);<NEW_LINE>this.metaStore.<MASK><NEW_LINE>}<NEW_LINE>if (!this.metaStore.exists(SnapshotManager.WRITE_SNAPSHOT_ID_PATH)) {<NEW_LINE>byte[] b = this.objectMapper.writeValueAsBytes(0L);<NEW_LINE>this.metaStore.write(SnapshotManager.WRITE_SNAPSHOT_ID_PATH, b);<NEW_LINE>}<NEW_LINE>if (!this.metaStore.exists(SnapshotManager.QUEUE_OFFSETS_PATH)) {<NEW_LINE>int queueCount = CommonConfig.INGESTOR_QUEUE_COUNT.get(this.configs);<NEW_LINE>List<Long> offsets = new ArrayList<>(queueCount);<NEW_LINE>for (int i = 0; i < queueCount; i++) {<NEW_LINE>offsets.add(-1L);<NEW_LINE>}<NEW_LINE>byte[] b = this.objectMapper.writeValueAsBytes(offsets);<NEW_LINE>this.metaStore.write(SnapshotManager.QUEUE_OFFSETS_PATH, b);<NEW_LINE>}<NEW_LINE>if (!this.metaStore.exists(IdAllocator.ID_ALLOCATE_INFO_PATH)) {<NEW_LINE>byte[] b = this.objectMapper.writeValueAsBytes(0L);<NEW_LINE>this.metaStore.write(IdAllocator.ID_ALLOCATE_INFO_PATH, b);<NEW_LINE>}<NEW_LINE>if (!this.metaStore.exists(BackupManager.GLOBAL_BACKUP_ID_PATH)) {<NEW_LINE>byte[] b = this.objectMapper.writeValueAsBytes(0);<NEW_LINE>this.metaStore.write(BackupManager.GLOBAL_BACKUP_ID_PATH, b);<NEW_LINE>}<NEW_LINE>if (!this.metaStore.exists(BackupManager.BACKUP_INFO_PATH)) {<NEW_LINE>List<BackupInfo> backupInfoList = new ArrayList<>();<NEW_LINE>byte[] b = this.objectMapper.writeValueAsBytes(backupInfoList);<NEW_LINE>this.metaStore.write(BackupManager.BACKUP_INFO_PATH, b);<NEW_LINE>}<NEW_LINE>} | write(SnapshotManager.QUERY_SNAPSHOT_INFO_PATH, b); |
775,210 | public OpenAPI parse(io.swagger.v3.oas.annotations.Operation apiOperation, Operation operation, OpenAPI openAPI, MethodAttributes methodAttributes) {<NEW_LINE>Components components = openAPI.getComponents();<NEW_LINE><MASK><NEW_LINE>if (StringUtils.isNotBlank(apiOperation.summary()))<NEW_LINE>operation.setSummary(propertyResolverUtils.resolve(apiOperation.summary(), locale));<NEW_LINE>if (StringUtils.isNotBlank(apiOperation.description()))<NEW_LINE>operation.setDescription(propertyResolverUtils.resolve(apiOperation.description(), locale));<NEW_LINE>if (StringUtils.isNotBlank(apiOperation.operationId()))<NEW_LINE>operation.setOperationId(getOperationId(apiOperation.operationId(), openAPI));<NEW_LINE>if (apiOperation.deprecated())<NEW_LINE>operation.setDeprecated(apiOperation.deprecated());<NEW_LINE>buildTags(apiOperation, operation);<NEW_LINE>if (// if not set in root annotation<NEW_LINE>operation.getExternalDocs() == null)<NEW_LINE>AnnotationsUtils.getExternalDocumentation(apiOperation.externalDocs()).ifPresent(operation::setExternalDocs);<NEW_LINE>// servers<NEW_LINE>AnnotationsUtils.getServers(apiOperation.servers()).ifPresent(servers -> servers.forEach(operation::addServersItem));<NEW_LINE>// build parameters<NEW_LINE>for (io.swagger.v3.oas.annotations.Parameter parameterDoc : apiOperation.parameters()) {<NEW_LINE>Parameter parameter = parameterBuilder.buildParameterFromDoc(parameterDoc, components, methodAttributes.getJsonViewAnnotation(), locale);<NEW_LINE>operation.addParametersItem(parameter);<NEW_LINE>}<NEW_LINE>// RequestBody in Operation<NEW_LINE>requestBodyService.buildRequestBodyFromDoc(apiOperation.requestBody(), operation.getRequestBody(), methodAttributes, components).ifPresent(operation::setRequestBody);<NEW_LINE>// build response<NEW_LINE>buildResponse(components, apiOperation, operation, methodAttributes);<NEW_LINE>// security<NEW_LINE>securityParser.buildSecurityRequirement(apiOperation.security(), operation);<NEW_LINE>// Extensions in Operation<NEW_LINE>buildExtensions(apiOperation, operation);<NEW_LINE>return openAPI;<NEW_LINE>} | Locale locale = methodAttributes.getLocale(); |
721,556 | public void run() {<NEW_LINE>try {<NEW_LINE>log.info("Running {}", getName());<NEW_LINE>DatabaseSecurityFormData dbData = new DatabaseSecurityFormData();<NEW_LINE>Universe universe = Universe.getOrBadRequest(taskParams().universeUUID);<NEW_LINE>if (taskParams().primaryCluster.userIntent.enableYCQL && taskParams().primaryCluster.userIntent.enableYCQLAuth) {<NEW_LINE>dbData.ycqlCurrAdminPassword = taskParams().ycqlCurrentPassword;<NEW_LINE>dbData.ycqlAdminUsername = taskParams().ycqlUserName;<NEW_LINE>dbData.ycqlAdminPassword = taskParams().ycqlNewPassword;<NEW_LINE>try {<NEW_LINE>// Check if the password already works.<NEW_LINE>ycqlQueryExecutor.validateAdminPassword(universe, dbData);<NEW_LINE>log.info("YCQL password is already updated");<NEW_LINE>} catch (PlatformServiceException e) {<NEW_LINE>if (e.getResult().status() == Http.Status.UNAUTHORIZED) {<NEW_LINE>log.info("Updating YCQL password");<NEW_LINE>ycqlQueryExecutor.updateAdminPassword(universe, dbData);<NEW_LINE>} else {<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (taskParams().primaryCluster.userIntent.enableYSQL && taskParams().primaryCluster.userIntent.enableYSQLAuth) {<NEW_LINE>dbData<MASK><NEW_LINE>dbData.ysqlCurrAdminPassword = taskParams().ysqlCurrentPassword;<NEW_LINE>dbData.ysqlAdminUsername = taskParams().ysqlUserName;<NEW_LINE>dbData.ysqlAdminPassword = taskParams().ysqlNewPassword;<NEW_LINE>try {<NEW_LINE>// Check if the password already works.<NEW_LINE>ysqlQueryExecutor.validateAdminPassword(universe, dbData);<NEW_LINE>log.info("YSQL password is already updated");<NEW_LINE>} catch (PlatformServiceException e) {<NEW_LINE>if (e.getResult().status() == Http.Status.UNAUTHORIZED) {<NEW_LINE>log.info("Updating YSQL password");<NEW_LINE>ysqlQueryExecutor.updateAdminPassword(universe, dbData);<NEW_LINE>} else {<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>String msg = getName() + " failed with exception " + e.getMessage();<NEW_LINE>log.warn(msg, e.getMessage());<NEW_LINE>throw new RuntimeException(msg, e);<NEW_LINE>}<NEW_LINE>} | .dbName = taskParams().ysqlDbName; |
470,775 | void processExtends(HashMapWrappedVirtualObject minBounds, HashMapWrappedVirtualObject maxBounds, double[] transformationMatrix, DoubleBuffer vertices, int index, GenerateGeometryResult generateGeometryResult) throws BimserverDatabaseException {<NEW_LINE>double x = vertices.get(index);<NEW_LINE>double y = vertices.get(index + 1);<NEW_LINE>double z = vertices.get(index + 2);<NEW_LINE>double[] result = new double[4];<NEW_LINE>Matrix.multiplyMV(result, 0, transformationMatrix, 0, new double[] { x, y, z, 1 }, 0);<NEW_LINE>x = result[0];<NEW_LINE>y = result[1];<NEW_LINE>z = result[2];<NEW_LINE>minBounds.set("x", Math.min(x, (double) minBounds.eGet("x")));<NEW_LINE>minBounds.set("y", Math.min(y, (double) minBounds.eGet("y")));<NEW_LINE>minBounds.set("z", Math.min(z, (double) minBounds.eGet("z")));<NEW_LINE>maxBounds.set("x", Math.max(x, (double) maxBounds.eGet("x")));<NEW_LINE>maxBounds.set("y", Math.max(y, (double) maxBounds.eGet("y")));<NEW_LINE>maxBounds.set("z", Math.max(z, (double) maxBounds.eGet("z")));<NEW_LINE>generateGeometryResult.setMinX(Math.min(x, generateGeometryResult.getMinX()));<NEW_LINE>generateGeometryResult.setMinY(Math.min(y, generateGeometryResult.getMinY()));<NEW_LINE>generateGeometryResult.setMinZ(Math.min(z<MASK><NEW_LINE>generateGeometryResult.setMaxX(Math.max(x, generateGeometryResult.getMaxX()));<NEW_LINE>generateGeometryResult.setMaxY(Math.max(y, generateGeometryResult.getMaxY()));<NEW_LINE>generateGeometryResult.setMaxZ(Math.max(z, generateGeometryResult.getMaxZ()));<NEW_LINE>} | , generateGeometryResult.getMinZ())); |
276,465 | protected void executeBoundaryEvents(Collection<BoundaryEvent> boundaryEvents, ExecutionEntity execution) {<NEW_LINE>// The parent execution becomes a scope, and a child execution is created for each of the boundary events<NEW_LINE>for (BoundaryEvent boundaryEvent : boundaryEvents) {<NEW_LINE>if (CollectionUtil.isEmpty(boundaryEvent.getEventDefinitions()) || (boundaryEvent.getEventDefinitions().get(0) instanceof CompensateEventDefinition)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// A Child execution of the current execution is created to represent the boundary event being active<NEW_LINE>ExecutionEntity childExecutionEntity = commandContext.getExecutionEntityManager().createChildExecution((ExecutionEntity) execution);<NEW_LINE>childExecutionEntity.setParentId(execution.getId());<NEW_LINE>childExecutionEntity.setCurrentFlowElement(boundaryEvent);<NEW_LINE>childExecutionEntity.setScope(false);<NEW_LINE>ActivityBehavior boundaryEventBehavior = ((<MASK><NEW_LINE>logger.debug("Executing boundary event activityBehavior {} with execution {}", boundaryEventBehavior.getClass(), childExecutionEntity.getId());<NEW_LINE>boundaryEventBehavior.execute(childExecutionEntity);<NEW_LINE>}<NEW_LINE>} | ActivityBehavior) boundaryEvent.getBehavior()); |
135,108 | final DeleteSuppressedDestinationResult executeDeleteSuppressedDestination(DeleteSuppressedDestinationRequest deleteSuppressedDestinationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteSuppressedDestinationRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteSuppressedDestinationRequest> request = null;<NEW_LINE>Response<DeleteSuppressedDestinationResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteSuppressedDestinationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteSuppressedDestinationRequest));<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, "SESv2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteSuppressedDestination");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteSuppressedDestinationResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteSuppressedDestinationResultJsonUnmarshaller());<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.endEvent(Field.RequestMarshallTime); |
847,174 | // Read characters into a portion of an array.<NEW_LINE>@Override<NEW_LINE>public int read(char[] cbuf, int off, int rlen) throws IOException {<NEW_LINE>if (!_ready) {<NEW_LINE>throw new IOException(this.getClass().getName() + " is closed");<NEW_LINE>}<NEW_LINE>if (_state != 0)<NEW_LINE>return -1;<NEW_LINE>int dstPos = off;<NEW_LINE>int needed = rlen;<NEW_LINE>while (needed > 0) {<NEW_LINE>// read input until we get a translatable character<NEW_LINE>if (this._outBufPos >= this._outBufEnd) {<NEW_LINE>this.loadNextBuffer();<NEW_LINE>}<NEW_LINE>if (this._outBufPos >= this._outBufEnd) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>int xfer = this._outBufEnd - this._outBufPos;<NEW_LINE>if (xfer > needed)<NEW_LINE>xfer = needed;<NEW_LINE>System.arraycopy(this._outbuf, this.<MASK><NEW_LINE>this._outBufPos += xfer;<NEW_LINE>dstPos += xfer;<NEW_LINE>needed -= xfer;<NEW_LINE>}<NEW_LINE>return dstPos;<NEW_LINE>} | _outBufPos, cbuf, dstPos, xfer); |
1,337,708 | protected void extraClinitLookup(SkinnyMethodAdapter m) {<NEW_LINE>// extract cached ctors for lookup ordering<NEW_LINE>// note: consume top of stack, lookuparray<NEW_LINE>m.newobj(p(JCtorCache.class));<NEW_LINE>// jccache, lookuparray, jccache<NEW_LINE>m.dup_x1();<NEW_LINE>// jccache, jccache, lookuparray<NEW_LINE>m.swap();<NEW_LINE>// ctor fields = index 2<NEW_LINE>m.pushInt(2);<NEW_LINE>// extract ctors, -> jccache, jccache, ctor[]<NEW_LINE>m.aaload();<NEW_LINE>m.checkcast(p(JavaConstructor[].class));<NEW_LINE>m.invokespecial(p(JCtorCache.class), "<init>", sig(void.class, JavaConstructor[].class));<NEW_LINE>m.putstatic(javaPath, RUBY_CTOR_CACHE_FIELD, ci(JCtorCache.class));<NEW_LINE>// now create proxy class<NEW_LINE>m.getstatic(javaPath, RUBY_FIELD, ci(Ruby.class));<NEW_LINE>m.getstatic(javaPath, RUBY_CLASS_FIELD, ci(RubyClass.class));<NEW_LINE>m.ldc(org.objectweb.asm.Type.getType("L" + javaPath + ";"));<NEW_LINE>// if (simpleAlloc) // if simple, don't init, if complex, do init<NEW_LINE>// m.iconst_0(); // false (as int)<NEW_LINE>// else<NEW_LINE>// true (as int)<NEW_LINE>m.iconst_1();<NEW_LINE>m.invokestatic(p(JavaProxyClass.class), "setProxyClassReified", sig(JavaProxyClass.class, Ruby.class, RubyClass.class, Class.class, boolean.class));<NEW_LINE>m.dup();<NEW_LINE>m.putstatic(javaPath, RUBY_PROXY_CLASS_FIELD, ci(JavaProxyClass.class));<NEW_LINE>supers.forEach((name, sigs) -> {<NEW_LINE>for (String sig : sigs) {<NEW_LINE>m.dup();<NEW_LINE>m.ldc(name);<NEW_LINE>m.ldc(sig);<NEW_LINE>m.iconst_1();<NEW_LINE>m.invokevirtual(p(JavaProxyClass.class), "initMethod", sig(void.class, String.class, String<MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>m.pop();<NEW_LINE>// Note: no end, that's in the parent call<NEW_LINE>} | .class, boolean.class)); |
1,643,661 | private void doStartAndFire(ShellSession nss) {<NEW_LINE>synchronized (this) {<NEW_LINE>this.shellSession = nss;<NEW_LINE>starting = true;<NEW_LINE>}<NEW_LINE>Pair<ShellSession, Task> res = nss.start();<NEW_LINE>nss.getModel().addConsoleListener(new ConsoleListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void executing(ConsoleEvent e) {<NEW_LINE>fireExecuting(<MASK><NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void sectionCreated(ConsoleEvent e) {<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void sectionUpdated(ConsoleEvent e) {<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void closed(ConsoleEvent e) {<NEW_LINE>}<NEW_LINE>});<NEW_LINE>ShellSession previous = res.first();<NEW_LINE>if (previous != null) {<NEW_LINE>previous.removePropertyChangeListener(shellL);<NEW_LINE>}<NEW_LINE>nss.addPropertyChangeListener(shellL);<NEW_LINE>ShellEvent event = new ShellEvent(this, nss, previous);<NEW_LINE>fireShellStatus(event);<NEW_LINE>res.second().addTaskListener(e -> {<NEW_LINE>synchronized (this) {<NEW_LINE>starting = false;<NEW_LINE>if (shellSession != nss) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (nss.isValid() && nss.isActive()) {<NEW_LINE>fireShellStarted(event);<NEW_LINE>}<NEW_LINE>fireShellStatus(event);<NEW_LINE>});<NEW_LINE>} | nss, e.isStart()); |
364,346 | public static void run(String consumerKey, String consumerSecret, String token, String secret) throws InterruptedException {<NEW_LINE>// Create an appropriately sized blocking queue<NEW_LINE>BlockingQueue<String> queue = new LinkedBlockingQueue<String>(10000);<NEW_LINE>// Define our endpoint: By default, delimited=length is set (we need this for our processor)<NEW_LINE>// and stall warnings are on.<NEW_LINE>StatusesSampleEndpoint endpoint = new StatusesSampleEndpoint();<NEW_LINE>endpoint.stallWarnings(false);<NEW_LINE>Authentication auth = new OAuth1(<MASK><NEW_LINE>// Authentication auth = new com.twitter.hbc.httpclient.auth.BasicAuth(username, password);<NEW_LINE>// Create a new BasicClient. By default gzip is enabled.<NEW_LINE>BasicClient client = new ClientBuilder().name("sampleExampleClient").hosts(Constants.STREAM_HOST).endpoint(endpoint).authentication(auth).processor(new StringDelimitedProcessor(queue)).build();<NEW_LINE>// Establish a connection<NEW_LINE>client.connect();<NEW_LINE>// Do whatever needs to be done with messages<NEW_LINE>for (int msgRead = 0; msgRead < 1000; msgRead++) {<NEW_LINE>if (client.isDone()) {<NEW_LINE>System.out.println("Client connection closed unexpectedly: " + client.getExitEvent().getMessage());<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>String msg = queue.poll(5, TimeUnit.SECONDS);<NEW_LINE>if (msg == null) {<NEW_LINE>System.out.println("Did not receive a message in 5 seconds");<NEW_LINE>} else {<NEW_LINE>System.out.println(msg);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>client.stop();<NEW_LINE>// Print some stats<NEW_LINE>System.out.printf("The client read %d messages!\n", client.getStatsTracker().getNumMessages());<NEW_LINE>} | consumerKey, consumerSecret, token, secret); |
1,690,715 | protected void paintIcon(Graphics2D g2) {<NEW_LINE>final var discCol = myType == FILE_SAVE_AS ? Color.GRAY : Color.BLUE;<NEW_LINE>var bds = getScaled(2, 2, 12, 12);<NEW_LINE>g2.setColor(discCol);<NEW_LINE>g2.fillRect(bds.getX(), bds.getY(), bds.getWidth(), bds.getHeight());<NEW_LINE>g2.setColor(Color.YELLOW);<NEW_LINE>bds = getScaled(4, 2, 8, 7);<NEW_LINE>g2.fillRect(bds.getX(), bds.getY(), bds.getWidth(), bds.getHeight());<NEW_LINE>g2.setColor(Color.LIGHT_GRAY);<NEW_LINE>bds = getScaled(6, 10, 4, 4);<NEW_LINE>g2.fillRect(bds.getX(), bds.getY(), bds.getWidth(), bds.getHeight());<NEW_LINE>g2.setColor(Color.BLACK);<NEW_LINE>bds = getScaled(8, 11, 1, 2);<NEW_LINE>g2.fillRect(bds.getX(), bds.getY(), bds.getWidth(), bds.getHeight());<NEW_LINE>g2.setColor(Color.MAGENTA);<NEW_LINE>final int[] xPoints;<NEW_LINE>final int[] yPoints;<NEW_LINE>switch(myType) {<NEW_LINE>case FILE_OPEN:<NEW_LINE>xPoints = new int[7];<NEW_LINE>yPoints = new int[7];<NEW_LINE>for (var i = 0; i < 7; i++) {<NEW_LINE>xPoints[i] = AppPreferences.getScaled(arrowUp[i * 2]);<NEW_LINE>yPoints[i] = AppPreferences.getScaled(arrowUp[i * 2 + 1]);<NEW_LINE>}<NEW_LINE>g2.<MASK><NEW_LINE>break;<NEW_LINE>case FILE_SAVE_AS:<NEW_LINE>case FILE_SAVE:<NEW_LINE>xPoints = new int[7];<NEW_LINE>yPoints = new int[7];<NEW_LINE>for (var i = 0; i < 7; i++) {<NEW_LINE>xPoints[i] = AppPreferences.getScaled(arrowDown[i * 2]);<NEW_LINE>yPoints[i] = AppPreferences.getScaled(arrowDown[i * 2 + 1]);<NEW_LINE>}<NEW_LINE>g2.fillPolygon(xPoints, yPoints, 7);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>// do nothing. should not really happen.<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} | fillPolygon(xPoints, yPoints, 7); |
1,783,560 | final DescribeDBInstancesResult executeDescribeDBInstances(DescribeDBInstancesRequest describeDBInstancesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeDBInstancesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeDBInstancesRequest> request = null;<NEW_LINE>Response<DescribeDBInstancesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeDBInstancesRequestMarshaller().marshall<MASK><NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "RDS");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeDBInstances");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DescribeDBInstancesResult> responseHandler = new StaxResponseHandler<DescribeDBInstancesResult>(new DescribeDBInstancesResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | (super.beforeMarshalling(describeDBInstancesRequest)); |
1,408,365 | private static // method declaration's throws clause to declare the new checked exceptions<NEW_LINE>void fixThrows(VisitorState state, SuggestedFix.Builder fix) {<NEW_LINE>MethodTree methodTree = state.findEnclosing(MethodTree.class);<NEW_LINE>if (methodTree == null || methodTree.getThrows().isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ImmutableMap.Builder<Type, ExpressionTree<MASK><NEW_LINE>for (ExpressionTree e : methodTree.getThrows()) {<NEW_LINE>thrown.put(ASTHelpers.getType(e), e);<NEW_LINE>}<NEW_LINE>UnhandledResult<ExpressionTree> result = unhandled(thrown.buildOrThrow(), state);<NEW_LINE>if (result.unhandled.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>List<String> newThrows = new ArrayList<>();<NEW_LINE>for (Type handle : result.unhandled) {<NEW_LINE>newThrows.add(handle.tsym.getSimpleName().toString());<NEW_LINE>}<NEW_LINE>Collections.sort(newThrows);<NEW_LINE>fix.postfixWith(Iterables.getLast(methodTree.getThrows()), ", " + Joiner.on(", ").join(newThrows));<NEW_LINE>// the other exceptions are in java.lang<NEW_LINE>fix.addImport("java.lang.reflect.InvocationTargetException");<NEW_LINE>} | > thrown = ImmutableMap.builder(); |
68,740 | public void keyPressed(java.awt.event.KeyEvent e) {<NEW_LINE>if (changingPage)<NEW_LINE>return;<NEW_LINE>int deltaPage = 0;<NEW_LINE>int keyCode = e.getKeyCode();<NEW_LINE>if (keyCode == java.awt.event.KeyEvent.VK_PAGE_DOWN) {<NEW_LINE>deltaPage = documentView.getPreviousPageIncrement();<NEW_LINE>} else if (keyCode == java.awt.event.KeyEvent.VK_PAGE_UP) {<NEW_LINE>deltaPage = -documentView.getNextPageIncrement();<NEW_LINE>} else if (keyCode == java.awt.event.KeyEvent.VK_HOME) {<NEW_LINE>deltaPage = -controller.getCurrentPageNumber();<NEW_LINE>} else if (keyCode == java.awt.event.KeyEvent.VK_END) {<NEW_LINE>deltaPage = controller.getDocument().getNumberOfPages() <MASK><NEW_LINE>}<NEW_LINE>if (deltaPage == 0)<NEW_LINE>return;<NEW_LINE>int newPage = controller.getCurrentPageNumber() + deltaPage;<NEW_LINE>if (controller.getDocument() == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (newPage < 0) {<NEW_LINE>deltaPage = -controller.getCurrentPageNumber();<NEW_LINE>}<NEW_LINE>if (newPage >= controller.getDocument().getNumberOfPages()) {<NEW_LINE>deltaPage = controller.getDocument().getNumberOfPages() - controller.getCurrentPageNumber() - 1;<NEW_LINE>}<NEW_LINE>changingPage = true;<NEW_LINE>final int dp = deltaPage;<NEW_LINE>SwingUtilities.invokeLater(new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>changingPage = false;<NEW_LINE>controller.goToDeltaPage(dp);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | - controller.getCurrentPageNumber() - 1; |
905,058 | public static double calculatePosteriorMode(final List<Double> samples, final JavaSparkContext ctx) {<NEW_LINE>Utils.nonNull(samples);<NEW_LINE>Utils.validateArg(samples.size() > 0, "Number of samples must be greater than zero.");<NEW_LINE>// calculate sample min, max, mean, and standard deviation<NEW_LINE>final double sampleMin = Collections.min(samples);<NEW_LINE>final double sampleMax = Collections.max(samples);<NEW_LINE>final double sampleMean = new Mean().evaluate(Doubles.toArray(samples));<NEW_LINE>final double sampleStandardDeviation = new StandardDeviation().evaluate(Doubles.toArray(samples));<NEW_LINE>// if samples are all the same or contain NaN, can simply return mean<NEW_LINE>if (sampleStandardDeviation == 0. || Double.isNaN(sampleMean)) {<NEW_LINE>return sampleMean;<NEW_LINE>}<NEW_LINE>// use Silverman's rule to set bandwidth for kernel density estimation from sample standard deviation<NEW_LINE>// see https://en.wikipedia.org/wiki/Kernel_density_estimation#Practical_estimation_of_the_bandwidth<NEW_LINE>final double bandwidth = SILVERMANS_RULE_CONSTANT * sampleStandardDeviation * Math.pow(samples.size(), SILVERMANS_RULE_EXPONENT);<NEW_LINE>// use kernel density estimation to approximate posterior from samples<NEW_LINE>final KernelDensity pdf = new KernelDensity().setSample(ctx.parallelize(samples, 1)).setBandwidth(bandwidth);<NEW_LINE>// use Brent optimization to find mode (i.e., maximum) of kernel-density-estimated posterior<NEW_LINE>final BrentOptimizer optimizer = new BrentOptimizer(RELATIVE_TOLERANCE, <MASK><NEW_LINE>final UnivariateObjectiveFunction objective = new UnivariateObjectiveFunction(f -> pdf.estimate(new double[] { f })[0]);<NEW_LINE>// search for mode within sample range, start near sample mean<NEW_LINE>final SearchInterval searchInterval = new SearchInterval(sampleMin, sampleMax, sampleMean);<NEW_LINE>return optimizer.optimize(objective, GoalType.MAXIMIZE, searchInterval, BRENT_MAX_EVAL).getPoint();<NEW_LINE>} | RELATIVE_TOLERANCE * (sampleMax - sampleMin)); |
1,840,070 | private Map<File, File> buildgetInjarsOutjarsMap() {<NEW_LINE>TransformOutputProvider outputProvider = invocation.getOutputProvider();<NEW_LINE>Preconditions.checkNotNull(outputProvider);<NEW_LINE>// if (!invocation.isIncremental()) {<NEW_LINE>// outputProvider.deleteAll();<NEW_LINE>// }<NEW_LINE>ImmutableMap.Builder<File, File> builder = ImmutableMap.builder();<NEW_LINE>for (TransformInput input : invocation.getInputs()) {<NEW_LINE>for (DirectoryInput dirInput : input.getDirectoryInputs()) {<NEW_LINE>Path output = getOutputPath(invocation.getOutputProvider(), dirInput);<NEW_LINE>// if (!dirInput.getFile().isDirectory()) {<NEW_LINE>// PathUtils.deleteIfExists(output);<NEW_LINE>// }<NEW_LINE>Path dirPath = dirInput.getFile().toPath();<NEW_LINE>builder.put(dirPath.toFile(), output.toFile());<NEW_LINE>}<NEW_LINE>for (JarInput jarInput : input.getJarInputs()) {<NEW_LINE>if (invocation.isIncremental() && jarInput.getStatus() == Status.NOTCHANGED) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Path output = getOutputPath(outputProvider, jarInput);<NEW_LINE>// PathUtils.deleteIfExists(output);<NEW_LINE>Path path = jarInput<MASK><NEW_LINE>builder.put(path.toFile(), output.toFile());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return builder.build();<NEW_LINE>} | .getFile().toPath(); |
994,127 | private // throw exception if unrecoverable errors happen.<NEW_LINE>boolean allocateTaskToBe(RoutineLoadTaskInfo routineLoadTaskInfo) {<NEW_LINE>if (routineLoadTaskInfo.getPreviousBeId() != -1L) {<NEW_LINE>if (routineLoadManager.takeBeTaskSlot(routineLoadTaskInfo.getPreviousBeId()) != -1L) {<NEW_LINE>if (LOG.isDebugEnabled()) {<NEW_LINE>LOG.debug(new LogBuilder(LogKey.ROUTINE_LOAD_TASK, routineLoadTaskInfo.getId()).add("job_id", routineLoadTaskInfo.getJobId()).add("previous_be_id", routineLoadTaskInfo.getPreviousBeId()).add("msg", "task use the previous be id").build());<NEW_LINE>}<NEW_LINE>routineLoadTaskInfo.setBeId(routineLoadTaskInfo.getPreviousBeId());<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// the previous BE is not available, try to find a better one<NEW_LINE>long beId = routineLoadManager.takeBeTaskSlot();<NEW_LINE>if (beId < 0) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>routineLoadTaskInfo.setBeId(beId);<NEW_LINE>if (LOG.isDebugEnabled()) {<NEW_LINE>LOG.debug(new LogBuilder(LogKey.ROUTINE_LOAD_TASK, routineLoadTaskInfo.getId()).add("job_id", routineLoadTaskInfo.getJobId()).add("be_id", routineLoadTaskInfo.getBeId()).add("msg"<MASK><NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | , "task has been allocated to be").build()); |
1,280,992 | private void showColorListDialog() {<NEW_LINE>ArrayAdapter<String> profileAdapter = new ArrayAdapter<>(this, android.<MASK><NEW_LINE>ListPopupWindow listPopup = new ListPopupWindow(this);<NEW_LINE>listPopup.setAdapter(profileAdapter);<NEW_LINE>listPopup.setAnchorView(pulsingCircleColorButton);<NEW_LINE>listPopup.setOnItemClickListener((parent, itemView, position, id) -> {<NEW_LINE>String selectedTrackingType = colorOptionList.get(position);<NEW_LINE>pulsingCircleColorButton.setText(selectedTrackingType);<NEW_LINE>if (colorHashMap.get(selectedTrackingType) != null) {<NEW_LINE>LOCATION_CIRCLE_PULSE_COLOR = colorHashMap.get(selectedTrackingType);<NEW_LINE>setNewLocationComponentOptions(currentPulseDuration, LOCATION_CIRCLE_PULSE_COLOR);<NEW_LINE>}<NEW_LINE>listPopup.dismiss();<NEW_LINE>});<NEW_LINE>listPopup.show();<NEW_LINE>} | R.layout.simple_list_item_1, colorOptionList); |
331,928 | default <U> TypeSafeKey<A, B> discardR(Applicative<U, Iso<A, ?, B, B>> appB) {<NEW_LINE>Iso.Simple<A, B> discarded = Iso.Simple.super.discardR(appB);<NEW_LINE>return new TypeSafeKey<A, B>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public <CoP extends Profunctor<?, ?, ? extends Profunctor<?, ?, ?>>, CoF extends Functor<?, ? extends Functor<?, ?>>, FB extends Functor<B, ? extends CoF>, FT extends Functor<A, ? extends CoF>, PAFB extends Profunctor<B, FB, ? extends CoP>, PSFT extends Profunctor<A, FT, ? extends CoP>> PSFT apply(PAFB pafb) {<NEW_LINE>return discarded.apply(pafb);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public int hashCode() {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean equals(Object obj) {<NEW_LINE>return TypeSafeKey.this.equals(obj);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>} | return TypeSafeKey.this.hashCode(); |
117,244 | public String encryptSecret(String plainText) {<NEW_LINE>if (plainText.length() > MAX_PLAINTEXT_LENGTH) {<NEW_LINE>throw new IllegalArgumentException("Too long text");<NEW_LINE>}<NEW_LINE>byte[] nonce = generateNonce();<NEW_LINE>Cipher cipher = cipher(ENCRYPT_MODE, sharedSecret, nonce);<NEW_LINE>byte[] plainTextBytes = plainText.getBytes(UTF_8);<NEW_LINE>if (plainTextBytes.length > MAX_PLAINTEXT_LENGTH) {<NEW_LINE>throw new IllegalArgumentException("Too long text");<NEW_LINE>}<NEW_LINE>int recordContentsLength = LENGTH_SIZE + plainTextBytes.length;<NEW_LINE>int recordLength = RECORD_SIZE_ALIGNMENT * ((recordContentsLength + RECORD_SIZE_ALIGNMENT - 1) / RECORD_SIZE_ALIGNMENT);<NEW_LINE>byte[<MASK><NEW_LINE>ByteBuffer recordBuffer = ByteBuffer.wrap(recordBytes);<NEW_LINE>recordBuffer.putInt(plainTextBytes.length);<NEW_LINE>recordBuffer.put(plainTextBytes);<NEW_LINE>byte[] cipherText;<NEW_LINE>try {<NEW_LINE>cipherText = cipher.doFinal(recordBytes);<NEW_LINE>} catch (IllegalBlockSizeException | BadPaddingException e) {<NEW_LINE>throw ThrowablesUtil.propagate(e);<NEW_LINE>}<NEW_LINE>byte[] opaque = new byte[WRAPPING_SIZE + cipherText.length];<NEW_LINE>ByteBuffer output = ByteBuffer.wrap(opaque);<NEW_LINE>output.put(NAME_BYTES);<NEW_LINE>output.putInt(VERSION_2);<NEW_LINE>output.putInt(TERM);<NEW_LINE>output.put(nonce);<NEW_LINE>output.put(cipherText);<NEW_LINE>assert output.remaining() == 0;<NEW_LINE>return Base64.getEncoder().encodeToString(opaque);<NEW_LINE>} | ] recordBytes = new byte[recordLength]; |
1,530,738 | private String checkConnect(HttpURLConnection urlConnection) throws IOException, CommandException {<NEW_LINE>int code = urlConnection.getResponseCode();<NEW_LINE>if (logger.isLoggable(Level.FINER)) {<NEW_LINE>logger.log(Level.FINER, "Response code: {0}", code);<NEW_LINE>}<NEW_LINE>if (code == -1) {<NEW_LINE>URL url = urlConnection.getURL();<NEW_LINE>throw new CommandException(STRINGS.get("NotHttpResponse", url.getHost(), url.getPort()));<NEW_LINE>}<NEW_LINE>if (code == HttpURLConnection.HTTP_UNAUTHORIZED) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (code == HttpURLConnection.HTTP_PRECON_FAILED) {<NEW_LINE>throw new CommandValidationException("Code: " + HttpURLConnection.HTTP_PRECON_FAILED + ": Cached CommandModel is invalid.");<NEW_LINE>}<NEW_LINE>if (isStatusRedirection(code)) {<NEW_LINE>return urlConnection.getHeaderField("Location");<NEW_LINE>}<NEW_LINE>if (code != HttpURLConnection.HTTP_OK) {<NEW_LINE>throw new CommandException(STRINGS.get("BadResponse", "" + code, urlConnection.getResponseMessage()));<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | throw new AuthenticationException(reportAuthenticationException()); |
316,906 | private void updateReferenceTimeByLaunchConfig(String region, List<Resource> batch, long since) {<NEW_LINE>LOGGER.info(String.format("Getting the last reference time by launch config for batch of size %d", batch.size()));<NEW_LINE>String batchUrl = getLaunchConfigBatchUrl(region, batch, since);<NEW_LINE>JsonNode batchResult = null;<NEW_LINE>Map<String, Resource> idToResource = Maps.newHashMap();<NEW_LINE>for (Resource resource : batch) {<NEW_LINE>idToResource.put(resource.getId(), resource);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>batchResult = eddaClient.getJsonNodeFromUrl(batchUrl);<NEW_LINE>} catch (IOException e) {<NEW_LINE>LOGGER.error("Failed to get response for the batch.", e);<NEW_LINE>}<NEW_LINE>if (batchResult == null || !batchResult.isArray()) {<NEW_LINE>throw new RuntimeException(String.format("Failed to get valid document from %s, got: %s", batchUrl, batchResult));<NEW_LINE>}<NEW_LINE>for (Iterator<JsonNode> it = batchResult.getElements(); it.hasNext(); ) {<NEW_LINE>JsonNode elem = it.next();<NEW_LINE>JsonNode data = elem.get("data");<NEW_LINE>String imageId = data.get("imageId").getTextValue();<NEW_LINE>String launchConfigurationName = data.get("launchConfigurationName").getTextValue();<NEW_LINE>JsonNode ltimeNode = elem.get("ltime");<NEW_LINE>if (ltimeNode != null && !ltimeNode.isNull()) {<NEW_LINE>long ltime = ltimeNode.asLong();<NEW_LINE>Resource <MASK><NEW_LINE>String lastRefTimeByLC = ami.getAdditionalField(AMI_FIELD_LAST_LC_REF_TIME);<NEW_LINE>if (lastRefTimeByLC == null || Long.parseLong(lastRefTimeByLC) < ltime) {<NEW_LINE>LOGGER.info(String.format("The last time that the image %s was referenced by launch config %s is %d", imageId, launchConfigurationName, ltime));<NEW_LINE>ami.setAdditionalField(AMI_FIELD_LAST_LC_REF_TIME, String.valueOf(ltime));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ami = idToResource.get(imageId); |
1,012,613 | public void read(JmeImporter im) throws IOException {<NEW_LINE>super.read(im);<NEW_LINE>InputCapsule ic = im.getCapsule(this);<NEW_LINE>size = <MASK><NEW_LINE>totalSize = ic.readInt("totalSize", 16);<NEW_LINE>quadrant = ic.readShort("quadrant", (short) 0);<NEW_LINE>stepScale = (Vector3f) ic.readSavable("stepScale", Vector3f.UNIT_XYZ);<NEW_LINE>offset = (Vector2f) ic.readSavable("offset", Vector3f.UNIT_XYZ);<NEW_LINE>offsetAmount = ic.readFloat("offsetAmount", 0);<NEW_LINE>// lodCalculator = (LodCalculator) ic.readSavable("lodCalculator", new DistanceLodCalculator());<NEW_LINE>// lodCalculator.setTerrainPatch(this);<NEW_LINE>// lodCalculatorFactory = (LodCalculatorFactory) ic.readSavable("lodCalculatorFactory", null);<NEW_LINE>lodEntropy = ic.readFloatArray("lodEntropy", null);<NEW_LINE>geomap = (LODGeomap) ic.readSavable("geomap", null);<NEW_LINE>Mesh regen = geomap.createMesh(stepScale, new Vector2f(1, 1), offset, offsetAmount, totalSize, false);<NEW_LINE>setMesh(regen);<NEW_LINE>// TangentBinormalGenerator.generate(this); // note that this will be removed<NEW_LINE>ensurePositiveVolumeBBox();<NEW_LINE>} | ic.readInt("size", 16); |
1,474,900 | public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {<NEW_LINE>_buildInfo.setLocation(_documentLocatorFile, _documentLocator);<NEW_LINE>String schemaSource = _parser.getProperty(AbstractParser.JAXP_SCHEMA_SOURCE).toString();<NEW_LINE>int schemaVersion = Integer.parseInt(schemaSource.substring(schemaSource.length() - 5, schemaSource<MASK><NEW_LINE>if (schemaVersion >= 4) {<NEW_LINE>_buildInfo.setValidateDefaultSizes(true);<NEW_LINE>}<NEW_LINE>} else if (qName.equalsIgnoreCase("product")) {<NEW_LINE>_buildInfo.setProductName(attributes.getValue("name"));<NEW_LINE>_buildInfo.setProductRelease(attributes.getValue("release"));<NEW_LINE>} else if (qName.equalsIgnoreCase("repositoryBranch")) {<NEW_LINE>_buildInfo.addRepositoryBranch(attributes.getValue("id"), attributes.getValue("name"));<NEW_LINE>} else if (qName.equalsIgnoreCase("fsroot")) {<NEW_LINE>_buildInfo.addFSRoot(attributes.getValue("id"), attributes.getValue("root"));<NEW_LINE>} else if (qName.equalsIgnoreCase("defaultSize")) {<NEW_LINE>_buildInfo.addDefaultSize(attributes.getValue("id"), attributes.getValue("value"));<NEW_LINE>} else if (qName.equalsIgnoreCase("jcl")) {<NEW_LINE>_buildInfo.addJCL(attributes.getValue("id"));<NEW_LINE>} else if (qName.equalsIgnoreCase("project")) {<NEW_LINE>_buildInfo.addSource(attributes.getValue("id"));<NEW_LINE>} else if (qName.equalsIgnoreCase("builder")) {<NEW_LINE>_buildInfo.addASMBuilder(attributes.getValue("id"));<NEW_LINE>}<NEW_LINE>} | .length() - 4)); |
1,451,948 | final ListFHIRExportJobsResult executeListFHIRExportJobs(ListFHIRExportJobsRequest listFHIRExportJobsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listFHIRExportJobsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListFHIRExportJobsRequest> request = null;<NEW_LINE>Response<ListFHIRExportJobsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListFHIRExportJobsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listFHIRExportJobsRequest));<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, "HealthLake");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListFHIRExportJobs");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListFHIRExportJobsResult>> 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 ListFHIRExportJobsResultJsonUnmarshaller()); |
835,638 | private void _forwardLayout(HttpServletRequest req) throws Exception {<NEW_LINE><MASK><NEW_LINE>Layout layout = (Layout) req.getAttribute(WebKeys.LAYOUT);<NEW_LINE>String layoutId = null;<NEW_LINE>if (layout == null || !InodeUtils.isSet(layoutId)) {<NEW_LINE>User user = PortalUtil.getUser(req);<NEW_LINE>List<Layout> userLayouts = APILocator.getLayoutAPI().loadLayoutsForUser(user);<NEW_LINE>if (userLayouts != null && userLayouts.size() > 0) {<NEW_LINE>layoutId = userLayouts.get(0).getId();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>layoutId = layout.getId();<NEW_LINE>}<NEW_LINE>String ctxPath = (String) ses.getAttribute(WebKeys.CTX_PATH);<NEW_LINE>req.setAttribute(WebKeys.FORWARD_URL, ctxPath + "/portal" + PortalUtil.getAuthorizedPath(req) + "/layout?p_l_id=" + layoutId);<NEW_LINE>} | HttpSession ses = req.getSession(); |
1,183,210 | private void helpNavigated(Document doc) {<NEW_LINE>NodeList<Element> elements = doc.getElementsByTagName("a");<NEW_LINE>for (int i = 0; i < elements.getLength(); i++) {<NEW_LINE>ElementEx a = (ElementEx) elements.getItem(i);<NEW_LINE>String href = a.getAttribute("href", 2);<NEW_LINE>if (href == null)<NEW_LINE>continue;<NEW_LINE>if (href.contains(":") || href.endsWith(".pdf")) {<NEW_LINE>// external links<NEW_LINE>AnchorElement aElement = a.cast();<NEW_LINE>aElement.setTarget("_blank");<NEW_LINE>} else {<NEW_LINE>// Internal links need to be handled in JavaScript so that<NEW_LINE>// they can participate in virtual session history. This<NEW_LINE>// won't have any effect for right-click > Show in New Window<NEW_LINE>// but that's a good thing.<NEW_LINE>a.setAttribute("onclick", "window.parent.helpNavigate(this.href); return false");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String effectiveTitle = getDocTitle(doc);<NEW_LINE>title_.setText(effectiveTitle);<NEW_LINE>this.fireEvent(new HelpNavigateEvent(doc<MASK><NEW_LINE>} | .getURL(), effectiveTitle)); |
730,241 | static URIMapper createOneToOne() {<NEW_LINE>return new URIMapper() {<NEW_LINE><NEW_LINE>private Map<File, File> can2AbsFile = new HashMap<>();<NEW_LINE><NEW_LINE>@Override<NEW_LINE>File toSourceFile(URI remoteURI) {<NEW_LINE>File retval = Utilities.toFile(remoteURI);<NEW_LINE>File <MASK><NEW_LINE>retval = (absFile != null) ? absFile : retval;<NEW_LINE>if (LOGGER.isLoggable(Level.FINE)) {<NEW_LINE>LOGGER.log(Level.FINE, String.format("%s: %s -> %s", getClass().toString(), remoteURI, retval));<NEW_LINE>}<NEW_LINE>return retval;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>URI toWebServerURI(File localFile, boolean includeHostPart) {<NEW_LINE>File canonicalFile = null;<NEW_LINE>try {<NEW_LINE>canonicalFile = localFile.getCanonicalFile();<NEW_LINE>} catch (IOException ex) {<NEW_LINE>Exceptions.printStackTrace(ex);<NEW_LINE>}<NEW_LINE>if (!localFile.equals(canonicalFile)) {<NEW_LINE>can2AbsFile.put(canonicalFile, localFile);<NEW_LINE>localFile = canonicalFile;<NEW_LINE>}<NEW_LINE>final URI retval = toURI(localFile, includeHostPart);<NEW_LINE>if (LOGGER.isLoggable(Level.FINE)) {<NEW_LINE>LOGGER.log(Level.FINE, String.format("%s: %s -> %s", getClass().toString(), localFile, retval));<NEW_LINE>}<NEW_LINE>return retval;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>} | absFile = can2AbsFile.get(retval); |
293,863 | public void marshall(DiskSnapshot diskSnapshot, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (diskSnapshot == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(diskSnapshot.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(diskSnapshot.getArn(), ARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(diskSnapshot.getSupportCode(), SUPPORTCODE_BINDING);<NEW_LINE>protocolMarshaller.marshall(diskSnapshot.getCreatedAt(), CREATEDAT_BINDING);<NEW_LINE>protocolMarshaller.marshall(diskSnapshot.getLocation(), LOCATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(diskSnapshot.getResourceType(), RESOURCETYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(diskSnapshot.getTags(), TAGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(diskSnapshot.getState(), STATE_BINDING);<NEW_LINE>protocolMarshaller.marshall(diskSnapshot.getProgress(), PROGRESS_BINDING);<NEW_LINE>protocolMarshaller.marshall(diskSnapshot.getFromDiskName(), FROMDISKNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(diskSnapshot.getFromDiskArn(), FROMDISKARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(diskSnapshot.getFromInstanceName(), FROMINSTANCENAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(diskSnapshot.getFromInstanceArn(), FROMINSTANCEARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(diskSnapshot.getIsFromAutoSnapshot(), ISFROMAUTOSNAPSHOT_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | diskSnapshot.getSizeInGb(), SIZEINGB_BINDING); |
288,977 | public static DescribeDcdnRefreshTaskByIdResponse unmarshall(DescribeDcdnRefreshTaskByIdResponse describeDcdnRefreshTaskByIdResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeDcdnRefreshTaskByIdResponse.setRequestId(_ctx.stringValue("DescribeDcdnRefreshTaskByIdResponse.RequestId"));<NEW_LINE>describeDcdnRefreshTaskByIdResponse.setTotalCount(_ctx.longValue("DescribeDcdnRefreshTaskByIdResponse.TotalCount"));<NEW_LINE>List<CDNTask> tasks = new ArrayList<CDNTask>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeDcdnRefreshTaskByIdResponse.Tasks.Length"); i++) {<NEW_LINE>CDNTask cDNTask = new CDNTask();<NEW_LINE>cDNTask.setTaskId(_ctx.stringValue("DescribeDcdnRefreshTaskByIdResponse.Tasks[" + i + "].TaskId"));<NEW_LINE>cDNTask.setObjectPath(_ctx.stringValue<MASK><NEW_LINE>cDNTask.setProcess(_ctx.stringValue("DescribeDcdnRefreshTaskByIdResponse.Tasks[" + i + "].Process"));<NEW_LINE>cDNTask.setStatus(_ctx.stringValue("DescribeDcdnRefreshTaskByIdResponse.Tasks[" + i + "].Status"));<NEW_LINE>cDNTask.setCreationTime(_ctx.stringValue("DescribeDcdnRefreshTaskByIdResponse.Tasks[" + i + "].CreationTime"));<NEW_LINE>cDNTask.setDescription(_ctx.stringValue("DescribeDcdnRefreshTaskByIdResponse.Tasks[" + i + "].Description"));<NEW_LINE>cDNTask.setObjectType(_ctx.stringValue("DescribeDcdnRefreshTaskByIdResponse.Tasks[" + i + "].ObjectType"));<NEW_LINE>tasks.add(cDNTask);<NEW_LINE>}<NEW_LINE>describeDcdnRefreshTaskByIdResponse.setTasks(tasks);<NEW_LINE>return describeDcdnRefreshTaskByIdResponse;<NEW_LINE>} | ("DescribeDcdnRefreshTaskByIdResponse.Tasks[" + i + "].ObjectPath")); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.