idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
311,140 | public void loadData() {<NEW_LINE>if (!isAdded()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>mService = PublicizeTable.getService(mServiceId);<NEW_LINE>if (mService == null) {<NEW_LINE>ToastUtils.showToast(getActivity(), R.string.error_generic);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>setTitle(mService.getLabel());<NEW_LINE>// disable the ability to add another G+ connection<NEW_LINE>if (isGooglePlus()) {<NEW_LINE>mServiceContainer.setVisibility(View.GONE);<NEW_LINE>} else {<NEW_LINE>String serviceLabel = String.format(getString(R.string.connection_service_label), mService.getLabel());<NEW_LINE>TextView txtService = mServiceContainer.findViewById(R.id.text_service);<NEW_LINE>txtService.setText(serviceLabel);<NEW_LINE>String description = String.format(getString(R.string.connection_service_description), mService.getLabel());<NEW_LINE>TextView txtDescription = mServiceContainer.<MASK><NEW_LINE>txtDescription.setText(description);<NEW_LINE>}<NEW_LINE>long currentUserId = mAccountStore.getAccount().getUserId();<NEW_LINE>PublicizeConnectionAdapter adapter = new PublicizeConnectionAdapter(getActivity(), mSite.getSiteId(), mService, currentUserId);<NEW_LINE>adapter.setOnPublicizeActionListener(getOnPublicizeActionListener());<NEW_LINE>adapter.setOnAdapterLoadedListener(this);<NEW_LINE>mRecycler.setAdapter(adapter);<NEW_LINE>adapter.refresh();<NEW_LINE>} | findViewById(R.id.text_description); |
1,199,444 | public void paintComponent(Graphics g_) {<NEW_LINE>Rectangle clip = g_.getClipBounds();<NEW_LINE>if (clip.height < 0)<NEW_LINE>return;<NEW_LINE>Graphics2D g = (Graphics2D) getComponentGraphics(g_);<NEW_LINE>AffineTransform old = setMirrorTransformIfNeeded(g, 0, getWidth());<NEW_LINE>EditorUIUtil.setupAntialiasing(g);<NEW_LINE>Color backgroundColor = getBackground();<NEW_LINE>if (myEditor.isDisposed()) {<NEW_LINE>g.setColor(myEditor.getDisposedBackground());<NEW_LINE>g.fillRect(clip.x, clip.y, clip.width, clip.height);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int startVisualLine;<NEW_LINE>int endVisualLine;<NEW_LINE>int firstVisibleOffset;<NEW_LINE>int lastVisibleOffset;<NEW_LINE>Segment focusModeRange = myEditor.getFocusModeRange();<NEW_LINE>if (focusModeRange == null) {<NEW_LINE>startVisualLine = myEditor.yToVisualLine(clip.y);<NEW_LINE>endVisualLine = myEditor.yToVisualLine(clip.y + clip.height);<NEW_LINE>firstVisibleOffset = myEditor.visualLineStartOffset(startVisualLine);<NEW_LINE>lastVisibleOffset = myEditor.visualLineStartOffset(endVisualLine + 1);<NEW_LINE>} else {<NEW_LINE>firstVisibleOffset = focusModeRange.getStartOffset();<NEW_LINE>lastVisibleOffset = focusModeRange.getEndOffset();<NEW_LINE>startVisualLine = myEditor.offsetToVisualLine(firstVisibleOffset);<NEW_LINE>endVisualLine = myEditor.offsetToVisualLine(lastVisibleOffset);<NEW_LINE>}<NEW_LINE>// paint all backgrounds<NEW_LINE>int gutterSeparatorX = getWhitespaceSeparatorOffset();<NEW_LINE>paintBackground(g, clip, 0, gutterSeparatorX, TargetAWT.from(backgroundColor));<NEW_LINE>paintBackground(g, clip, gutterSeparatorX, getFoldingAreaWidth(), myEditor.getBackgroundColor());<NEW_LINE>paintEditorBackgrounds(g, firstVisibleOffset, lastVisibleOffset);<NEW_LINE>Object hint = g.getRenderingHint(RenderingHints.KEY_ANTIALIASING);<NEW_LINE>if (!UIUtil.isJreHiDPI(g))<NEW_LINE>g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF);<NEW_LINE>try {<NEW_LINE>paintAnnotations(g, startVisualLine, endVisualLine);<NEW_LINE>if (focusModeRange != null) {<NEW_LINE>int startY = Math.max(myEditor.visualLineToY(startVisualLine), clip.y);<NEW_LINE>int endY = Math.min(myEditor.visualLineToY(endVisualLine), clip.y + clip.height);<NEW_LINE>g.setClip(clip.x, startY, clip.width, endY - startY);<NEW_LINE>}<NEW_LINE>paintLineMarkers(g, firstVisibleOffset, lastVisibleOffset, startVisualLine, endVisualLine);<NEW_LINE>g.setClip(clip);<NEW_LINE>paintFoldingLines(g, clip);<NEW_LINE>paintFoldingTree(g, clip, firstVisibleOffset, lastVisibleOffset);<NEW_LINE><MASK><NEW_LINE>paintCurrentAccessibleLine(g);<NEW_LINE>} finally {<NEW_LINE>g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, hint);<NEW_LINE>}<NEW_LINE>if (old != null)<NEW_LINE>g.setTransform(old);<NEW_LINE>} | paintLineNumbers(g, startVisualLine, endVisualLine); |
273,937 | public void run(CompilationController cc) throws Exception {<NEW_LINE><MASK><NEW_LINE>Element element = oldHandle.resolveElement(cc);<NEW_LINE>if (element == null || element.getKind() != ElementKind.METHOD) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>PropertyType type = null;<NEW_LINE>ExecutableElement ee = (ExecutableElement) element;<NEW_LINE>if (JavaUtils.isGetter(ee)) {<NEW_LINE>type = PropertyType.READ_ONLY;<NEW_LINE>} else if (JavaUtils.isSetter(ee)) {<NEW_LINE>type = PropertyType.WRITE_ONLY;<NEW_LINE>} else {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// gather and keep all overridden methods plus current method<NEW_LINE>Collection<ElementHandle<ExecutableElement>> methodHandles = JavaUtils.getOverridenMethodsAsHandles(ee, cc);<NEW_LINE>methodHandles = new ArrayList<ElementHandle<ExecutableElement>>(methodHandles);<NEW_LINE>methodHandles.add(ElementHandle.create(ee));<NEW_LINE>String oldName = JavaUtils.getPropertyName(element.getSimpleName().toString());<NEW_LINE>element = element.getEnclosingElement();<NEW_LINE>result[0] = new RenamedProperty(methodHandles, oldName, JavaUtils.getPropertyName(newName), type);<NEW_LINE>} | cc.toPhase(Phase.RESOLVED); |
44,063 | final DeleteClientVpnEndpointResult executeDeleteClientVpnEndpoint(DeleteClientVpnEndpointRequest deleteClientVpnEndpointRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteClientVpnEndpointRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteClientVpnEndpointRequest> request = null;<NEW_LINE>Response<DeleteClientVpnEndpointResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new DeleteClientVpnEndpointRequestMarshaller().marshall(super.beforeMarshalling(deleteClientVpnEndpointRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteClientVpnEndpoint");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DeleteClientVpnEndpointResult> responseHandler = new StaxResponseHandler<DeleteClientVpnEndpointResult>(new DeleteClientVpnEndpointResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.startEvent(Field.RequestMarshallTime); |
1,057,598 | private void writeKeyValuesTo(NavigableMap<DataKey, DataValue> map, OutputStream outStream, DataSourceTable sourceTable, byte[] sourceTableBytes) throws IOException {<NEW_LINE>Set<Map.Entry<DataKey, DataValue>> entries = map.entrySet();<NEW_LINE>int[] orderedValueSizes = new int[entries.size()];<NEW_LINE>int valueSizeIndex = 0;<NEW_LINE>// Serialize all the values in sorted order to a intermediate buffer, so that the keys<NEW_LINE>// can be associated with a value size.<NEW_LINE>// TODO(corysmith): Tune the size of the byte array.<NEW_LINE>ByteArrayOutputStream valuesOutputStream = new ByteArrayOutputStream(2048);<NEW_LINE>for (Map.Entry<DataKey, DataValue> entry : entries) {<NEW_LINE>orderedValueSizes[valueSizeIndex++] = entry.getValue().serializeTo(sourceTable, valuesOutputStream);<NEW_LINE>}<NEW_LINE>// Serialize all the keys in sorted order<NEW_LINE>valueSizeIndex = 0;<NEW_LINE>for (Map.Entry<DataKey, DataValue> entry : entries) {<NEW_LINE>entry.getKey().serializeTo(<MASK><NEW_LINE>}<NEW_LINE>// write the source table<NEW_LINE>outStream.write(sourceTableBytes);<NEW_LINE>// write the values to the output stream.<NEW_LINE>outStream.write(valuesOutputStream.toByteArray());<NEW_LINE>} | outStream, orderedValueSizes[valueSizeIndex++]); |
206,535 | public void refreshActiveWork(Map<String, List<KeyedGetDataRequest>> active) {<NEW_LINE>activeHeartbeats.<MASK><NEW_LINE>try {<NEW_LINE>if (useStreamingRequests) {<NEW_LINE>// With streaming requests, always send the request even when it is empty, to ensure that<NEW_LINE>// we trigger health checks for the stream even when it is idle.<NEW_LINE>GetDataStream stream = streamPool.getStream();<NEW_LINE>try {<NEW_LINE>stream.refreshActiveWork(active);<NEW_LINE>} finally {<NEW_LINE>streamPool.releaseStream(stream);<NEW_LINE>}<NEW_LINE>} else if (!active.isEmpty()) {<NEW_LINE>Windmill.GetDataRequest.Builder builder = Windmill.GetDataRequest.newBuilder();<NEW_LINE>for (Map.Entry<String, List<KeyedGetDataRequest>> entry : active.entrySet()) {<NEW_LINE>builder.addRequests(Windmill.ComputationGetDataRequest.newBuilder().setComputationId(entry.getKey()).addAllRequests(entry.getValue()));<NEW_LINE>}<NEW_LINE>server.getData(builder.build());<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>activeHeartbeats.set(0);<NEW_LINE>}<NEW_LINE>} | set(active.size()); |
1,554,278 | Annotation annotate(File file, String revision) throws IOException {<NEW_LINE>ArrayList<String> argv = new ArrayList<>();<NEW_LINE>ensureCommand(CMD_PROPERTY_KEY, CMD_FALLBACK);<NEW_LINE>argv.add(RepoCommand);<NEW_LINE>argv.add("annotate");<NEW_LINE>argv.add(file.getName());<NEW_LINE>Properties props = getProperties(file);<NEW_LINE>String <MASK><NEW_LINE>if (branch != null && !branch.isEmpty()) {<NEW_LINE>argv.add("-b" + branch);<NEW_LINE>}<NEW_LINE>String repo = props.getProperty(REPOSITORY_PROPERTY);<NEW_LINE>if (repo != null && !repo.isEmpty()) {<NEW_LINE>argv.add("-p" + repo);<NEW_LINE>}<NEW_LINE>if (revision != null) {<NEW_LINE>argv.add("-aV:" + revision);<NEW_LINE>}<NEW_LINE>Executor exec = new Executor(argv, file.getParentFile(), RuntimeEnvironment.getInstance().getInteractiveCommandTimeout());<NEW_LINE>int status = exec.exec();<NEW_LINE>if (status != 0) {<NEW_LINE>LOGGER.log(Level.WARNING, "Failed annotate for: {2} \"{0}\" Exit code: {1}", new Object[] { file.getAbsolutePath(), String.valueOf(status), revision });<NEW_LINE>}<NEW_LINE>return parseAnnotation(exec.getOutputReader(), file.getName());<NEW_LINE>} | branch = props.getProperty(BRANCH_PROPERTY); |
950,279 | static public ETuple2 compile(EObject obj1, EObject obj2) {<NEW_LINE>if (obj1 instanceof ECompiledRE) {<NEW_LINE>return new ETuple2(ERT.am_ok, obj1);<NEW_LINE>}<NEW_LINE>ESeq opts = obj2.testSeq();<NEW_LINE>Options o = new Options();<NEW_LINE>String pattern;<NEW_LINE>ETuple4 tup = ETuple4.cast(obj1);<NEW_LINE>if (tup != null && tup.elem1 == ECompiledRE.am_re_pattern) {<NEW_LINE>EBinary b <MASK><NEW_LINE>byte[] byteArray = b.getByteArray();<NEW_LINE>if (b != null && b.byteAt(0) == '/') {<NEW_LINE>byte[] raw = byteArray;<NEW_LINE>int end = raw.length - 1;<NEW_LINE>for (int i = b.byteSize() - 1; i > 0; i--) {<NEW_LINE>if (b.byteAt(i * 8) == '/') {<NEW_LINE>end = i;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>pattern = new String(raw, 1, end - 1, IO.UTF8);<NEW_LINE>o.init(ECompiledRE.decode_options(raw, end + 1));<NEW_LINE>if (!o.init(opts)) {<NEW_LINE>throw ERT.badarg(obj1, obj2);<NEW_LINE>}<NEW_LINE>} else if ((pattern = is_special_pattern(byteArray, o)) != null) {<NEW_LINE>// ok //<NEW_LINE>} else {<NEW_LINE>System.out.println("byte data[] = { ");<NEW_LINE>for (int i = 0; i < byteArray.length; i++) {<NEW_LINE>System.out.print(", " + byteArray[i]);<NEW_LINE>}<NEW_LINE>System.out.println(" } ");<NEW_LINE>throw ERT.badarg(obj1, obj2);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (!o.init(opts)) {<NEW_LINE>throw ERT.badarg(obj1, obj2);<NEW_LINE>}<NEW_LINE>pattern = o.decode(obj1);<NEW_LINE>}<NEW_LINE>if (pattern == null) {<NEW_LINE>throw ERT.badarg(obj1, obj2);<NEW_LINE>}<NEW_LINE>String stripped_pattern = o.process_erl2java(pattern);<NEW_LINE>try {<NEW_LINE>Pattern c = Pattern.compile(stripped_pattern, o.flags);<NEW_LINE>return new ETuple2(ERT.am_ok, new ECompiledRE(o, c, pattern));<NEW_LINE>} catch (PatternSyntaxException e) {<NEW_LINE>return new ETuple2(ERT.am_error, new ETuple2(EString.fromString(e.getDescription() + " in /" + stripped_pattern + "/"), ERT.box(e.getIndex())));<NEW_LINE>}<NEW_LINE>} | = tup.elem4.testBinary(); |
1,430,635 | private void annotatePromoterOverlaps(final SimpleInterval variantInterval, final Map<String, Set<String>> variantConsequenceDict) {<NEW_LINE>final Set<String> <MASK><NEW_LINE>variantConsequenceDict.values().forEach(codingAnnotationGenes::addAll);<NEW_LINE>final Iterator<SVIntervalTree.Entry<String>> promotersForVariant = gtfIntervalTrees.getPromoterIntervalTree().overlappers(SVUtils.locatableToSVInterval(variantInterval, sequenceDictionary));<NEW_LINE>for (final Iterator<SVIntervalTree.Entry<String>> it = promotersForVariant; it.hasNext(); ) {<NEW_LINE>final SVIntervalTree.Entry<String> promoterEntry = it.next();<NEW_LINE>final String promoterName = promoterEntry.getValue();<NEW_LINE>if (!codingAnnotationGenes.contains(promoterName)) {<NEW_LINE>updateVariantConsequenceDict(variantConsequenceDict, GATKSVVCFConstants.PROMOTER, promoterName);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | codingAnnotationGenes = new HashSet<>(); |
310,857 | private void lowerInvoke(Invoke invoke, LoweringTool tool, StructuredGraph graph) {<NEW_LINE>if (invoke.callTarget() instanceof MethodCallTargetNode) {<NEW_LINE>MethodCallTargetNode callTarget = (MethodCallTargetNode) invoke.callTarget();<NEW_LINE>NodeInputList<ValueNode> parameters = callTarget.arguments();<NEW_LINE>ValueNode receiver = parameters.size() <= 0 ? null : parameters.get(0);<NEW_LINE>if (!callTarget.isStatic() && receiver.stamp(NodeView.DEFAULT) instanceof ObjectStamp && !StampTool.isPointerNonNull(receiver)) {<NEW_LINE>ValueNode nonNullReceiver = createNullCheckedValue(receiver, invoke.asNode(), tool);<NEW_LINE>parameters.set(0, nonNullReceiver);<NEW_LINE>}<NEW_LINE>JavaType[] signature = callTarget.targetMethod().getSignature().toParameterTypes(callTarget.isStatic() ? null : callTarget.targetMethod().getDeclaringClass());<NEW_LINE>LoweredCallTargetNode loweredCallTarget = null;<NEW_LINE>StampPair returnStampPair = callTarget.returnStamp();<NEW_LINE>Stamp returnStamp = returnStampPair.getTrustedStamp();<NEW_LINE>if (returnStamp instanceof ObjectStamp) {<NEW_LINE>ObjectStamp os = (ObjectStamp) returnStamp;<NEW_LINE>ResolvedJavaType type = os.<MASK><NEW_LINE>PTXKind ptxKind = PTXKind.fromResolvedJavaType(type);<NEW_LINE>if (ptxKind != PTXKind.ILLEGAL) {<NEW_LINE>returnStampPair = StampPair.createSingle(PTXStampFactory.getStampFor(ptxKind));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>loweredCallTarget = graph.add(new TornadoDirectCallTargetNode(parameters.toArray(new ValueNode[parameters.size()]), returnStampPair, signature, callTarget.targetMethod(), HotSpotCallingConventionType.JavaCall, callTarget.invokeKind()));<NEW_LINE>callTarget.replaceAndDelete(loweredCallTarget);<NEW_LINE>}<NEW_LINE>} | javaType(tool.getMetaAccess()); |
1,437,937 | public boolean removeErrorBarPolicy(final IErrorBarPolicy<?> errorBarPolicy) {<NEW_LINE>boolean result = false;<NEW_LINE>if (Chart2D.DEBUG_THREADING) {<NEW_LINE>System.out.println("addErrorBarPolicy, 0 locks");<NEW_LINE>}<NEW_LINE>this.ensureInitialized();<NEW_LINE>synchronized (this.m_renderer) {<NEW_LINE>if (Chart2D.DEBUG_THREADING) {<NEW_LINE>System.out.println("addErrorBarPolicy, 1 lock");<NEW_LINE>}<NEW_LINE>synchronized (this) {<NEW_LINE>if (Chart2D.DEBUG_THREADING) {<NEW_LINE>System.out.println("addErrorBarPolicy, 2 locks");<NEW_LINE>}<NEW_LINE>result = <MASK><NEW_LINE>if (result) {<NEW_LINE>errorBarPolicy.setTrace(null);<NEW_LINE>errorBarPolicy.removePropertyChangeListener(IErrorBarPolicy.PROPERTY_CONFIGURATION, this);<NEW_LINE>this.expandErrorBarBounds();<NEW_LINE>this.firePropertyChange(ITrace2D.PROPERTY_ERRORBARPOLICY, errorBarPolicy, null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | this.m_errorBarPolicies.remove(errorBarPolicy); |
2,768 | public static boolean simpleChimeraWithStichableAlignments(final AlignmentInterval intervalOne, final AlignmentInterval intervalTwo) {<NEW_LINE>if (intervalOne.startInAssembledContig > intervalTwo.startInAssembledContig)<NEW_LINE>throw new IllegalArgumentException("Assumption that input intervals are sorted by their starts on read is violated.\tFirst: " + intervalOne.toPackedString() + "\tSecond: " + intervalTwo.toPackedString());<NEW_LINE>if (!intervalOne.referenceSpan.getContig().equals(intervalTwo.referenceSpan.getContig()))<NEW_LINE>return false;<NEW_LINE>if (intervalOne.forwardStrand != intervalTwo.forwardStrand)<NEW_LINE>return false;<NEW_LINE>if (intervalOne.containsOnRead(intervalTwo) || intervalTwo.containsOnRead(intervalOne))<NEW_LINE>return false;<NEW_LINE>if (intervalOne.containsOnRef(intervalTwo) || intervalTwo.containsOnRef(intervalOne))<NEW_LINE>return false;<NEW_LINE>final boolean refOrderSwap = intervalOne.forwardStrand != (intervalOne.referenceSpan.getStart() < <MASK><NEW_LINE>if (refOrderSwap)<NEW_LINE>return false;<NEW_LINE>final int overlapOnContig = AlignmentInterval.overlapOnContig(intervalOne, intervalTwo);<NEW_LINE>final int overlapOnRefSpan = AlignmentInterval.overlapOnRefSpan(intervalOne, intervalTwo);<NEW_LINE>if (overlapOnContig == 0 && overlapOnRefSpan == 0) {<NEW_LINE>final boolean canBeStitched = intervalTwo.referenceSpan.getStart() - intervalOne.referenceSpan.getEnd() == 1 && intervalTwo.startInAssembledContig - intervalOne.endInAssembledContig == 1;<NEW_LINE>return canBeStitched;<NEW_LINE>} else<NEW_LINE>return overlapOnContig == overlapOnRefSpan;<NEW_LINE>} | intervalTwo.referenceSpan.getStart()); |
202,815 | public PsiElementVisitor buildVisitor(@NotNull final ProblemsHolder holder, final boolean isOnTheFly, @NotNull final LocalInspectionToolSession session) {<NEW_LINE>final PsiFile file = holder.getFile();<NEW_LINE>final VirtualFile virtualFile = file.getVirtualFile();<NEW_LINE>final Project project = holder.getProject();<NEW_LINE>IndexFacade indexFacade = ServiceManager.getService(IndexFacade.class);<NEW_LINE>boolean checkRefs = indexFacade.isMainSpecFile(virtualFile, project) || <MASK><NEW_LINE>return new YamlPsiElementVisitor() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void visitKeyValue(@NotNull YAMLKeyValue keyValue) {<NEW_LINE>if (!checkRefs) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if ("$ref".equals(keyValue.getKeyText())) {<NEW_LINE>YAMLValue value = keyValue.getValue();<NEW_LINE>if (!(value instanceof YAMLScalar)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final String unquotedValue = StringUtil.unquoteString(value.getText());<NEW_LINE>if (!unquotedValue.startsWith("http")) {<NEW_LINE>doCheck(holder, value, new CreateYamlReferenceIntentionAction(unquotedValue));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>super.visitKeyValue(keyValue);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>} | indexFacade.isPartialSpecFile(virtualFile, project); |
234,365 | protected void buildAreas() {<NEW_LINE>areas = new ArrayList<>();<NEW_LINE>String mapProperty = properties.get(Image.PN_MAP, String.class);<NEW_LINE>if (StringUtils.isNotEmpty(mapProperty)) {<NEW_LINE>// Parse the image map areas as defined at {@code Image.PN_MAP}<NEW_LINE>String[] mapAreas = StringUtils.split(mapProperty, "][");<NEW_LINE>for (String area : mapAreas) {<NEW_LINE>int coordinatesEndIndex = area.indexOf(')');<NEW_LINE>if (coordinatesEndIndex < 0) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>String shapeAndCoords = StringUtils.substring(area, 0, coordinatesEndIndex + 1);<NEW_LINE>String shape = StringUtils.substringBefore(shapeAndCoords, "(");<NEW_LINE>String coordinates = StringUtils.substringBetween(shapeAndCoords, "(", ")");<NEW_LINE>String remaining = StringUtils.substring(area, coordinatesEndIndex + 1);<NEW_LINE>String[] remainingTokens = StringUtils.split(remaining, "|");<NEW_LINE>if (StringUtils.isBlank(shape) || StringUtils.isBlank(coordinates)) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (remainingTokens.length > 0) {<NEW_LINE>String href = StringUtils.removeAll<MASK><NEW_LINE>String target = remainingTokens.length > 1 ? StringUtils.removeAll(remainingTokens[1], "\"") : "";<NEW_LINE>Link link = linkHandler.getLink(href, target).orElse(null);<NEW_LINE>if (link == null || !link.isValid()) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>String alt = remainingTokens.length > 2 ? StringUtils.removeAll(remainingTokens[2], "\"") : "";<NEW_LINE>String relativeCoordinates = remainingTokens.length > 3 ? remainingTokens[3] : "";<NEW_LINE>relativeCoordinates = StringUtils.substringBetween(relativeCoordinates, "(", ")");<NEW_LINE>areas.add(newImageArea(shape, coordinates, relativeCoordinates, link, alt));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | (remainingTokens[0], "\""); |
493,847 | private Object parseArrayValue(StringTokenizer tokenizer) {<NEW_LINE>Object arrayContents;<NEW_LINE>String contentType;<NEW_LINE>String token;<NEW_LINE>// index type<NEW_LINE>token = <MASK><NEW_LINE>checkExpectedToken(INT_TOKEN, token);<NEW_LINE>contentType = consumeTokens(tokenizer, NEW_LINE_TOKEN, BLANK_SPACE_TOKEN);<NEW_LINE>token = consumeTokens(tokenizer, NEW_LINE_TOKEN, BLANK_SPACE_TOKEN);<NEW_LINE>checkExpectedToken(RIGHT_PARENTHESIS_TOKEN, token);<NEW_LINE>token = consumeTokens(tokenizer, NEW_LINE_TOKEN, BLANK_SPACE_TOKEN);<NEW_LINE>checkExpectedToken(LEFT_PARENTHESIS_TOKEN, token);<NEW_LINE>// Store expressions<NEW_LINE>token = consumeTokens(tokenizer, NEW_LINE_TOKEN, BLANK_SPACE_TOKEN);<NEW_LINE>int storeOperationsAmount = 0;<NEW_LINE>while (token.equals(STORE_TOKEN)) {<NEW_LINE>storeOperationsAmount++;<NEW_LINE>token = consumeTokens(tokenizer, NEW_LINE_TOKEN, BLANK_SPACE_TOKEN);<NEW_LINE>checkExpectedToken(LEFT_PARENTHESIS_TOKEN, token);<NEW_LINE>token = consumeTokens(tokenizer, NEW_LINE_TOKEN, BLANK_SPACE_TOKEN);<NEW_LINE>}<NEW_LINE>checkExpectedToken(LEFT_PARENTHESIS_TOKEN, token);<NEW_LINE>token = consumeTokens(tokenizer, NEW_LINE_TOKEN, BLANK_SPACE_TOKEN);<NEW_LINE>checkExpectedToken(AS_TOKEN, token);<NEW_LINE>token = consumeTokens(tokenizer, NEW_LINE_TOKEN, BLANK_SPACE_TOKEN);<NEW_LINE>checkExpectedToken(CONST_TOKEN, token);<NEW_LINE>token = consumeTokens(tokenizer, NEW_LINE_TOKEN, BLANK_SPACE_TOKEN);<NEW_LINE>checkExpectedToken(LEFT_PARENTHESIS_TOKEN, token);<NEW_LINE>token = consumeTokens(tokenizer, NEW_LINE_TOKEN, BLANK_SPACE_TOKEN);<NEW_LINE>checkExpectedToken(ARRAY_TOKEN, token);<NEW_LINE>token = consumeTokens(tokenizer, NEW_LINE_TOKEN, BLANK_SPACE_TOKEN);<NEW_LINE>checkExpectedToken(INT_TOKEN, token);<NEW_LINE>token = consumeTokens(tokenizer, NEW_LINE_TOKEN, BLANK_SPACE_TOKEN);<NEW_LINE>checkExpectedToken(contentType, token);<NEW_LINE>token = consumeTokens(tokenizer, NEW_LINE_TOKEN, BLANK_SPACE_TOKEN);<NEW_LINE>checkExpectedToken(RIGHT_PARENTHESIS_TOKEN, token);<NEW_LINE>token = consumeTokens(tokenizer, NEW_LINE_TOKEN, BLANK_SPACE_TOKEN);<NEW_LINE>checkExpectedToken(RIGHT_PARENTHESIS_TOKEN, token);<NEW_LINE>// This is the array default value, not checking it<NEW_LINE>consumeTokens(tokenizer, NEW_LINE_TOKEN, BLANK_SPACE_TOKEN);<NEW_LINE>token = consumeTokens(tokenizer, NEW_LINE_TOKEN, BLANK_SPACE_TOKEN);<NEW_LINE>checkExpectedToken(RIGHT_PARENTHESIS_TOKEN, token);<NEW_LINE>arrayContents = doParseArrayContent(tokenizer, contentType, token, storeOperationsAmount);<NEW_LINE>return arrayContents;<NEW_LINE>} | consumeTokens(tokenizer, NEW_LINE_TOKEN, BLANK_SPACE_TOKEN); |
125,161 | public ListExecutionsResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ListExecutionsResult listExecutionsResult = new ListExecutionsResult();<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 listExecutionsResult;<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("executions", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listExecutionsResult.setExecutions(new ListUnmarshaller<ExecutionSummary>(ExecutionSummaryJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("nextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listExecutionsResult.setNextToken(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 listExecutionsResult;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
881,283 | public void marshall(ContainerRecipeSummary containerRecipeSummary, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (containerRecipeSummary == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(containerRecipeSummary.getArn(), ARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(containerRecipeSummary.getContainerType(), CONTAINERTYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(containerRecipeSummary.getPlatform(), PLATFORM_BINDING);<NEW_LINE>protocolMarshaller.marshall(containerRecipeSummary.getOwner(), OWNER_BINDING);<NEW_LINE>protocolMarshaller.marshall(containerRecipeSummary.getParentImage(), PARENTIMAGE_BINDING);<NEW_LINE>protocolMarshaller.marshall(containerRecipeSummary.getDateCreated(), DATECREATED_BINDING);<NEW_LINE>protocolMarshaller.marshall(containerRecipeSummary.getTags(), TAGS_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | containerRecipeSummary.getName(), NAME_BINDING); |
1,837,337 | public String propertiesToString(boolean skipIfChild) {<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>@SuppressWarnings("HiddenField")<NEW_LINE>List<MASK><NEW_LINE>// eliminate children (they are rendered as part of the tree)<NEW_LINE>int remainingProperties = TO_STRING_MAX_PROP;<NEW_LINE>int maxWidth = 0;<NEW_LINE>boolean needsComma = false;<NEW_LINE>List<Object> props = nodeProperties();<NEW_LINE>for (Object prop : props) {<NEW_LINE>// consider a property if it is not ignored AND<NEW_LINE>// it's not a child (optional)<NEW_LINE>if ((skipIfChild && (children.contains(prop) || children.equals(prop))) == false) {<NEW_LINE>if (remainingProperties-- < 0) {<NEW_LINE>sb.append("...").append(props.size() - TO_STRING_MAX_PROP).append("fields not shown");<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (needsComma) {<NEW_LINE>sb.append(",");<NEW_LINE>}<NEW_LINE>String stringValue = toString(prop);<NEW_LINE>// : Objects.toString(prop);<NEW_LINE>if (maxWidth + stringValue.length() > TO_STRING_MAX_WIDTH) {<NEW_LINE>int cutoff = Math.max(0, TO_STRING_MAX_WIDTH - maxWidth);<NEW_LINE>sb.append(stringValue.substring(0, cutoff));<NEW_LINE>sb.append("\n");<NEW_LINE>stringValue = stringValue.substring(cutoff);<NEW_LINE>maxWidth = 0;<NEW_LINE>}<NEW_LINE>maxWidth += stringValue.length();<NEW_LINE>sb.append(stringValue);<NEW_LINE>needsComma = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return sb.toString();<NEW_LINE>} | <?> children = children(); |
291,740 | public void run() {<NEW_LINE>// Guava Stopwatch is useful here, for a friendlier toString, but the versions of Guava<NEW_LINE>// are different in incompatible ways, so we avoid it here and use Duration instead, so<NEW_LINE>// there won't be conflicts.<NEW_LINE>long startTime;<NEW_LINE>Duration duration;<NEW_LINE>if (!ReplicationTable.isOnline(context)) {<NEW_LINE>log.debug("Replication table isn't online, not attempting to clean up wals");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>HashSet<String> closed = null;<NEW_LINE>Span span = TraceUtil.startSpan(this.getClass(), "findReferencedWals");<NEW_LINE>try (Scope findWalsSpan = span.makeCurrent()) {<NEW_LINE>startTime = System.nanoTime();<NEW_LINE>closed = getClosedLogs();<NEW_LINE>duration = Duration.ofNanos(<MASK><NEW_LINE>} finally {<NEW_LINE>span.end();<NEW_LINE>}<NEW_LINE>log.info("Found {} WALs referenced in metadata in {}", closed.size(), duration);<NEW_LINE>long recordsClosed = 0;<NEW_LINE>Span updateReplicationSpan = TraceUtil.startSpan(this.getClass(), "updateReplicationTable");<NEW_LINE>try (Scope updateReplicationScope = updateReplicationSpan.makeCurrent()) {<NEW_LINE>startTime = System.nanoTime();<NEW_LINE>recordsClosed = updateReplicationEntries(context, closed);<NEW_LINE>duration = Duration.ofNanos(System.nanoTime() - startTime);<NEW_LINE>} finally {<NEW_LINE>updateReplicationSpan.end();<NEW_LINE>}<NEW_LINE>log.info("Closed {} WAL replication references in replication table in {}", recordsClosed, duration);<NEW_LINE>} | System.nanoTime() - startTime); |
1,746,278 | public void scrutinize(Statement statement, EntityIdValue entityId, boolean added) {<NEW_LINE>if (!added) {<NEW_LINE>// not scrutinizing removed statements<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Snak mainSnak = statement.getClaim().getMainSnak();<NEW_LINE>PropertyIdValue pid = mainSnak.getPropertyId();<NEW_LINE>List<Statement> statementList = _fetcher.getConstraintsByType(pid, distinctValuesConstraintQid);<NEW_LINE>if (!statementList.isEmpty() && mainSnak instanceof ValueSnak) {<NEW_LINE>Value mainSnakValue = ((ValueSnak) mainSnak).getValue();<NEW_LINE>Map<Value, EntityIdValue> seen = _seenValues.get(pid);<NEW_LINE>if (seen == null) {<NEW_LINE>seen = new HashMap<Value, EntityIdValue>();<NEW_LINE>_seenValues.put(pid, seen);<NEW_LINE>}<NEW_LINE>if (seen.containsKey(mainSnakValue)) {<NEW_LINE>EntityIdValue otherId = seen.get(mainSnakValue);<NEW_LINE>QAWarning issue = new QAWarning(type, pid.getId(), QAWarning.Severity.IMPORTANT, 1);<NEW_LINE><MASK><NEW_LINE>issue.setProperty("item1_entity", entityId);<NEW_LINE>issue.setProperty("item2_entity", otherId);<NEW_LINE>addIssue(issue);<NEW_LINE>} else {<NEW_LINE>seen.put(mainSnakValue, entityId);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | issue.setProperty("property_entity", pid); |
18,239 | private Object readResponse(TProtocol in) throws Exception {<NEW_LINE><MASK><NEW_LINE>reader.readStructBegin();<NEW_LINE>Object results = null;<NEW_LINE>Exception exception = null;<NEW_LINE>while (reader.nextField()) {<NEW_LINE>if (reader.getFieldId() == 0) {<NEW_LINE>results = reader.readField(successCodec);<NEW_LINE>} else {<NEW_LINE>ThriftCodec<Object> exceptionCodec = exceptionCodecs.get(reader.getFieldId());<NEW_LINE>if (exceptionCodec != null) {<NEW_LINE>exception = (Exception) reader.readField(exceptionCodec);<NEW_LINE>} else {<NEW_LINE>reader.skipFieldData();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>reader.readStructEnd();<NEW_LINE>in.readMessageEnd();<NEW_LINE>if (exception != null) {<NEW_LINE>throw exception;<NEW_LINE>}<NEW_LINE>if (successCodec.getType() == ThriftType.VOID) {<NEW_LINE>// TODO: check for non-null return from a void function?<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (results == null) {<NEW_LINE>throw new TApplicationException(TApplicationException.MISSING_RESULT, name + " failed: unknown result");<NEW_LINE>}<NEW_LINE>return results;<NEW_LINE>} | TProtocolReader reader = new TProtocolReader(in); |
241,242 | public static ImageResult toJpeg(@NonNull ImageProxy image, boolean flip) throws IOException {<NEW_LINE>ImageProxy.PlaneProxy[] planes = image.getPlanes();<NEW_LINE>ByteBuffer buffer = planes[0].getBuffer();<NEW_LINE>Rect cropRect = shouldCropImage(image) ? image.getCropRect() : null;<NEW_LINE>byte[] data = new byte[buffer.capacity()];<NEW_LINE>int rotation = image.getImageInfo().getRotationDegrees();<NEW_LINE>buffer.get(data);<NEW_LINE>try {<NEW_LINE>Pair<Integer, Integer> dimens = BitmapUtil.getDimensions(new ByteArrayInputStream(data));<NEW_LINE>if (dimens.first != image.getWidth() && dimens.second != image.getHeight()) {<NEW_LINE>Log.w(TAG, String.format(Locale.ENGLISH, "Decoded image dimensions differed from stated dimensions! Stated: %d x %d, Decoded: %d x %d", image.getWidth(), image.getHeight(), dimens.first, dimens.second));<NEW_LINE>Log.w(<MASK><NEW_LINE>rotation = 0;<NEW_LINE>if (cropRect != null) {<NEW_LINE>cropRect = new Rect(cropRect.top, cropRect.left, cropRect.bottom, cropRect.right);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (BitmapDecodingException e) {<NEW_LINE>Log.w(TAG, "Failed to decode!", e);<NEW_LINE>}<NEW_LINE>if (cropRect != null || rotation != 0 || flip) {<NEW_LINE>data = transformByteArray(data, cropRect, rotation, flip);<NEW_LINE>}<NEW_LINE>int width = cropRect != null ? (cropRect.right - cropRect.left) : image.getWidth();<NEW_LINE>int height = cropRect != null ? (cropRect.bottom - cropRect.top) : image.getHeight();<NEW_LINE>if (rotation == 90 || rotation == 270) {<NEW_LINE>int swap = width;<NEW_LINE>width = height;<NEW_LINE>height = swap;<NEW_LINE>}<NEW_LINE>return new ImageResult(data, width, height);<NEW_LINE>} | TAG, "Ignoring the stated rotation and rotating the crop rect 90 degrees (stated rotation is " + rotation + " degrees)."); |
547,145 | private JPanel destinationDirPanel() {<NEW_LINE>JPanel panel = new JPanel(new GridLayout(2, 1));<NEW_LINE>panel.setOpaque(false);<NEW_LINE>panel.add(new JLabel(MessageUtils.getLocalizedMessage("export.terms.label.output_path")));<NEW_LINE>JPanel inputPanel = new JPanel(new FlowLayout(FlowLayout.LEADING));<NEW_LINE>inputPanel.setBorder(BorderFactory.createEmptyBorder());<NEW_LINE>inputPanel.setOpaque(false);<NEW_LINE>destDir.setText<MASK><NEW_LINE>destDir.setColumns(60);<NEW_LINE>destDir.setPreferredSize(new Dimension(200, 30));<NEW_LINE>destDir.setFont(StyleConstants.FONT_MONOSPACE_LARGE);<NEW_LINE>destDir.setEditable(false);<NEW_LINE>destDir.setBackground(Color.white);<NEW_LINE>inputPanel.add(destDir);<NEW_LINE>JButton browseBtn = new JButton(MessageUtils.getLocalizedMessage("export.terms.button.browse"));<NEW_LINE>browseBtn.setFont(StyleConstants.FONT_BUTTON_LARGE);<NEW_LINE>browseBtn.setMargin(new Insets(3, 0, 3, 0));<NEW_LINE>browseBtn.addActionListener(listeners::browseDirectory);<NEW_LINE>inputPanel.add(browseBtn);<NEW_LINE>panel.add(inputPanel);<NEW_LINE>return panel;<NEW_LINE>} | (System.getProperty("user.home")); |
559,698 | public Set<Map<String, List<String>>> searchForMultipleAttributeValues(String base, String filter, Object[] params, String[] attributeNames) {<NEW_LINE>// Escape the params acording to RFC2254<NEW_LINE>Object[] encodedParams = new String[params.length];<NEW_LINE>for (int i = 0; i < params.length; i++) {<NEW_LINE>encodedParams[i] = LdapEncoder.filterEncode(params[i].toString());<NEW_LINE>}<NEW_LINE>String formattedFilter = MessageFormat.format(filter, encodedParams);<NEW_LINE>logger.trace(LogMessage.format("Using filter: %s", formattedFilter));<NEW_LINE>HashSet<Map<String, List<String>>> result = new HashSet<>();<NEW_LINE>ContextMapper roleMapper = (ctx) -> {<NEW_LINE>DirContextAdapter adapter = (DirContextAdapter) ctx;<NEW_LINE>Map<String, List<String>> record = new HashMap<>();<NEW_LINE>if (ObjectUtils.isEmpty(attributeNames)) {<NEW_LINE>try {<NEW_LINE>for (NamingEnumeration enumeration = adapter.getAttributes().getAll(); enumeration.hasMore(); ) {<NEW_LINE>Attribute attr = (Attribute) enumeration.next();<NEW_LINE>extractStringAttributeValues(adapter, record, attr.getID());<NEW_LINE>}<NEW_LINE>} catch (NamingException ex) {<NEW_LINE>org.springframework.ldap.<MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>for (String attributeName : attributeNames) {<NEW_LINE>extractStringAttributeValues(adapter, record, attributeName);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>record.put(DN_KEY, Arrays.asList(getAdapterDN(adapter)));<NEW_LINE>result.add(record);<NEW_LINE>return null;<NEW_LINE>};<NEW_LINE>SearchControls ctls = new SearchControls();<NEW_LINE>ctls.setSearchScope(this.searchControls.getSearchScope());<NEW_LINE>ctls.setReturningAttributes((attributeNames != null && attributeNames.length > 0) ? attributeNames : null);<NEW_LINE>search(base, formattedFilter, ctls, roleMapper);<NEW_LINE>return result;<NEW_LINE>} | support.LdapUtils.convertLdapException(ex); |
608,619 | public Iterator<T> iterator() {<NEW_LINE>return new Iterator<T>() {<NEW_LINE><NEW_LINE>private int index = 0;<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean hasNext() {<NEW_LINE>int size;<NEW_LINE>synchronized (wrapped) {<NEW_LINE>size = wrapped.size();<NEW_LINE>}<NEW_LINE>while (!completed) {<NEW_LINE>if (index < size)<NEW_LINE>return true;<NEW_LINE>waitForNewItemOrCompleted();<NEW_LINE>synchronized (wrapped) {<NEW_LINE>size = wrapped.size();<NEW_LINE>}<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public T next() {<NEW_LINE>int size;<NEW_LINE>synchronized (wrapped) {<NEW_LINE>size = wrapped.size();<NEW_LINE>}<NEW_LINE>while (!completed) {<NEW_LINE>if (index < size)<NEW_LINE>break;<NEW_LINE>waitForNewItemOrCompleted();<NEW_LINE>synchronized (wrapped) {<NEW_LINE>size = wrapped.size();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (index > size || size == 0)<NEW_LINE>throw new NoSuchElementException("Error on browsing at element " + index + " while the resultset contains only " + size + " items");<NEW_LINE>synchronized (wrapped) {<NEW_LINE>return wrapped.get(index++);<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void remove() {<NEW_LINE>throw new UnsupportedOperationException("OLegacyResultSet.iterator.remove()");<NEW_LINE>}<NEW_LINE>};<NEW_LINE>} | return index < wrapped.size(); |
1,317,315 | private void doEnableLocationProviders(HashMap<String, LocationProviderProxy> locationProviders) {<NEW_LINE>// Enable if we have 1+ location event listeners OR an async getCurrentPosition() callback queued<NEW_LINE>if (numLocationListeners > 0 || currentPositionCallback.size() > 0) {<NEW_LINE>disableLocationProviders();<NEW_LINE>Iterator<String> iterator = locationProviders<MASK><NEW_LINE>while (iterator.hasNext()) {<NEW_LINE>LocationProviderProxy locationProvider = locationProviders.get(iterator.next());<NEW_LINE>registerLocationProvider(locationProvider);<NEW_LINE>}<NEW_LINE>// On Android 12+, check for ACCESS_FINE_LOCATION.<NEW_LINE>// If ACCESS_FINE_LOCATION is denied, return last known location.<NEW_LINE>if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S && hasLocationPermissions()) {<NEW_LINE>Context context = TiApplication.getInstance();<NEW_LINE>int result = context.checkSelfPermission(Manifest.permission.ACCESS_FINE_LOCATION);<NEW_LINE>if (result == PackageManager.PERMISSION_DENIED) {<NEW_LINE>onLocationChanged(tiLocation.getLastKnownLocation());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .keySet().iterator(); |
312,026 | private void addMetrics(AggregationBuilder parentAgg, Heading heading, boolean addCount) {<NEW_LINE>for (Column metric : heading.columns()) {<NEW_LINE>if (metric.getOp() == Operation.AVG)<NEW_LINE>parentAgg.subAggregation(AggregationBuilders.avg(metric.getAggName()).field(metric.getColumn()));<NEW_LINE>else if (addCount && metric.getOp() == Operation.COUNT)<NEW_LINE>parentAgg.subAggregation(AggregationBuilders.count<MASK><NEW_LINE>else if (metric.getOp() == Operation.MAX)<NEW_LINE>parentAgg.subAggregation(AggregationBuilders.max(metric.getAggName()).field(metric.getColumn()));<NEW_LINE>else if (metric.getOp() == Operation.MIN)<NEW_LINE>parentAgg.subAggregation(AggregationBuilders.min(metric.getAggName()).field(metric.getColumn()));<NEW_LINE>else if (metric.getOp() == Operation.SUM)<NEW_LINE>parentAgg.subAggregation(AggregationBuilders.sum(metric.getAggName()).field(metric.getColumn()));<NEW_LINE>}<NEW_LINE>} | (metric.getAggName())); |
1,039,395 | public void onCompilationSuccess(OptimizedCallTarget target, TruffleInlining inliningDecision, GraphInfo graph, CompilationResultInfo result, int tier) {<NEW_LINE>CompilationData data = getCurrentData();<NEW_LINE>int compiledCodeSize = result.getTargetCodeSize();<NEW_LINE>statistics.finishCompilation(data.finish(), false, compiledCodeSize);<NEW_LINE>if (data.event != null) {<NEW_LINE>CompilationEvent event = data.event;<NEW_LINE>event.succeeded();<NEW_LINE>event.setCompiledCodeSize(compiledCodeSize);<NEW_LINE>if (target.getCodeAddress() != 0) {<NEW_LINE>event.setCompiledCodeAddress(target.getCodeAddress());<NEW_LINE>}<NEW_LINE>int calls = 0;<NEW_LINE>int inlinedCalls;<NEW_LINE>if (inliningDecision == null) {<NEW_LINE>TraceCompilationListener.CallCountVisitor visitor = new TraceCompilationListener.CallCountVisitor();<NEW_LINE>target.accept(visitor);<NEW_LINE>calls = visitor.calls;<NEW_LINE>inlinedCalls = 0;<NEW_LINE>} else {<NEW_LINE>calls = inliningDecision.countCalls();<NEW_LINE>inlinedCalls = inliningDecision.countInlinedCalls();<NEW_LINE>}<NEW_LINE>int dispatchedCalls = calls - inlinedCalls;<NEW_LINE>event.setInlinedCalls(inlinedCalls);<NEW_LINE>event.setDispatchedCalls(dispatchedCalls);<NEW_LINE>event.<MASK><NEW_LINE>event.setPartialEvaluationNodeCount(data.partialEvalNodeCount);<NEW_LINE>event.setPartialEvaluationTime((data.timePartialEvaluationFinished - data.timeCompilationStarted) / 1_000_000);<NEW_LINE>event.publish();<NEW_LINE>currentCompilation.remove();<NEW_LINE>}<NEW_LINE>} | setGraalNodeCount(graph.getNodeCount()); |
1,844,714 | private void refreshController(boolean keepLocation) throws IOException {<NEW_LINE>int diffIndex = -1;<NEW_LINE>if (controller != null) {<NEW_LINE>diffIndex = controller.getDifferenceIndex();<NEW_LINE>controller.removePropertyChangeListener(this);<NEW_LINE>addPropertyChangeListener(this);<NEW_LINE>if (locationKeeper != null) {<NEW_LINE>controller.removePropertyChangeListener(locationKeeper);<NEW_LINE>locationKeeper = null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// whatever the reason is that the fileobject isn't refreshed (!?),<NEW_LINE>// this is an explicit user refresh so<NEW_LINE>// refresh the FO explicitly as well<NEW_LINE>base.refresh();<NEW_LINE>modified.refresh();<NEW_LINE>StreamSource ss1 = new DiffStreamSource(base, type, false);<NEW_LINE>StreamSource ss2 = new DiffStreamSource(modified, type, true);<NEW_LINE>controller = DiffController.createEnhanced(ss1, ss2);<NEW_LINE>controller.addPropertyChangeListener(this);<NEW_LINE>if (keepLocation && diffIndex >= 0) {<NEW_LINE>final int fDiffIndex = diffIndex;<NEW_LINE>controller.addPropertyChangeListener(locationKeeper = new PropertyChangeListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void propertyChange(PropertyChangeEvent evt) {<NEW_LINE>if (DiffController.PROP_DIFFERENCES.equals(evt.getPropertyName())) {<NEW_LINE>if (controller.getDifferenceCount() > controller.getDifferenceIndex()) {<NEW_LINE>controller.setLocation(DiffController.DiffPane.Modified, DiffController.LocationType.DifferenceIndex, fDiffIndex);<NEW_LINE>}<NEW_LINE>controller.removePropertyChangeListener(this);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>controllerPanel.removeAll();<NEW_LINE>innerPanel = controller.getJComponent();<NEW_LINE>controllerPanel.add(innerPanel);<NEW_LINE>setName(innerPanel.getName());<NEW_LINE>Container c = getParent();<NEW_LINE>if (c != null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>activateNodes();<NEW_LINE>revalidate();<NEW_LINE>repaint();<NEW_LINE>} | c.setName(getName()); |
249,064 | final DescribeNodegroupResult executeDescribeNodegroup(DescribeNodegroupRequest describeNodegroupRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeNodegroupRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeNodegroupRequest> request = null;<NEW_LINE>Response<DescribeNodegroupResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeNodegroupRequestProtocolMarshaller(protocolFactory).marshall<MASK><NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EKS");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeNodegroup");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeNodegroupResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeNodegroupResultJsonUnmarshaller());<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(describeNodegroupRequest)); |
1,257,418 | private RubyString inspectStruct(final ThreadContext context, final boolean recur) {<NEW_LINE>final Ruby runtime = context.runtime;<NEW_LINE>RubyString buffer = RubyString.newString(runtime, new ByteList(32));<NEW_LINE>buffer.cat(STRUCT_BEG);<NEW_LINE>String cname = getMetaClass()<MASK><NEW_LINE>final char first = cname.charAt(0);<NEW_LINE>if (recur || first != '#') {<NEW_LINE>buffer.cat(cname.getBytes());<NEW_LINE>}<NEW_LINE>if (recur) {<NEW_LINE>return buffer.cat(STRUCT_END);<NEW_LINE>}<NEW_LINE>final RubyArray member = __member__();<NEW_LINE>for (int i = 0; i < member.getLength(); i++) {<NEW_LINE>if (i > 0) {<NEW_LINE>buffer.cat(',').cat(' ');<NEW_LINE>} else if (first != '#') {<NEW_LINE>buffer.cat(' ');<NEW_LINE>}<NEW_LINE>RubySymbol slot = (RubySymbol) member.eltInternal(i);<NEW_LINE>if (slot.validLocalVariableName() || slot.validConstantName()) {<NEW_LINE>buffer.cat19(RubyString.objAsString(context, slot));<NEW_LINE>} else {<NEW_LINE>buffer.cat19(((RubyString) slot.inspect(context)));<NEW_LINE>}<NEW_LINE>buffer.cat('=');<NEW_LINE>buffer.cat19(inspect(context, values[i]));<NEW_LINE>}<NEW_LINE>buffer.cat('>');<NEW_LINE>return (RubyString) buffer;<NEW_LINE>} | .getRealClass().getName(); |
1,684,432 | private void moveClassInstanceMethodWithStub(String className, Node methodDefinition, Node destinationParent) {<NEW_LINE>checkArgument(methodDefinition.isMemberFunctionDef(), methodDefinition);<NEW_LINE>Node classMembers = checkNotNull(methodDefinition.getParent());<NEW_LINE>checkState(classMembers.isClassMembers(), classMembers);<NEW_LINE>Node classNode = classMembers.getParent();<NEW_LINE>checkState(classNode.isClass(), classNode);<NEW_LINE>int stubId = idGenerator.newId();<NEW_LINE>// Put a stub definition after the class<NEW_LINE>// ClassName.prototype.propertyName = JSCompiler_stubMethod(id);<NEW_LINE>Node classNameDotPrototypeDotPropName = astFactory.createGetProp(astFactory.createPrototypeAccess(astFactory.createName(className, type(classNode))), methodDefinition.getString(), type(methodDefinition));<NEW_LINE>Node stubCall = createStubCall(methodDefinition, stubId);<NEW_LINE>Node stubDefinitionStatement = astFactory.createAssignStatement(classNameDotPrototypeDotPropName, stubCall).srcrefTreeIfMissing(methodDefinition);<NEW_LINE>Node <MASK><NEW_LINE>stubDefinitionStatement.insertAfter(classDefiningStatement);<NEW_LINE>// remove the definition from the class<NEW_LINE>methodDefinition.detach();<NEW_LINE>compiler.reportChangeToEnclosingScope(classMembers);<NEW_LINE>// Prepend unstub definition to the new location.<NEW_LINE>// ClassName.prototype.propertyName = JSCompiler_unstubMethod(id, function(...) {...});<NEW_LINE>Node classNameDotPrototypeDotPropName2 = classNameDotPrototypeDotPropName.cloneTree();<NEW_LINE>Node functionNode = checkNotNull(methodDefinition.getOnlyChild());<NEW_LINE>functionNode.detach();<NEW_LINE>Node unstubCall = createUnstubCall(functionNode, stubId);<NEW_LINE>Node statementNode = astFactory.createAssignStatement(classNameDotPrototypeDotPropName2, unstubCall).srcrefTreeIfMissing(methodDefinition);<NEW_LINE>destinationParent.addChildToFront(statementNode);<NEW_LINE>compiler.reportChangeToEnclosingScope(destinationParent);<NEW_LINE>} | classDefiningStatement = NodeUtil.getEnclosingStatement(classMembers); |
905,128 | private void doRegisterServiceProvided(Class<?> interfaceClass, Object service, boolean dynamicRegister) {<NEW_LINE>Objects.requireNonNull(service, "Service instance can not be null! Interface: " + interfaceClass.getName());<NEW_LINE>// #if ( can_do_strict_checking_of_service_registration )<NEW_LINE>// if (constructorFinished && !dynamicRegister) {<NEW_LINE>// throw new IllegalArgumentException(<NEW_LINE>// "Services must be registered during Plugin constructor: " + interfaceClass + ", " +<NEW_LINE>// getName());<NEW_LINE>// }<NEW_LINE>// #endif<NEW_LINE>if (!pluginDescription.getServicesProvided().contains(interfaceClass)) {<NEW_LINE>// #if ( can_do_strict_checking_of_service_registration )<NEW_LINE>// throw new IllegalArgumentException(<NEW_LINE>// "Services must be advertised in PluginInfo annotation: " + interfaceClass + ", " +<NEW_LINE>// getName());<NEW_LINE>// #else<NEW_LINE>Msg.warn(this, "Services must be advertised in @PluginInfo annotation - service " + <MASK><NEW_LINE>// #endif<NEW_LINE>}<NEW_LINE>services.add(new ServiceInterfaceImplementationPair(interfaceClass, service));<NEW_LINE>if (constructorFinished) {<NEW_LINE>tool.addService((Class<Object>) interfaceClass, service);<NEW_LINE>}<NEW_LINE>} | interfaceClass + "; from plugin " + getName()); |
772,036 | public void computeEnabled() {<NEW_LINE>boolean empty = model.getSignalCount() == 0;<NEW_LINE>boolean sel = !empty && !leftPanel.getSelectionModel().isSelectionEmpty();<NEW_LINE>setEnabled(LogisimMenuBar.CUT, sel);<NEW_LINE>setEnabled(LogisimMenuBar.COPY, sel);<NEW_LINE>setEnabled(LogisimMenuBar.PASTE, true);<NEW_LINE>setEnabled(LogisimMenuBar.DELETE, sel);<NEW_LINE>setEnabled(LogisimMenuBar.DUPLICATE, false);<NEW_LINE>setEnabled(LogisimMenuBar.SELECT_ALL, !empty);<NEW_LINE>// todo: raise/lower handlers<NEW_LINE>setEnabled(LogisimMenuBar.RAISE, sel);<NEW_LINE><MASK><NEW_LINE>setEnabled(LogisimMenuBar.RAISE_TOP, sel);<NEW_LINE>setEnabled(LogisimMenuBar.LOWER_BOTTOM, sel);<NEW_LINE>setEnabled(LogisimMenuBar.ADD_CONTROL, false);<NEW_LINE>setEnabled(LogisimMenuBar.REMOVE_CONTROL, false);<NEW_LINE>} | setEnabled(LogisimMenuBar.LOWER, sel); |
868,710 | private // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents<NEW_LINE>void initComponents() {<NEW_LINE>java.awt.GridBagConstraints gridBagConstraints;<NEW_LINE>pnlAttributes = new javax.swing.JPanel();<NEW_LINE>jLabel1 = new javax.swing.JLabel();<NEW_LINE>jLabel2 = new javax.swing.JLabel();<NEW_LINE>pnlAttributes.setLayout(new java.awt.GridBagLayout());<NEW_LINE>// NOI18N<NEW_LINE>org.openide.awt.Mnemonics.setLocalizedText(jLabel1, NbBundle.getMessage(SortPanel.class, "SortPanel.jLabel1.text"));<NEW_LINE>gridBagConstraints = new java.awt.GridBagConstraints();<NEW_LINE>gridBagConstraints.gridx = 0;<NEW_LINE>gridBagConstraints.gridy = 0;<NEW_LINE>gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;<NEW_LINE>gridBagConstraints.insets = new java.awt.Insets(0, 0, 3, 10);<NEW_LINE>pnlAttributes.add(jLabel1, gridBagConstraints);<NEW_LINE>// NOI18N<NEW_LINE>org.openide.awt.Mnemonics.setLocalizedText(jLabel2, NbBundle.getMessage(SortPanel.class, "SortPanel.jLabel2.text"));<NEW_LINE>gridBagConstraints = new java.awt.GridBagConstraints();<NEW_LINE>gridBagConstraints.gridx = 0;<NEW_LINE>gridBagConstraints.gridy = 1;<NEW_LINE>gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;<NEW_LINE>gridBagConstraints.insets = new java.awt.Insets(0, 0, 3, 10);<NEW_LINE>pnlAttributes.add(jLabel2, gridBagConstraints);<NEW_LINE>javax.swing.GroupLayout layout = new <MASK><NEW_LINE>this.setLayout(layout);<NEW_LINE>layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(layout.createSequentialGroup().addContainerGap().addComponent(pnlAttributes, javax.swing.GroupLayout.DEFAULT_SIZE, 600, Short.MAX_VALUE).addContainerGap()));<NEW_LINE>layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup().addContainerGap().addComponent(pnlAttributes, javax.swing.GroupLayout.DEFAULT_SIZE, 127, Short.MAX_VALUE).addContainerGap()));<NEW_LINE>} | javax.swing.GroupLayout(this); |
285,105 | private static Map<TypeVariable, Type> buildGenericInfo(Class<?> clazz) {<NEW_LINE>Class<?> childClass = clazz;<NEW_LINE>Class<?> currentClass = clazz.getSuperclass();<NEW_LINE>if (currentClass == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Map<TypeVariable, Type> typeVarMap = null;<NEW_LINE>// analyse the whole generic info from the class inheritance<NEW_LINE>for (; currentClass != null && currentClass != Object.class; childClass = currentClass, currentClass = currentClass.getSuperclass()) {<NEW_LINE>if (childClass.getGenericSuperclass() instanceof ParameterizedType) {<NEW_LINE>Type[] childGenericParentActualTypeArgs = ((ParameterizedType) childClass.getGenericSuperclass()).getActualTypeArguments();<NEW_LINE>TypeVariable[] currentTypeParameters = currentClass.getTypeParameters();<NEW_LINE>for (int i = 0; i < childGenericParentActualTypeArgs.length; i++) {<NEW_LINE>// if the child class's generic super class actual args is defined in the child class type parameters<NEW_LINE>if (typeVarMap == null) {<NEW_LINE>typeVarMap = new HashMap<TypeVariable, Type>();<NEW_LINE>}<NEW_LINE>if (typeVarMap.containsKey(childGenericParentActualTypeArgs[i])) {<NEW_LINE>Type actualArg = typeVarMap<MASK><NEW_LINE>typeVarMap.put(currentTypeParameters[i], actualArg);<NEW_LINE>} else {<NEW_LINE>typeVarMap.put(currentTypeParameters[i], childGenericParentActualTypeArgs[i]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return typeVarMap;<NEW_LINE>} | .get(childGenericParentActualTypeArgs[i]); |
841,172 | private String[] generateListenerMethodHeader(String methodName, Method originalMethod, Writer writer) throws IOException {<NEW_LINE>Class[] paramTypes = originalMethod.getParameterTypes();<NEW_LINE>String[] paramNames;<NEW_LINE>if (paramTypes.length == 1 && EventObject.class.isAssignableFrom(paramTypes[0])) {<NEW_LINE>paramNames = new String[] { EVT_VARIABLE_NAME };<NEW_LINE>} else {<NEW_LINE>paramNames = new String[paramTypes.length];<NEW_LINE>for (// NOI18N<NEW_LINE>int i = 0; // NOI18N<NEW_LINE>i < paramTypes.length; // NOI18N<NEW_LINE>i++) paramNames[i] = "param" + i;<NEW_LINE>}<NEW_LINE>// generate the method<NEW_LINE>// NOI18N<NEW_LINE>writer.write(methodName != null ? "private " : "public ");<NEW_LINE>writer.write(getSourceClassName(originalMethod.getReturnType()));<NEW_LINE>// NOI18N<NEW_LINE>writer.write(" ");<NEW_LINE>writer.write(methodName != null ? methodName : originalMethod.getName());<NEW_LINE>// NOI18N<NEW_LINE>writer.write("(");<NEW_LINE>for (int i = 0; i < paramTypes.length; i++) {<NEW_LINE>writer.write(<MASK><NEW_LINE>// NOI18N<NEW_LINE>writer.write(" ");<NEW_LINE>writer.write(paramNames[i]);<NEW_LINE>if (i + 1 < paramTypes.length)<NEW_LINE>// NOI18N<NEW_LINE>writer.write(", ");<NEW_LINE>}<NEW_LINE>// NOI18N<NEW_LINE>writer.write(")");<NEW_LINE>Class[] exceptions = originalMethod.getExceptionTypes();<NEW_LINE>if (exceptions.length != 0) {<NEW_LINE>// NOI18N<NEW_LINE>writer.write("throws ");<NEW_LINE>for (int i = 0; i < exceptions.length; i++) {<NEW_LINE>writer.write(getSourceClassName(exceptions[i]));<NEW_LINE>if (i + 1 < exceptions.length)<NEW_LINE>// NOI18N<NEW_LINE>writer.write(", ");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// NOI18N<NEW_LINE>writer.write(" {\n");<NEW_LINE>return paramNames;<NEW_LINE>} | getSourceClassName(paramTypes[i])); |
1,510,779 | private void checkCachedStream(Message m, OutputStream osOriginal, boolean enabled) throws Exception {<NEW_LINE>XMLStreamWriter writer = null;<NEW_LINE>if (enabled) {<NEW_LINE>writer = <MASK><NEW_LINE>} else {<NEW_LINE>writer = (XMLStreamWriter) m.get(XMLStreamWriter.class.getName());<NEW_LINE>}<NEW_LINE>if (writer instanceof CachingXmlEventWriter) {<NEW_LINE>CachingXmlEventWriter cache = (CachingXmlEventWriter) writer;<NEW_LINE>if (cache.getEvents().size() != 0) {<NEW_LINE>XMLStreamWriter origWriter = null;<NEW_LINE>try {<NEW_LINE>origWriter = StaxUtils.createXMLStreamWriter(osOriginal);<NEW_LINE>for (XMLEvent event : cache.getEvents()) {<NEW_LINE>StaxUtils.writeEvent(event, origWriter);<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>StaxUtils.close(origWriter);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>m.setContent(XMLStreamWriter.class, null);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (enabled) {<NEW_LINE>OutputStream os = m.getContent(OutputStream.class);<NEW_LINE>if (os != osOriginal && os instanceof CachedOutputStream) {<NEW_LINE>CachedOutputStream cos = (CachedOutputStream) os;<NEW_LINE>if (cos.size() != 0) {<NEW_LINE>cos.writeCacheTo(osOriginal);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | m.getContent(XMLStreamWriter.class); |
1,327,173 | static Point processPointIntersectOrDiff_(Point point, Geometry intersector, double tolerance, boolean bClipIn) {<NEW_LINE>if (point.isEmpty())<NEW_LINE>return ((Point) point.createInstance());<NEW_LINE>if (intersector.isEmpty()) {<NEW_LINE>return bClipIn ? ((Point) point.createInstance()) : null;<NEW_LINE>}<NEW_LINE>Point2D[] input_points = new Point2D[1];<NEW_LINE>PolygonUtils.PiPResult[] test_results = new PolygonUtils.PiPResult[1];<NEW_LINE>boolean bArea <MASK><NEW_LINE>if (intersector.getDimension() != 1 && intersector.getDimension() != 2)<NEW_LINE>throw GeometryException.GeometryInternalError();<NEW_LINE>input_points[0] = point.getXY();<NEW_LINE>if (bArea)<NEW_LINE>PolygonUtils.testPointsInArea2D(intersector, input_points, 1, tolerance, test_results);<NEW_LINE>else<NEW_LINE>PolygonUtils.testPointsOnLine2D(intersector, input_points, 1, tolerance, test_results);<NEW_LINE>boolean bTest = test_results[0] == PolygonUtils.PiPResult.PiPOutside;<NEW_LINE>if (!bClipIn)<NEW_LINE>bTest = !bTest;<NEW_LINE>if (!bTest)<NEW_LINE>return point;<NEW_LINE>else<NEW_LINE>return ((Point) point.createInstance());<NEW_LINE>} | = intersector.getDimension() == 2; |
1,640,922 | private void downloadSaneBody(SyncConfig syncConfig, Pop3Folder remoteFolder, BackendFolder backendFolder, Pop3Message message) throws MessagingException {<NEW_LINE>FetchProfile fp = new FetchProfile();<NEW_LINE>fp.add(FetchProfile.Item.BODY_SANE);<NEW_LINE>int maxDownloadSize = syncConfig.getMaximumAutoDownloadMessageSize();<NEW_LINE>remoteFolder.fetch(Collections.singletonList(message), fp, null, maxDownloadSize);<NEW_LINE>boolean completeMessage = false;<NEW_LINE>// Certain (POP3) servers give you the whole message even when you ask for only the first x Kb<NEW_LINE>if (!message.isSet(Flag.X_DOWNLOADED_FULL)) {<NEW_LINE>if (syncConfig.getMaximumAutoDownloadMessageSize() == 0 || message.getSize() < syncConfig.getMaximumAutoDownloadMessageSize()) {<NEW_LINE>completeMessage = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Store the updated message locally<NEW_LINE>if (completeMessage) {<NEW_LINE>backendFolder.<MASK><NEW_LINE>} else {<NEW_LINE>backendFolder.saveMessage(message, MessageDownloadState.PARTIAL);<NEW_LINE>}<NEW_LINE>} | saveMessage(message, MessageDownloadState.FULL); |
536,840 | private void buildMoreCompletionContext(Expression expression) {<NEW_LINE>ASTNode parentNode = null;<NEW_LINE>int kind = topKnownElementKind(SELECTION_OR_ASSIST_PARSER);<NEW_LINE>if (kind != 0) {<NEW_LINE>int info = topKnownElementInfo(SELECTION_OR_ASSIST_PARSER);<NEW_LINE>nextElement: switch(kind) {<NEW_LINE>case K_BETWEEN_CASE_AND_COLON:<NEW_LINE>if (this.expressionPtr > 0) {<NEW_LINE>SwitchStatement switchStatement = new SwitchStatement();<NEW_LINE>switchStatement.expression = this.expressionStack[this.expressionPtr - 1];<NEW_LINE>if (this.astLengthPtr > -1 && this.astPtr > -1) {<NEW_LINE>int length = this.astLengthStack[this.astLengthPtr];<NEW_LINE>int newAstPtr = this.astPtr - length;<NEW_LINE>ASTNode firstNode = this.astStack[newAstPtr + 1];<NEW_LINE>if (length != 0 && firstNode.sourceStart > switchStatement.expression.sourceEnd) {<NEW_LINE>switchStatement.statements = new Statement[length + 1];<NEW_LINE>System.arraycopy(this.astStack, newAstPtr + 1, switchStatement.statements, 0, length);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>CaseStatement caseStatement = new CaseStatement(expression, expression.sourceStart, expression.sourceEnd);<NEW_LINE>if (switchStatement.statements == null) {<NEW_LINE>switchStatement.statements <MASK><NEW_LINE>} else {<NEW_LINE>switchStatement.statements[switchStatement.statements.length - 1] = caseStatement;<NEW_LINE>}<NEW_LINE>parentNode = switchStatement;<NEW_LINE>this.assistNodeParent = parentNode;<NEW_LINE>}<NEW_LINE>break nextElement;<NEW_LINE>case K_INSIDE_RETURN_STATEMENT:<NEW_LINE>if (info == this.bracketDepth) {<NEW_LINE>ReturnStatement returnStatement = new ReturnStatement(expression, expression.sourceStart, expression.sourceEnd);<NEW_LINE>parentNode = returnStatement;<NEW_LINE>this.assistNodeParent = parentNode;<NEW_LINE>}<NEW_LINE>break nextElement;<NEW_LINE>case K_CAST_STATEMENT:<NEW_LINE>Expression castType;<NEW_LINE>if (this.expressionPtr > 0 && ((castType = this.expressionStack[this.expressionPtr - 1]) instanceof TypeReference)) {<NEW_LINE>CastExpression cast = new CastExpression(expression, (TypeReference) castType);<NEW_LINE>cast.sourceStart = castType.sourceStart;<NEW_LINE>cast.sourceEnd = expression.sourceEnd;<NEW_LINE>parentNode = cast;<NEW_LINE>this.assistNodeParent = parentNode;<NEW_LINE>}<NEW_LINE>break nextElement;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Do not add assist node/parent into the recovery system if we are inside a lambda. The lambda will be fully recovered including the containing statement and added.<NEW_LINE>if (lastIndexOfElement(K_LAMBDA_EXPRESSION_DELIMITER) < 0) {<NEW_LINE>if (parentNode != null) {<NEW_LINE>this.currentElement = this.currentElement.add((Statement) parentNode, 0);<NEW_LINE>} else {<NEW_LINE>this.currentElement = this.currentElement.add((Statement) wrapWithExplicitConstructorCallIfNeeded(expression), 0);<NEW_LINE>if (this.lastCheckPoint < expression.sourceEnd) {<NEW_LINE>this.lastCheckPoint = expression.sourceEnd + 1;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | = new Statement[] { caseStatement }; |
938,174 | static Map<String, Float> resolveMappingFields(SearchExecutionContext context, Map<String, Float> fieldsAndWeights, String fieldSuffix) {<NEW_LINE>Map<String, Float> <MASK><NEW_LINE>for (Map.Entry<String, Float> fieldEntry : fieldsAndWeights.entrySet()) {<NEW_LINE>boolean allField = Regex.isMatchAllPattern(fieldEntry.getKey());<NEW_LINE>boolean multiField = Regex.isSimpleMatchPattern(fieldEntry.getKey());<NEW_LINE>float weight = fieldEntry.getValue() == null ? 1.0f : fieldEntry.getValue();<NEW_LINE>Map<String, Float> fieldMap = resolveMappingField(context, fieldEntry.getKey(), weight, multiField == false, allField == false, fieldSuffix);<NEW_LINE>for (Map.Entry<String, Float> field : fieldMap.entrySet()) {<NEW_LINE>float boost = field.getValue();<NEW_LINE>if (resolvedFields.containsKey(field.getKey())) {<NEW_LINE>boost *= resolvedFields.get(field.getKey());<NEW_LINE>}<NEW_LINE>resolvedFields.put(field.getKey(), boost);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>checkForTooManyFields(resolvedFields.size(), null);<NEW_LINE>return resolvedFields;<NEW_LINE>} | resolvedFields = new HashMap<>(); |
174,452 | public static QueryTimeTemplateDetailResponse unmarshall(QueryTimeTemplateDetailResponse queryTimeTemplateDetailResponse, UnmarshallerContext _ctx) {<NEW_LINE>queryTimeTemplateDetailResponse.setRequestId(_ctx.stringValue("QueryTimeTemplateDetailResponse.RequestId"));<NEW_LINE>queryTimeTemplateDetailResponse.setSuccess(_ctx.booleanValue("QueryTimeTemplateDetailResponse.Success"));<NEW_LINE>queryTimeTemplateDetailResponse.setErrorMessage(_ctx.stringValue("QueryTimeTemplateDetailResponse.ErrorMessage"));<NEW_LINE>queryTimeTemplateDetailResponse.setCode(_ctx.stringValue("QueryTimeTemplateDetailResponse.Code"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.set_Default(_ctx.integerValue("QueryTimeTemplateDetailResponse.Data.Default"));<NEW_LINE>data.setName(_ctx.stringValue("QueryTimeTemplateDetailResponse.Data.Name"));<NEW_LINE>data.setTemplateId(_ctx.stringValue("QueryTimeTemplateDetailResponse.Data.TemplateId"));<NEW_LINE>data.setAllDay<MASK><NEW_LINE>List<TimeSectionListItem> timeSectionList = new ArrayList<TimeSectionListItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("QueryTimeTemplateDetailResponse.Data.TimeSectionList.Length"); i++) {<NEW_LINE>TimeSectionListItem timeSectionListItem = new TimeSectionListItem();<NEW_LINE>timeSectionListItem.setDayOfWeek(_ctx.integerValue("QueryTimeTemplateDetailResponse.Data.TimeSectionList[" + i + "].DayOfWeek"));<NEW_LINE>timeSectionListItem.setBegin(_ctx.integerValue("QueryTimeTemplateDetailResponse.Data.TimeSectionList[" + i + "].Begin"));<NEW_LINE>timeSectionListItem.setEnd(_ctx.integerValue("QueryTimeTemplateDetailResponse.Data.TimeSectionList[" + i + "].End"));<NEW_LINE>timeSectionList.add(timeSectionListItem);<NEW_LINE>}<NEW_LINE>data.setTimeSectionList(timeSectionList);<NEW_LINE>queryTimeTemplateDetailResponse.setData(data);<NEW_LINE>return queryTimeTemplateDetailResponse;<NEW_LINE>} | (_ctx.integerValue("QueryTimeTemplateDetailResponse.Data.AllDay")); |
742,252 | public RecordStore openRecordStore(String recordStoreName, boolean createIfNecessary) throws RecordStoreException {<NEW_LINE>initializeIfNecessary();<NEW_LINE>recordStoreName = recordStoreName.replaceAll(FileUtils.ILLEGAL_FILENAME_CHARS, "");<NEW_LINE>Object value = recordStores.get(recordStoreName);<NEW_LINE>if (value instanceof RecordStoreImpl && ((RecordStoreImpl) value).isOpen()) {<NEW_LINE>((RecordStoreImpl) value).setOpen();<NEW_LINE>return (RecordStoreImpl) value;<NEW_LINE>}<NEW_LINE>RecordStoreImpl recordStoreImpl;<NEW_LINE>String headerName = getHeaderFileName(recordStoreName);<NEW_LINE>File headerFile = new File(AppClassLoader.getDataDir(), headerName);<NEW_LINE>try (DataInputStream dis = new DataInputStream(new FileInputStream(headerFile))) {<NEW_LINE>recordStoreImpl = new RecordStoreImpl(this);<NEW_LINE>recordStoreImpl.readHeader(dis);<NEW_LINE>recordStoreImpl.setOpen();<NEW_LINE>} catch (FileNotFoundException e) {<NEW_LINE>if (!createIfNecessary) {<NEW_LINE>throw new RecordStoreNotFoundException(recordStoreName);<NEW_LINE>}<NEW_LINE>recordStoreImpl = new RecordStoreImpl(this, recordStoreName);<NEW_LINE>recordStoreImpl.setOpen();<NEW_LINE>saveToDisk(recordStoreImpl, -1);<NEW_LINE>} catch (IOException e) {<NEW_LINE>Log.w(TAG, "openRecordStore: broken header " + headerFile, e);<NEW_LINE>recordStoreImpl = new RecordStoreImpl(this, recordStoreName);<NEW_LINE>recordStoreImpl.setOpen();<NEW_LINE>saveToDisk(recordStoreImpl, -1);<NEW_LINE>}<NEW_LINE>recordStores.put(recordStoreName, recordStoreImpl);<NEW_LINE>synchronized (recordStoreImpl.records) {<NEW_LINE>File dataDir = new File(AppClassLoader.getDataDir());<NEW_LINE>String prefix = recordStoreName + ".";<NEW_LINE>String[] files = dataDir.list();<NEW_LINE>if (files != null) {<NEW_LINE>for (String name : files) {<NEW_LINE>if (name.startsWith(prefix) && name.endsWith(RECORD_STORE_RECORD_SUFFIX)) {<NEW_LINE>File file = new File(dataDir, name);<NEW_LINE>try (DataInputStream dis = new DataInputStream(new FileInputStream(file))) {<NEW_LINE>recordStoreImpl.readRecord(dis);<NEW_LINE>} catch (IOException e) {<NEW_LINE>Log.w(TAG, "loadFromDisk: broken record " + file, e);<NEW_LINE>int pLen = prefix.length();<NEW_LINE>int sLen = RECORD_STORE_RECORD_SUFFIX.length();<NEW_LINE>int nLen = name.length();<NEW_LINE>if (pLen + sLen < nLen) {<NEW_LINE>try {<NEW_LINE>int recordId = Integer.parseInt(name.substring(pLen, nLen - sLen));<NEW_LINE>recordStoreImpl.records.put(recordId, new byte[0]);<NEW_LINE>} catch (NumberFormatException numberFormatException) {<NEW_LINE>Log.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Log.d(TAG, "RecordStore " + recordStoreName + " opened");<NEW_LINE>return recordStoreImpl;<NEW_LINE>} | w(TAG, "loadFromDisk: ERROR stubbing broken record " + file); |
188,360 | public SubModule unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>SubModule subModule = new SubModule();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("commitId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>subModule.setCommitId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("absolutePath", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>subModule.setAbsolutePath(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("relativePath", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>subModule.setRelativePath(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 subModule;<NEW_LINE>} | class).unmarshall(context)); |
476,650 | static protected Geometry simplifyAsFeature(/* const */<NEW_LINE>Geometry geometry, /* const */<NEW_LINE>SpatialReference spatialReference, boolean bForce, ProgressTracker progressTracker) {<NEW_LINE>if (geometry.isEmpty())<NEW_LINE>return geometry;<NEW_LINE>Geometry.Type gt = geometry.getType();<NEW_LINE>if (gt == Geometry.Type.Point)<NEW_LINE>return geometry;<NEW_LINE>double tolerance = InternalUtils.calculateToleranceFromGeometry(spatialReference, geometry, false);<NEW_LINE>if (gt == Geometry.Type.Envelope) {<NEW_LINE>Envelope env = (Envelope) geometry;<NEW_LINE>Envelope2D env2D = new Envelope2D();<NEW_LINE>env.queryEnvelope2D(env2D);<NEW_LINE>if (env2D.isDegenerate(tolerance)) {<NEW_LINE>// return empty<NEW_LINE>return (Geometry) (env.createInstance());<NEW_LINE>// geometry<NEW_LINE>}<NEW_LINE>return geometry;<NEW_LINE>} else if (Geometry.isSegment(gt.value())) {<NEW_LINE>Segment seg = (Segment) geometry;<NEW_LINE>Polyline polyline = new Polyline(seg.getDescription());<NEW_LINE>polyline.addSegment(seg, true);<NEW_LINE>return simplifyAsFeature(polyline, spatialReference, bForce, progressTracker);<NEW_LINE>}<NEW_LINE>double geomTolerance = 0;<NEW_LINE>int isSimple = ((MultiVertexGeometryImpl) geometry._getImpl()).getIsSimple(tolerance);<NEW_LINE>int knownSimpleResult = bForce ? GeometryXSimple.Unknown : isSimple;<NEW_LINE>// TODO: need to distinguish KnownSimple between SimpleAsFeature and<NEW_LINE>// SimplePlanar.<NEW_LINE>// From the first sight it seems the SimplePlanar implies<NEW_LINE>// SimpleAsFeature.<NEW_LINE>if (knownSimpleResult == GeometryXSimple.Strong) {<NEW_LINE>if (gt == Geometry.Type.Polygon && ((Polygon) geometry).getFillRule() != Polygon.FillRule.enumFillRuleOddEven) {<NEW_LINE><MASK><NEW_LINE>// standardize on odd_even fill rule<NEW_LINE>((Polygon) res).setFillRule(Polygon.FillRule.enumFillRuleOddEven);<NEW_LINE>return res;<NEW_LINE>}<NEW_LINE>return geometry;<NEW_LINE>}<NEW_LINE>OperatorSimplifyLocalHelper helper = new OperatorSimplifyLocalHelper(geometry, spatialReference, knownSimpleResult, progressTracker, false);<NEW_LINE>Geometry result;<NEW_LINE>if (gt == Geometry.Type.MultiPoint) {<NEW_LINE>result = (Geometry) (helper.multiPointSimplifyAsFeature_());<NEW_LINE>} else if (gt == Geometry.Type.Polyline) {<NEW_LINE>result = (Geometry) (helper.polylineSimplifyAsFeature_());<NEW_LINE>} else if (gt == Geometry.Type.Polygon) {<NEW_LINE>result = (Geometry) (helper.polygonSimplifyAsFeature_());<NEW_LINE>} else {<NEW_LINE>// what else?<NEW_LINE>throw GeometryException.GeometryInternalError();<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | Geometry res = geometry.copy(); |
775,985 | private static void sortNodes(DBNNode[] children) {<NEW_LINE>final DBPPreferenceStore prefStore = DBWorkbench.getPlatform().getPreferenceStore();<NEW_LINE>// Sort children is we have this feature on in preferences<NEW_LINE>// and if children are not folders<NEW_LINE>if (children.length > 0) {<NEW_LINE>DBNNode firstChild = children[0];<NEW_LINE>boolean isResources <MASK><NEW_LINE>{<NEW_LINE>if (isResources) {<NEW_LINE>Arrays.sort(children, NodeFolderComparator.INSTANCE);<NEW_LINE>} else if (prefStore.getBoolean(ModelPreferences.NAVIGATOR_SORT_ALPHABETICALLY) || isMergedEntity(firstChild)) {<NEW_LINE>if (!(firstChild instanceof DBNContainer)) {<NEW_LINE>Arrays.sort(children, NodeNameComparator.INSTANCE);<NEW_LINE>}<NEW_LINE>} else if (prefStore.getBoolean(ModelPreferences.NAVIGATOR_SORT_FOLDERS_FIRST)) {<NEW_LINE>Arrays.sort(children, NodeFolderComparator.INSTANCE);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | = firstChild instanceof DBNResource || firstChild instanceof DBNPath; |
218,565 | public static void main(@NotNull String... args) throws IOException, InterruptedException {<NEW_LINE>if (args.length < 1) {<NEW_LINE>System.err.println("Usage: java " + ChronicleReader.class.getName() + " {chronicle-base-path} [from-index]");<NEW_LINE>System.exit(-1);<NEW_LINE>}<NEW_LINE>int dataBitsHintSize = Integer.getInteger("dataBitsHintSize", IndexedChronicle.DEFAULT_DATA_BITS_SIZE);<NEW_LINE>String def = ByteOrder.nativeOrder() == ByteOrder.BIG_ENDIAN ? "Big" : "Little";<NEW_LINE>ByteOrder byteOrder = System.getProperty("byteOrder", def).equalsIgnoreCase("Big") ? ByteOrder.BIG_ENDIAN : ByteOrder.LITTLE_ENDIAN;<NEW_LINE>String basePath = args[0];<NEW_LINE>long index = args.length > 1 ? Long.parseLong(args[1]) : 0L;<NEW_LINE>IndexedChronicle ic = new IndexedChronicle(basePath, dataBitsHintSize, byteOrder);<NEW_LINE>Excerpt excerpt = ic.createExcerpt();<NEW_LINE>// noinspection InfiniteLoopStatement<NEW_LINE>while (true) {<NEW_LINE>while (!excerpt.index(index)) Thread.sleep(50);<NEW_LINE>System.out.print(index + ": ");<NEW_LINE>int nullCount = 0;<NEW_LINE>while (excerpt.remaining() > 0) {<NEW_LINE>char ch = (char) excerpt.readUnsignedByte();<NEW_LINE>if (ch == 0) {<NEW_LINE>nullCount++;<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (nullCount > 0)<NEW_LINE>System.out.print(" " + nullCount + "*\\0");<NEW_LINE>nullCount = 0;<NEW_LINE>if (ch < ' ')<NEW_LINE>System.out.print("^" + (char) (ch + '@'));<NEW_LINE>else if (ch > 126)<NEW_LINE>System.out.print("\\x" + Integer.toHexString(ch));<NEW_LINE>else<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (nullCount > 0)<NEW_LINE>System.out.print(" " + nullCount + "*\\0");<NEW_LINE>System.out.println();<NEW_LINE>index++;<NEW_LINE>}<NEW_LINE>} | System.out.print(ch); |
490,405 | public CopyPackageVersionsResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>CopyPackageVersionsResult copyPackageVersionsResult = new CopyPackageVersionsResult();<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 copyPackageVersionsResult;<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("successfulVersions", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>copyPackageVersionsResult.setSuccessfulVersions(new MapUnmarshaller<String, SuccessfulPackageVersionInfo>(context.getUnmarshaller(String.class), SuccessfulPackageVersionInfoJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("failedVersions", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>copyPackageVersionsResult.setFailedVersions(new MapUnmarshaller<String, PackageVersionError>(context.getUnmarshaller(String.class), PackageVersionErrorJsonUnmarshaller.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 copyPackageVersionsResult;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
556,939 | final GetSupportedResourceTypesResult executeGetSupportedResourceTypes(GetSupportedResourceTypesRequest getSupportedResourceTypesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getSupportedResourceTypesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<GetSupportedResourceTypesRequest> request = null;<NEW_LINE>Response<GetSupportedResourceTypesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetSupportedResourceTypesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getSupportedResourceTypesRequest));<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, "Backup");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetSupportedResourceTypes");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetSupportedResourceTypesResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetSupportedResourceTypesResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.startEvent(Field.ClientExecuteTime); |
1,205,083 | private ParticleController createDefaultModelInstanceController() {<NEW_LINE>// Emission<NEW_LINE>RegularEmitter emitter = new RegularEmitter();<NEW_LINE>emitter.getDuration().setLow(3000);<NEW_LINE>emitter.<MASK><NEW_LINE>emitter.getLife().setHigh(500, 1000);<NEW_LINE>emitter.getLife().setTimeline(new float[] { 0, 0.66f, 1 });<NEW_LINE>emitter.getLife().setScaling(new float[] { 1, 1, 0.3f });<NEW_LINE>emitter.setMaxParticleCount(100);<NEW_LINE>// Color<NEW_LINE>ColorInfluencer.Random colorInfluencer = new ColorInfluencer.Random();<NEW_LINE>// Spawn<NEW_LINE>EllipseSpawnShapeValue spawnShapeValue = new EllipseSpawnShapeValue();<NEW_LINE>spawnShapeValue.setDimensions(1, 1, 1);<NEW_LINE>SpawnInfluencer spawnSource = new SpawnInfluencer(spawnShapeValue);<NEW_LINE>// Velocity<NEW_LINE>DynamicsInfluencer velocityInfluencer = new DynamicsInfluencer();<NEW_LINE>// Directional<NEW_LINE>DynamicsModifier.CentripetalAcceleration velocityValue = new DynamicsModifier.CentripetalAcceleration();<NEW_LINE>velocityValue.strengthValue.setHigh(5, 11);<NEW_LINE>velocityValue.strengthValue.setActive(true);<NEW_LINE>// velocityValue.setActive(true);<NEW_LINE>velocityInfluencer.velocities.add(velocityValue);<NEW_LINE>// VelocityModifier.FaceDirection faceVelocityValue = new VelocityModifier.FaceDirection();<NEW_LINE>// velocityInfluencer.velocities.add(faceVelocityValue);<NEW_LINE>return new ParticleController("ModelInstance Controller", emitter, new ModelInstanceRenderer(editor.getModelInstanceParticleBatch()), new ModelInfluencer.Single((Model) editor.assetManager.get(FlameMain.DEFAULT_MODEL_PARTICLE)), spawnSource, colorInfluencer, velocityInfluencer);<NEW_LINE>} | getEmission().setHigh(80); |
844,444 | public static DescribeVServerGroupAttributeResponse unmarshall(DescribeVServerGroupAttributeResponse describeVServerGroupAttributeResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeVServerGroupAttributeResponse.setRequestId<MASK><NEW_LINE>describeVServerGroupAttributeResponse.setServiceManagedMode(_ctx.stringValue("DescribeVServerGroupAttributeResponse.ServiceManagedMode"));<NEW_LINE>describeVServerGroupAttributeResponse.setVServerGroupId(_ctx.stringValue("DescribeVServerGroupAttributeResponse.VServerGroupId"));<NEW_LINE>describeVServerGroupAttributeResponse.setVServerGroupName(_ctx.stringValue("DescribeVServerGroupAttributeResponse.VServerGroupName"));<NEW_LINE>describeVServerGroupAttributeResponse.setLoadBalancerId(_ctx.stringValue("DescribeVServerGroupAttributeResponse.LoadBalancerId"));<NEW_LINE>List<BackendServer> backendServers = new ArrayList<BackendServer>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeVServerGroupAttributeResponse.BackendServers.Length"); i++) {<NEW_LINE>BackendServer backendServer = new BackendServer();<NEW_LINE>backendServer.setVpcId(_ctx.stringValue("DescribeVServerGroupAttributeResponse.BackendServers[" + i + "].VpcId"));<NEW_LINE>backendServer.setType(_ctx.stringValue("DescribeVServerGroupAttributeResponse.BackendServers[" + i + "].Type"));<NEW_LINE>backendServer.setWeight(_ctx.integerValue("DescribeVServerGroupAttributeResponse.BackendServers[" + i + "].Weight"));<NEW_LINE>backendServer.setProxyProtocolV2Enabled(_ctx.booleanValue("DescribeVServerGroupAttributeResponse.BackendServers[" + i + "].ProxyProtocolV2Enabled"));<NEW_LINE>backendServer.setDescription(_ctx.stringValue("DescribeVServerGroupAttributeResponse.BackendServers[" + i + "].Description"));<NEW_LINE>backendServer.setServerRegionId(_ctx.stringValue("DescribeVServerGroupAttributeResponse.BackendServers[" + i + "].ServerRegionId"));<NEW_LINE>backendServer.setServerIp(_ctx.stringValue("DescribeVServerGroupAttributeResponse.BackendServers[" + i + "].ServerIp"));<NEW_LINE>backendServer.setPort(_ctx.integerValue("DescribeVServerGroupAttributeResponse.BackendServers[" + i + "].Port"));<NEW_LINE>backendServer.setVbrId(_ctx.stringValue("DescribeVServerGroupAttributeResponse.BackendServers[" + i + "].VbrId"));<NEW_LINE>backendServer.setServerId(_ctx.stringValue("DescribeVServerGroupAttributeResponse.BackendServers[" + i + "].ServerId"));<NEW_LINE>backendServers.add(backendServer);<NEW_LINE>}<NEW_LINE>describeVServerGroupAttributeResponse.setBackendServers(backendServers);<NEW_LINE>return describeVServerGroupAttributeResponse;<NEW_LINE>} | (_ctx.stringValue("DescribeVServerGroupAttributeResponse.RequestId")); |
1,852,804 | private static void clip3primeEndsTo5primeEnds(final SAMRecord pos, final SAMRecord neg, final boolean hardClipReads, final boolean useUnclippedEnds) {<NEW_LINE>final int negEnd = useUnclippedEnds ? neg.getUnclippedEnd() : neg.getEnd();<NEW_LINE>final int posStart = useUnclippedEnds ? pos.getUnclippedStart() : pos.getStart();<NEW_LINE>final int <MASK><NEW_LINE>if (pos3PrimeMostUnclipped > 0 && pos3PrimeMostUnclipped < pos.getReadLength()) {<NEW_LINE>final int pos5PrimeMostClipped = pos3PrimeMostUnclipped + 1;<NEW_LINE>clip3PrimeEndOfRead(pos, pos5PrimeMostClipped, hardClipReads);<NEW_LINE>}<NEW_LINE>// this is the position counting from the aligned start of the read<NEW_LINE>final int neg5PrimeMostBaseToClipPositionFromStart = getReadPositionAtReferencePositionIgnoreSoftClips(neg, posStart - 1);<NEW_LINE>// this is the position counting from the 5' end of the read<NEW_LINE>final int negFirstBaseFrom5PrimeEndToClip = neg5PrimeMostBaseToClipPositionFromStart > 0 ? (neg.getReadLength() + 1) - neg5PrimeMostBaseToClipPositionFromStart : 0;<NEW_LINE>if (negFirstBaseFrom5PrimeEndToClip > 0) {<NEW_LINE>clip3PrimeEndOfRead(neg, negFirstBaseFrom5PrimeEndToClip, hardClipReads);<NEW_LINE>}<NEW_LINE>} | pos3PrimeMostUnclipped = getReadPositionAtReferencePositionIgnoreSoftClips(pos, negEnd); |
1,441,234 | public void endElement(String uri, String localName, String qName) throws SAXException {<NEW_LINE>if (itemList.size() < maxItemCount) {<NEW_LINE>if ("item".equals(localName) || "entry".equals(localName)) {<NEW_LINE>// NOI18N<NEW_LINE>if (null != currentItem && currentItem.isValid()) {<NEW_LINE>itemList.add(currentItem);<NEW_LINE>}<NEW_LINE>currentItem = null;<NEW_LINE>} else if (null != currentItem && null != textBuffer) {<NEW_LINE>String text = textBuffer<MASK><NEW_LINE>textBuffer = null;<NEW_LINE>if (0 == text.length())<NEW_LINE>text = null;<NEW_LINE>if ("link".equals(localName) && null == currentItem.link) {<NEW_LINE>// NOI18N<NEW_LINE>currentItem.link = fixFeedItemUrl(text);<NEW_LINE>} else if (// NOI18N<NEW_LINE>"pubDate".equals(localName) || "published".equals(localName) || "date".equals(localName)) {<NEW_LINE>// NOI18N<NEW_LINE>currentItem.dateTime = text;<NEW_LINE>} else if ("title".equals(localName)) {<NEW_LINE>// NOI18N<NEW_LINE>currentItem.title = text;<NEW_LINE>} else if ("description".equals(localName) || "content".equals(localName)) {<NEW_LINE>// NOI18N<NEW_LINE>currentItem.description = text;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .toString().trim(); |
1,485,817 | private void sendHttp2Response0(HttpResponseStatus status, boolean error, ByteBuf data) {<NEW_LINE>Http2Headers headers = new DefaultHttp2Headers().status(status.codeAsText());<NEW_LINE>if (request.getSerializeType() > 0) {<NEW_LINE>String serialization = SerializerFactory.getAliasByCode(request.getSerializeType());<NEW_LINE>headers.<MASK><NEW_LINE>} else {<NEW_LINE>headers.set(CONTENT_TYPE, "text/plain; charset=" + RpcConstants.DEFAULT_CHARSET.displayName());<NEW_LINE>}<NEW_LINE>if (error) {<NEW_LINE>headers.set(RemotingConstants.HEAD_RESPONSE_ERROR, "true");<NEW_LINE>}<NEW_LINE>if (data != null) {<NEW_LINE>encoder.writeHeaders(ctx, streamId, headers, 0, false, ctx.newPromise());<NEW_LINE>encoder.writeData(ctx, streamId, data, 0, true, ctx.newPromise());<NEW_LINE>} else {<NEW_LINE>encoder.writeHeaders(ctx, streamId, headers, 0, true, ctx.newPromise());<NEW_LINE>}<NEW_LINE>} | set(RemotingConstants.HEAD_SERIALIZE_TYPE, serialization); |
126,860 | public int createTextureAtlas(final int width, final int height) {<NEW_LINE>try {<NEW_LINE>// we initialize a buffer here that will be used as base for all texture atlas images<NEW_LINE>if (initialData == null) {<NEW_LINE>initialData = BufferUtils.createByteBuffer(width * height * 4);<NEW_LINE>for (int i = 0; i < width * height; i++) {<NEW_LINE>initialData<MASK><NEW_LINE>initialData.put((byte) 0x00);<NEW_LINE>initialData.put((byte) 0x00);<NEW_LINE>initialData.put((byte) 0xff);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int atlasId = addTexture(createAtlasTextureInternal(width, height));<NEW_LINE>return atlasId;<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.log(Level.WARNING, e.getMessage(), e);<NEW_LINE>// TODO Nifty always expects this call to be successful<NEW_LINE>return 0;<NEW_LINE>// there currently is no way to return failure or something :/<NEW_LINE>}<NEW_LINE>} | .put((byte) 0x00); |
308,071 | private void register(Kryo kryo, Class<?>[] types, Serializer<?> serializer, int id) {<NEW_LINE>Registration <MASK><NEW_LINE>if (existing != null) {<NEW_LINE>boolean matches = false;<NEW_LINE>for (Class<?> type : types) {<NEW_LINE>if (existing.getType() == type) {<NEW_LINE>matches = true;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!matches) {<NEW_LINE>LOGGER.error("{}: Failed to register {} as {}, {} was already registered.", friendlyName(), types, id, existing.getType());<NEW_LINE>throw new IllegalStateException(String.format("Failed to register %s as %s, %s was already registered.", Arrays.toString(types), id, existing.getType()));<NEW_LINE>}<NEW_LINE>// falling through to register call for now.<NEW_LINE>// Consider skipping, if there's reasonable<NEW_LINE>// way to compare serializer equivalence.<NEW_LINE>}<NEW_LINE>for (Class<?> type : types) {<NEW_LINE>Registration r = null;<NEW_LINE>if (serializer == null) {<NEW_LINE>r = kryo.register(type, id);<NEW_LINE>} else if (type.isInterface()) {<NEW_LINE>kryo.addDefaultSerializer(type, serializer);<NEW_LINE>} else {<NEW_LINE>r = kryo.register(type, serializer, id);<NEW_LINE>}<NEW_LINE>if (r != null) {<NEW_LINE>if (r.getId() != id) {<NEW_LINE>LOGGER.debug("{}: {} already registered as {}. Skipping {}.", friendlyName(), r.getType(), r.getId(), id);<NEW_LINE>}<NEW_LINE>LOGGER.trace("{} registered as {}", r.getType(), r.getId());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | existing = kryo.getRegistration(id); |
900,240 | private void updateChildren() {<NEW_LINE>Node newLeft = leftProperty().get();<NEW_LINE>// Remove leftPane in any case<NEW_LINE>getChildren().remove(leftPane);<NEW_LINE>if (newLeft != null) {<NEW_LINE>leftPane = new StackPane(newLeft);<NEW_LINE>leftPane.setManaged(false);<NEW_LINE>leftPane.setAlignment(Pos.CENTER_LEFT);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>leftPane.getStyleClass().add("left-pane");<NEW_LINE>getChildren().add(leftPane);<NEW_LINE>left = newLeft;<NEW_LINE>} else {<NEW_LINE>leftPane = null;<NEW_LINE>left = null;<NEW_LINE>}<NEW_LINE>Node newRight = rightProperty().get();<NEW_LINE>// Remove rightPane in anycase<NEW_LINE>getChildren().remove(rightPane);<NEW_LINE>if (newRight != null) {<NEW_LINE>rightPane = new StackPane(newRight);<NEW_LINE>rightPane.setManaged(false);<NEW_LINE>rightPane.setAlignment(Pos.CENTER_RIGHT);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>rightPane.getStyleClass().add("right-pane");<NEW_LINE><MASK><NEW_LINE>right = newRight;<NEW_LINE>} else {<NEW_LINE>rightPane = null;<NEW_LINE>right = null;<NEW_LINE>}<NEW_LINE>control.pseudoClassStateChanged(HAS_LEFT_NODE, left != null);<NEW_LINE>control.pseudoClassStateChanged(HAS_RIGHT_NODE, right != null);<NEW_LINE>control.pseudoClassStateChanged(HAS_NO_SIDE_NODE, left == null && right == null);<NEW_LINE>} | getChildren().add(rightPane); |
622,271 | protected void generateComponentLifecycle() {<NEW_LINE>// 1. onCreate:<NEW_LINE>searchAndBuildMethod(AndroidEntryPointConstants.SERVICE_ONCREATE, component, thisLocal);<NEW_LINE>// service has two different lifecycles:<NEW_LINE>// lifecycle1:<NEW_LINE>// 2. onStart:<NEW_LINE>searchAndBuildMethod(AndroidEntryPointConstants.SERVICE_ONSTART1, component, thisLocal);<NEW_LINE>// onStartCommand can be called an arbitrary number of times, or never<NEW_LINE>NopStmt beforeStartCommand = Jimple.v().newNopStmt();<NEW_LINE>NopStmt afterStartCommand = Jimple.v().newNopStmt();<NEW_LINE>body.getUnits().add(beforeStartCommand);<NEW_LINE>createIfStmt(afterStartCommand);<NEW_LINE>searchAndBuildMethod(AndroidEntryPointConstants.SERVICE_ONSTART2, component, thisLocal);<NEW_LINE>createIfStmt(beforeStartCommand);<NEW_LINE>body.getUnits().add(afterStartCommand);<NEW_LINE>// methods:<NEW_LINE>// all other entryPoints of this class:<NEW_LINE>NopStmt startWhileStmt = Jimple.v().newNopStmt();<NEW_LINE>NopStmt endWhileStmt = Jimple.v().newNopStmt();<NEW_LINE>body.getUnits().add(startWhileStmt);<NEW_LINE>createIfStmt(endWhileStmt);<NEW_LINE>ComponentType componentType = entryPointUtils.getComponentType(component);<NEW_LINE>boolean hasAdditionalMethods = false;<NEW_LINE>if (componentType == ComponentType.GCMBaseIntentService) {<NEW_LINE>hasAdditionalMethods |= createSpecialServiceMethodCalls(AndroidEntryPointConstants.getGCMIntentServiceMethods(), AndroidEntryPointConstants.GCMBASEINTENTSERVICECLASS);<NEW_LINE>} else if (componentType == ComponentType.GCMListenerService) {<NEW_LINE>hasAdditionalMethods |= createSpecialServiceMethodCalls(AndroidEntryPointConstants.getGCMListenerServiceMethods(), AndroidEntryPointConstants.GCMLISTENERSERVICECLASS);<NEW_LINE>} else if (componentType == ComponentType.HostApduService) {<NEW_LINE>hasAdditionalMethods |= createSpecialServiceMethodCalls(AndroidEntryPointConstants.getHostApduServiceMethods(), AndroidEntryPointConstants.HOSTAPDUSERVICECLASS);<NEW_LINE>}<NEW_LINE>addCallbackMethods();<NEW_LINE>body.getUnits().add(endWhileStmt);<NEW_LINE>if (hasAdditionalMethods)<NEW_LINE>createIfStmt(startWhileStmt);<NEW_LINE>// lifecycle1 end<NEW_LINE>// lifecycle2 start<NEW_LINE>// onBind:<NEW_LINE>searchAndBuildMethod(AndroidEntryPointConstants.SERVICE_ONBIND, component, thisLocal);<NEW_LINE>NopStmt beforemethodsStmt = Jimple.v().newNopStmt();<NEW_LINE>body.getUnits().add(beforemethodsStmt);<NEW_LINE>// methods<NEW_LINE>NopStmt startWhile2Stmt = Jimple.v().newNopStmt();<NEW_LINE>NopStmt endWhile2Stmt = Jimple.v().newNopStmt();<NEW_LINE>body.getUnits().add(startWhile2Stmt);<NEW_LINE>hasAdditionalMethods = false;<NEW_LINE>if (componentType == ComponentType.GCMBaseIntentService)<NEW_LINE>for (String sig : AndroidEntryPointConstants.getGCMIntentServiceMethods()) {<NEW_LINE>SootMethod sm = findMethod(component, sig);<NEW_LINE>if (sm != null && !sm.getName().equals(AndroidEntryPointConstants.GCMBASEINTENTSERVICECLASS))<NEW_LINE>if (createPlainMethodCall(thisLocal, sm))<NEW_LINE>hasAdditionalMethods = true;<NEW_LINE>}<NEW_LINE>addCallbackMethods();<NEW_LINE>body.getUnits().add(endWhile2Stmt);<NEW_LINE>if (hasAdditionalMethods)<NEW_LINE>createIfStmt(startWhile2Stmt);<NEW_LINE>// onUnbind:<NEW_LINE>Stmt onDestroyStmt = Jimple.v().newNopStmt();<NEW_LINE>searchAndBuildMethod(AndroidEntryPointConstants.SERVICE_ONUNBIND, component, thisLocal);<NEW_LINE>// fall through to rebind or go to destroy<NEW_LINE>createIfStmt(onDestroyStmt);<NEW_LINE>// onRebind:<NEW_LINE>searchAndBuildMethod(AndroidEntryPointConstants.SERVICE_ONREBIND, component, thisLocal);<NEW_LINE>createIfStmt(beforemethodsStmt);<NEW_LINE>// lifecycle2 end<NEW_LINE>// onDestroy:<NEW_LINE>body.getUnits().add(onDestroyStmt);<NEW_LINE>searchAndBuildMethod(<MASK><NEW_LINE>} | AndroidEntryPointConstants.SERVICE_ONDESTROY, component, thisLocal); |
1,268,093 | private static String debugString(@Nullable ClientSession session) {<NEW_LINE>if (session == null) {<NEW_LINE>return "null";<NEW_LINE>}<NEW_LINE>String debugString = String.format("[%s@%s ", ClassUtils.getShortName(session.getClass()), Integer.toHexString(session.hashCode()));<NEW_LINE>try {<NEW_LINE>if (session.getServerSession() != null) {<NEW_LINE>debugString += String.format("id = %s, ", session.getServerSession().getIdentifier());<NEW_LINE>debugString += String.format("causallyConsistent = %s, ", session.isCausallyConsistent());<NEW_LINE>debugString += String.format("txActive = %s, ", session.hasActiveTransaction());<NEW_LINE>debugString += String.format("txNumber = %d, ", session.getServerSession().getTransactionNumber());<NEW_LINE>debugString += String.format("closed = %d, ", session.getServerSession().isClosed());<NEW_LINE>debugString += String.format("clusterTime = %s", session.getClusterTime());<NEW_LINE>} else {<NEW_LINE>debugString += "id = n/a";<NEW_LINE>debugString += String.format("causallyConsistent = %s, ", session.isCausallyConsistent());<NEW_LINE>debugString += String.format(<MASK><NEW_LINE>debugString += String.format("clusterTime = %s", session.getClusterTime());<NEW_LINE>}<NEW_LINE>} catch (RuntimeException e) {<NEW_LINE>debugString += String.format("error = %s", e.getMessage());<NEW_LINE>}<NEW_LINE>debugString += "]";<NEW_LINE>return debugString;<NEW_LINE>} | "txActive = %s, ", session.hasActiveTransaction()); |
1,287,152 | public AuthenticationDescription unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>AuthenticationDescription authenticationDescription = new AuthenticationDescription();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("awsSso", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>authenticationDescription.setAwsSso(AwsSsoAuthenticationJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("providers", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>authenticationDescription.setProviders(new ListUnmarshaller<String>(context.getUnmarshaller(String.class<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("saml", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>authenticationDescription.setSaml(SamlAuthenticationJsonUnmarshaller.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 authenticationDescription;<NEW_LINE>} | )).unmarshall(context)); |
728,222 | private static String checkCompatiblyEscaped30(String str, String test, Report report) {<NEW_LINE>String result = "";<NEW_LINE>char[] chars = str.toCharArray();<NEW_LINE>for (char c : chars) {<NEW_LINE>if (Character.isISOControl(c)) {<NEW_LINE>result += "\"" + Character.toString(c) + "\",";<NEW_LINE>test += Character.toString(c);<NEW_LINE>}<NEW_LINE>// DEL (U+007F)<NEW_LINE>if (c == '\u007F') {<NEW_LINE>result += "\"" + Character.toString(c) + "\",";<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>String unicodeType = Character.UnicodeBlock.of(c).toString();<NEW_LINE>if (restricted30CharacterSet.contains(unicodeType)) {<NEW_LINE>result += "\"" + Character.toString(c) + "\",";<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (result.length() > 1) {<NEW_LINE>result = result.substring(0, result.length() - 1);<NEW_LINE>report.message(MessageId.PKG_009, EPUBLocation.create(str), result);<NEW_LINE>}<NEW_LINE>return test;<NEW_LINE>} | test += Character.toString(c); |
73,274 | protected void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>setContentView(R.layout.activity_recycler_view_example);<NEW_LINE>RecyclerView recyclerView = findViewById(R.id.recycler_view);<NEW_LINE>recyclerView.setHasFixedSize(true);<NEW_LINE>RecyclerView.<MASK><NEW_LINE>recyclerView.setLayoutManager(mLayoutManager);<NEW_LINE>String[] videoIds = { "6JYIGclVQdw", "LvetJ9U_tVY", "6JYIGclVQdw", "LvetJ9U_tVY", "6JYIGclVQdw", "LvetJ9U_tVY", "6JYIGclVQdw", "LvetJ9U_tVY", "6JYIGclVQdw", "LvetJ9U_tVY", "6JYIGclVQdw", "LvetJ9U_tVY" };<NEW_LINE>RecyclerView.Adapter recyclerViewAdapter = new RecyclerViewAdapter(videoIds, this.getLifecycle());<NEW_LINE>recyclerView.setAdapter(recyclerViewAdapter);<NEW_LINE>} | LayoutManager mLayoutManager = new LinearLayoutManager(this); |
1,064,058 | ActionResult<Wo> execute(EffectivePerson effectivePerson, String id) throws Exception {<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>ActionResult<Wo> result = new ActionResult<>();<NEW_LINE><MASK><NEW_LINE>ScriptVersion scriptVersion = emc.find(id, ScriptVersion.class);<NEW_LINE>if (null == scriptVersion) {<NEW_LINE>throw new ExceptionEntityNotExist(id, ScriptVersion.class);<NEW_LINE>}<NEW_LINE>Script script = emc.find(scriptVersion.getScript(), Script.class);<NEW_LINE>if (null == script) {<NEW_LINE>throw new ExceptionEntityNotExist(scriptVersion.getScript(), Script.class);<NEW_LINE>}<NEW_LINE>Application application = emc.find(script.getApplication(), Application.class);<NEW_LINE>if (null == application) {<NEW_LINE>throw new ExceptionEntityNotExist(script.getApplication(), Application.class);<NEW_LINE>}<NEW_LINE>if (!business.editable(effectivePerson, application)) {<NEW_LINE>throw new ExceptionAccessDenied(effectivePerson);<NEW_LINE>}<NEW_LINE>Wo wo = Wo.copier.copy(scriptVersion);<NEW_LINE>result.setData(wo);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>} | Business business = new Business(emc); |
433,883 | protected void initScene() {<NEW_LINE>PointLight light1 = new PointLight();<NEW_LINE>light1.setPower(1.5f);<NEW_LINE>PointLight light2 = new PointLight();<NEW_LINE>light2.setPower(1.5f);<NEW_LINE>getCurrentScene().addLight(light1);<NEW_LINE>getCurrentScene().addLight(light2);<NEW_LINE>getCurrentCamera().setPosition(0, 2, 4);<NEW_LINE>getCurrentCamera().setLookAt(0, 0, 0);<NEW_LINE>try {<NEW_LINE>final LoaderAWD parser = new LoaderAWD(mContext.getResources(), mTextureManager, R.raw.awd_suzanne);<NEW_LINE>parser.parse();<NEW_LINE>Object3D suzanne = parser.getParsedObject();<NEW_LINE>Material material = new Material();<NEW_LINE>material.setDiffuseMethod(new DiffuseMethod.Lambert());<NEW_LINE>material.setColor(0xff990000);<NEW_LINE>material.enableLighting(true);<NEW_LINE>suzanne.setMaterial(material);<NEW_LINE>getCurrentScene().addChild(suzanne);<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>Animation3D anim = new TranslateAnimation3D(new Vector3(-10, -10, 5), new Vector3(-10, 10, 5));<NEW_LINE>anim.setDurationMilliseconds(4000);<NEW_LINE>anim.<MASK><NEW_LINE>anim.setTransformable3D(light1);<NEW_LINE>getCurrentScene().registerAnimation(anim);<NEW_LINE>anim.play();<NEW_LINE>anim = new TranslateAnimation3D(new Vector3(10, 10, 5), new Vector3(10, -10, 5));<NEW_LINE>anim.setDurationMilliseconds(2000);<NEW_LINE>anim.setRepeatMode(Animation.RepeatMode.REVERSE_INFINITE);<NEW_LINE>anim.setTransformable3D(light2);<NEW_LINE>getCurrentScene().registerAnimation(anim);<NEW_LINE>anim.play();<NEW_LINE>} | setRepeatMode(Animation.RepeatMode.REVERSE_INFINITE); |
554,230 | protected Map<String, String> submoduleUrls() {<NEW_LINE>String[] args = new String[] { "config", "--get-regexp", "^submodule\\..+\\.url" };<NEW_LINE>CommandLine gitCmd = <MASK><NEW_LINE>ConsoleResult result = runOrBomb(gitCmd, false);<NEW_LINE>List<String> submoduleList = result.output();<NEW_LINE>HashMap<String, String> submoduleUrls = new HashMap<>();<NEW_LINE>for (String submoduleLine : submoduleList) {<NEW_LINE>Matcher m = GIT_SUBMODULE_URL_PATTERN.matcher(submoduleLine);<NEW_LINE>if (!m.find()) {<NEW_LINE>bomb("Unable to parse git-config output line: " + result.replaceSecretInfo(submoduleLine) + "\n" + "From output:\n" + result.replaceSecretInfo(StringUtils.join(submoduleList, "\n")));<NEW_LINE>}<NEW_LINE>submoduleUrls.put(m.group(1), m.group(2));<NEW_LINE>}<NEW_LINE>return submoduleUrls;<NEW_LINE>} | gitWd().withArgs(args); |
1,203,536 | private void loadComments(final int page, final boolean isReload) {<NEW_LINE>mView.showLoading();<NEW_LINE>final boolean readCacheFirst = page == 1 && !isReload;<NEW_LINE>HttpObserver<ArrayList<IssueEvent>> httpObserver = new HttpObserver<ArrayList<IssueEvent>>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onError(Throwable error) {<NEW_LINE>mView.hideLoading();<NEW_LINE>handleError(error);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onSuccess(HttpResponse<ArrayList<IssueEvent>> response) {<NEW_LINE>mView.hideLoading();<NEW_LINE>ArrayList<IssueEvent<MASK><NEW_LINE>result = filterTimeLine(result);<NEW_LINE>if (isReload || timeline == null || readCacheFirst) {<NEW_LINE>timeline = result;<NEW_LINE>timeline.add(0, getFirstComment());<NEW_LINE>} else {<NEW_LINE>timeline.addAll(result);<NEW_LINE>}<NEW_LINE>if (response.body().size() == 0 && timeline.size() != 0) {<NEW_LINE>mView.setCanLoadMore(false);<NEW_LINE>}<NEW_LINE>mView.showTimeline(timeline);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>generalRxHttpExecute(new IObservableCreator<ArrayList<IssueEvent>>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Observable<Response<ArrayList<IssueEvent>>> createObservable(boolean forceNetWork) {<NEW_LINE>// return getIssueService().getIssueComments(forceNetWork, issue.getRepoAuthorName(),<NEW_LINE>// issue.getRepoName(), issue.getNumber(), page);<NEW_LINE>return getIssueService().getIssueTimeline(forceNetWork, issue.getRepoAuthorName(), issue.getRepoName(), issue.getNumber(), page);<NEW_LINE>}<NEW_LINE>}, httpObserver, readCacheFirst);<NEW_LINE>} | > result = response.body(); |
1,133,753 | FormatterFunc createFormat() throws Exception {<NEW_LINE>ClassLoader classLoader = jarState.getClassLoader();<NEW_LINE>// instantiate the formatter and get its format method<NEW_LINE>Class<?> optionsClass = classLoader.loadClass(OPTIONS_CLASS);<NEW_LINE>Class<?> optionsBuilderClass = classLoader.loadClass(OPTIONS_BUILDER_CLASS);<NEW_LINE>Method optionsBuilderMethod = optionsClass.getMethod(OPTIONS_BUILDER_METHOD);<NEW_LINE>Object optionsBuilder = optionsBuilderMethod.invoke(null);<NEW_LINE>Class<?> optionsStyleClass = classLoader.loadClass(OPTIONS_Style);<NEW_LINE>Object styleConstant = Enum.valueOf((Class<Enum>) optionsStyleClass, style);<NEW_LINE>Method optionsBuilderStyleMethod = optionsBuilderClass.getMethod(OPTIONS_BUILDER_STYLE_METHOD, optionsStyleClass);<NEW_LINE>optionsBuilderStyleMethod.invoke(optionsBuilder, styleConstant);<NEW_LINE>Method optionsBuilderBuildMethod = optionsBuilderClass.getMethod(OPTIONS_BUILDER_BUILD_METHOD);<NEW_LINE>Object <MASK><NEW_LINE>Class<?> formatterClazz = classLoader.loadClass(FORMATTER_CLASS);<NEW_LINE>Object formatter = formatterClazz.getConstructor(optionsClass).newInstance(options);<NEW_LINE>Method formatterMethod = formatterClazz.getMethod(FORMATTER_METHOD, String.class);<NEW_LINE>Function<String, String> removeUnused = constructRemoveUnusedFunction(classLoader);<NEW_LINE>Class<?> importOrdererClass = classLoader.loadClass(IMPORT_ORDERER_CLASS);<NEW_LINE>Method importOrdererMethod = importOrdererClass.getMethod(IMPORT_ORDERER_METHOD, String.class);<NEW_LINE>BiFunction<String, Object, String> reflowLongStrings = this.reflowLongStrings ? constructReflowLongStringsFunction(classLoader, formatterClazz) : (s, f) -> s;<NEW_LINE>return JVM_SUPPORT.suggestLaterVersionOnError(version, (input -> {<NEW_LINE>String formatted = (String) formatterMethod.invoke(formatter, input);<NEW_LINE>String removedUnused = removeUnused.apply(formatted);<NEW_LINE>String sortedImports = (String) importOrdererMethod.invoke(null, removedUnused);<NEW_LINE>String reflowedLongStrings = reflowLongStrings.apply(sortedImports, formatter);<NEW_LINE>return fixWindowsBug(reflowedLongStrings, version);<NEW_LINE>}));<NEW_LINE>} | options = optionsBuilderBuildMethod.invoke(optionsBuilder); |
854,960 | public void onSuccess(V2TIMGroupMemberInfoResult v2TIMGroupMemberInfoResult) {<NEW_LINE>List<GroupMemberInfo> members = new ArrayList<>();<NEW_LINE>for (int i = 0; i < v2TIMGroupMemberInfoResult.getMemberInfoList().size(); i++) {<NEW_LINE>GroupMemberInfo member = new GroupMemberInfo();<NEW_LINE>members.add(member.covertTIMGroupMemberInfo(v2TIMGroupMemberInfoResult.getMemberInfoList().get(i)));<NEW_LINE>}<NEW_LINE>List<GroupMemberInfo> memberInfoList = groupInfo.getMemberDetails();<NEW_LINE>Iterator<GroupMemberInfo> iterator = members.iterator();<NEW_LINE>while (iterator.hasNext()) {<NEW_LINE><MASK><NEW_LINE>for (GroupMemberInfo existsMemberInfo : memberInfoList) {<NEW_LINE>if (TextUtils.equals(memberInfo.getAccount(), existsMemberInfo.getAccount())) {<NEW_LINE>iterator.remove();<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>memberInfoList.addAll(members);<NEW_LINE>groupInfo.setNextSeq(v2TIMGroupMemberInfoResult.getNextSeq());<NEW_LINE>TUIGroupUtils.callbackOnSuccess(callBack, groupInfo);<NEW_LINE>} | GroupMemberInfo memberInfo = iterator.next(); |
860,741 | public static <A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13> Arguments13<A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13> of(@Nullable A1 arg1, @Nullable A2 arg2, @Nullable A3 arg3, @Nullable A4 arg4, @Nullable A5 arg5, @Nullable A6 arg6, @Nullable A7 arg7, @Nullable A8 arg8, @Nullable A9 arg9, @Nullable A10 arg10, @Nullable A11 arg11, @Nullable A12 arg12, @Nullable A13 arg13) {<NEW_LINE>return new Arguments13<>(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, <MASK><NEW_LINE>} | arg10, arg11, arg12, arg13); |
1,096,433 | public Object call(boolean isConstructor, Object functionReference, JSFunction function, Object self, Object... args) {<NEW_LINE>// 13.2.1<NEW_LINE>ExecutionContext fnContext = null;<NEW_LINE>try {<NEW_LINE>fnContext = createFunctionExecutionContext(isConstructor, <MASK><NEW_LINE>ThreadContextManager.pushContext(fnContext);<NEW_LINE>try {<NEW_LINE>Object value = function.call(fnContext);<NEW_LINE>if (value == null) {<NEW_LINE>return Types.NULL;<NEW_LINE>}<NEW_LINE>return value;<NEW_LINE>} catch (ThrowException e) {<NEW_LINE>throw e;<NEW_LINE>// } catch (Throwable e) {<NEW_LINE>// throw new ThrowException(fnContext, e);<NEW_LINE>}<NEW_LINE>} catch (ThrowException t) {<NEW_LINE>if (t.getCause() != null) {<NEW_LINE>recordThrow(t.getCause(), fnContext);<NEW_LINE>} else if (t.getValue() instanceof Throwable) {<NEW_LINE>recordThrow((Throwable) t.getValue(), fnContext);<NEW_LINE>}<NEW_LINE>throw t;<NEW_LINE>} catch (Throwable t) {<NEW_LINE>recordThrow(t, fnContext);<NEW_LINE>throw t;<NEW_LINE>} finally {<NEW_LINE>ThreadContextManager.popContext();<NEW_LINE>}<NEW_LINE>} | functionReference, function, self, args); |
1,746,516 | private void configureContainer(ContainerProperties container) {<NEW_LINE>PropertyMapper map = PropertyMapper.get().alwaysApplyingWhenNonNull();<NEW_LINE>Listener properties = this.properties.getListener();<NEW_LINE>map.from(properties::getAckMode).to(container::setAckMode);<NEW_LINE>map.from(properties::getClientId<MASK><NEW_LINE>map.from(properties::getAckCount).to(container::setAckCount);<NEW_LINE>map.from(properties::getAckTime).as(Duration::toMillis).to(container::setAckTime);<NEW_LINE>map.from(properties::getPollTimeout).as(Duration::toMillis).to(container::setPollTimeout);<NEW_LINE>map.from(properties::getNoPollThreshold).to(container::setNoPollThreshold);<NEW_LINE>map.from(properties.getIdleBetweenPolls()).as(Duration::toMillis).to(container::setIdleBetweenPolls);<NEW_LINE>map.from(properties::getIdleEventInterval).as(Duration::toMillis).to(container::setIdleEventInterval);<NEW_LINE>map.from(properties::getIdlePartitionEventInterval).as(Duration::toMillis).to(container::setIdlePartitionEventInterval);<NEW_LINE>map.from(properties::getMonitorInterval).as(Duration::getSeconds).as(Number::intValue).to(container::setMonitorInterval);<NEW_LINE>map.from(properties::getLogContainerConfig).to(container::setLogContainerConfig);<NEW_LINE>map.from(properties::isMissingTopicsFatal).to(container::setMissingTopicsFatal);<NEW_LINE>map.from(properties::isImmediateStop).to(container::setStopImmediate);<NEW_LINE>map.from(this.transactionManager).to(container::setTransactionManager);<NEW_LINE>map.from(this.rebalanceListener).to(container::setConsumerRebalanceListener);<NEW_LINE>} | ).to(container::setClientId); |
343,984 | public void createFromParts(ReadableArray parts, String blobId) {<NEW_LINE>int totalBlobSize = 0;<NEW_LINE>ArrayList<byte[]> partList = new ArrayList<>(parts.size());<NEW_LINE>for (int i = 0; i < parts.size(); i++) {<NEW_LINE>ReadableMap part = parts.getMap(i);<NEW_LINE>switch(part.getString("type")) {<NEW_LINE>case "blob":<NEW_LINE>ReadableMap blob = part.getMap("data");<NEW_LINE>totalBlobSize += blob.getInt("size");<NEW_LINE>partList.add(i, resolve(blob));<NEW_LINE>break;<NEW_LINE>case "string":<NEW_LINE>byte[] bytes = part.getString("data").getBytes(Charset.forName("UTF-8"));<NEW_LINE>totalBlobSize += bytes.length;<NEW_LINE>partList.add(i, bytes);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new IllegalArgumentException("Invalid type for blob: " <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>ByteBuffer buffer = ByteBuffer.allocate(totalBlobSize);<NEW_LINE>for (byte[] bytes : partList) {<NEW_LINE>buffer.put(bytes);<NEW_LINE>}<NEW_LINE>store(buffer.array(), blobId);<NEW_LINE>} | + part.getString("type")); |
14,864 | public Object createId(EntityMetaData metaData, String string) {<NEW_LINE>Class<?> type = metaData.getIdType();<NEW_LINE>// According to JPA-spec all primitive types (and wrappers) are supported, String, util.Date, sql.Date,<NEW_LINE>// BigDecimal and BigInteger<NEW_LINE>if (type == Long.class || type == long.class) {<NEW_LINE>return Long.parseLong(string);<NEW_LINE>} else if (type == String.class) {<NEW_LINE>return string;<NEW_LINE>} else if (type == Byte.class || type == byte.class) {<NEW_LINE>return Byte.parseByte(string);<NEW_LINE>} else if (type == Short.class || type == short.class) {<NEW_LINE>return Short.parseShort(string);<NEW_LINE>} else if (type == Integer.class || type == int.class) {<NEW_LINE>return Integer.parseInt(string);<NEW_LINE>} else if (type == Float.class || type == float.class) {<NEW_LINE>return Float.parseFloat(string);<NEW_LINE>} else if (type == Double.class || type == double.class) {<NEW_LINE>return Double.parseDouble(string);<NEW_LINE>} else if (type == Character.class || type == char.class) {<NEW_LINE>return new Character(string.charAt(0));<NEW_LINE>} else if (type == java.util.Date.class) {<NEW_LINE>return new java.util.Date(Long.parseLong(string));<NEW_LINE>} else if (type == java.sql.Date.class) {<NEW_LINE>return new java.sql.Date<MASK><NEW_LINE>} else if (type == BigDecimal.class) {<NEW_LINE>return new BigDecimal(string);<NEW_LINE>} else if (type == BigInteger.class) {<NEW_LINE>return new BigInteger(string);<NEW_LINE>} else {<NEW_LINE>throw new ProcessEngineException("Unsupported Primary key type for JPA-Entity: " + type.getName());<NEW_LINE>}<NEW_LINE>} | (Long.parseLong(string)); |
1,165,261 | public static void parsePodTemplate(AbstractModel model, PodTemplate pod) {<NEW_LINE>if (pod != null) {<NEW_LINE>if (pod.getMetadata() != null) {<NEW_LINE>model.templatePodLabels = pod.getMetadata().getLabels();<NEW_LINE>model.templatePodAnnotations = pod.getMetadata().getAnnotations();<NEW_LINE>}<NEW_LINE>if (pod.getAffinity() != null) {<NEW_LINE>model.<MASK><NEW_LINE>}<NEW_LINE>if (pod.getTolerations() != null) {<NEW_LINE>model.setTolerations(removeEmptyValuesFromTolerations(pod.getTolerations()));<NEW_LINE>}<NEW_LINE>model.templateTerminationGracePeriodSeconds = pod.getTerminationGracePeriodSeconds();<NEW_LINE>model.templateImagePullSecrets = pod.getImagePullSecrets();<NEW_LINE>model.templateSecurityContext = pod.getSecurityContext();<NEW_LINE>model.templatePodPriorityClassName = pod.getPriorityClassName();<NEW_LINE>model.templatePodSchedulerName = pod.getSchedulerName();<NEW_LINE>model.templatePodHostAliases = pod.getHostAliases();<NEW_LINE>model.templatePodTopologySpreadConstraints = pod.getTopologySpreadConstraints();<NEW_LINE>model.templatePodEnableServiceLinks = pod.getEnableServiceLinks();<NEW_LINE>model.templateTmpDirSizeLimit = pod.getTmpDirSizeLimit();<NEW_LINE>}<NEW_LINE>} | setUserAffinity(pod.getAffinity()); |
206,696 | public void write(RandomAccessFile raf, DataConverter dc) throws IOException {<NEW_LINE>raf.seek(0);<NEW_LINE>raf.writeByte(e_ident_magic_num);<NEW_LINE>raf.write(e_ident_magic_str.getBytes());<NEW_LINE>raf.writeByte(e_ident_class);<NEW_LINE>raf.writeByte(e_ident_data);<NEW_LINE>raf.writeByte(e_ident_version);<NEW_LINE>raf.writeByte(e_ident_osabi);<NEW_LINE>raf.writeByte(e_ident_abiversion);<NEW_LINE>raf.write(e_ident_pad);<NEW_LINE>raf.write(dc.getBytes(e_type));<NEW_LINE>raf.write(dc.getBytes(e_machine));<NEW_LINE>raf.write(dc.getBytes(e_version));<NEW_LINE>if (is32Bit()) {<NEW_LINE>raf.write(dc.getBytes((int) e_entry));<NEW_LINE>raf.write(dc.getBytes((int) e_phoff));<NEW_LINE>raf.write(dc.getBytes((int) e_shoff));<NEW_LINE>} else if (is64Bit()) {<NEW_LINE>raf.write(dc.getBytes(e_entry));<NEW_LINE>raf.write(dc.getBytes(e_phoff));<NEW_LINE>raf.write(dc.getBytes(e_shoff));<NEW_LINE>}<NEW_LINE>raf.write(dc.getBytes(e_flags));<NEW_LINE>raf.write(dc.getBytes(e_ehsize));<NEW_LINE>raf.write(dc.getBytes(e_phentsize));<NEW_LINE>if (e_phnum >= Short.toUnsignedInt(ElfConstants.PN_XNUM)) {<NEW_LINE>throw new IOException("Unsupported program header count serialization: " + e_phnum);<NEW_LINE>}<NEW_LINE>raf.write(dc.getBytes(e_phnum));<NEW_LINE>raf.write<MASK><NEW_LINE>if (e_shnum >= Short.toUnsignedInt(ElfSectionHeaderConstants.SHN_LORESERVE)) {<NEW_LINE>throw new IOException("Unsupported section header count serialization: " + e_shnum);<NEW_LINE>}<NEW_LINE>raf.write(dc.getBytes(e_shnum));<NEW_LINE>raf.write(dc.getBytes(e_shstrndx));<NEW_LINE>} | (dc.getBytes(e_shentsize)); |
152,519 | private String renderFirstLine(InnerClass innerClass, CompilationUnit compilationUnit) {<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>sb.append(innerClass.getVisibility().getValue());<NEW_LINE>if (innerClass.isAbstract()) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>sb.append("abstract ");<NEW_LINE>}<NEW_LINE>if (innerClass.isStatic()) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>sb.append("static ");<NEW_LINE>}<NEW_LINE>if (innerClass.isFinal()) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>sb.append("final ");<NEW_LINE>}<NEW_LINE>// $NON-NLS-1$<NEW_LINE>sb.append("class ");<NEW_LINE>sb.append(innerClass.getType().getShortName());<NEW_LINE>sb.append(RenderingUtilities.renderTypeParameters(innerClass<MASK><NEW_LINE>sb.append(renderSuperClass(innerClass, compilationUnit));<NEW_LINE>sb.append(renderSuperInterfaces(innerClass, compilationUnit));<NEW_LINE>// $NON-NLS-1$<NEW_LINE>sb.append(" {");<NEW_LINE>return sb.toString();<NEW_LINE>} | .getTypeParameters(), compilationUnit)); |
1,071,433 | public void renderTo(Iterable<BlockDoc> blocks, Element parent) {<NEW_LINE>Document document = parent.getOwnerDocument();<NEW_LINE>// <thead><NEW_LINE>// <tr><NEW_LINE>// <td>Block</td><NEW_LINE>// <td>Description</td><NEW_LINE>// </tr><NEW_LINE>// </thead><NEW_LINE>Element thead = document.createElement("thead");<NEW_LINE>parent.appendChild(thead);<NEW_LINE>Element tr = document.createElement("tr");<NEW_LINE>thead.appendChild(tr);<NEW_LINE>Element td = document.createElement("td");<NEW_LINE>tr.appendChild(td);<NEW_LINE>td.appendChild(document.createTextNode("Block"));<NEW_LINE>td = document.createElement("td");<NEW_LINE>tr.appendChild(td);<NEW_LINE>td.appendChild(document.createTextNode("Description"));<NEW_LINE>for (BlockDoc blockDoc : blocks) {<NEW_LINE>// <tr><NEW_LINE>// <td><link linkend="$id"><literal>$name</literal></link</td><NEW_LINE>// <td>$description</td><NEW_LINE>// </tr><NEW_LINE>tr = document.createElement("tr");<NEW_LINE>parent.appendChild(tr);<NEW_LINE>td = document.createElement("td");<NEW_LINE>tr.appendChild(td);<NEW_LINE>Element link = document.createElement("link");<NEW_LINE>td.appendChild(link);<NEW_LINE>link.setAttribute("linkend", blockDoc.getId());<NEW_LINE>Element <MASK><NEW_LINE>link.appendChild(literal);<NEW_LINE>literal.appendChild(document.createTextNode(blockDoc.getName()));<NEW_LINE>td = document.createElement("td");<NEW_LINE>tr.appendChild(td);<NEW_LINE>if (blockDoc.isDeprecated()) {<NEW_LINE>Element caution = document.createElement("caution");<NEW_LINE>td.appendChild(caution);<NEW_LINE>caution.appendChild(document.createTextNode("Deprecated"));<NEW_LINE>}<NEW_LINE>if (blockDoc.isIncubating()) {<NEW_LINE>Element caution = document.createElement("caution");<NEW_LINE>td.appendChild(caution);<NEW_LINE>caution.appendChild(document.createTextNode("Incubating"));<NEW_LINE>}<NEW_LINE>td.appendChild(document.importNode(blockDoc.getDescription(), true));<NEW_LINE>}<NEW_LINE>} | literal = document.createElement("literal"); |
1,153,572 | protected void encodeMarkup(FacesContext context, UICalendar uicalendar, String value) throws IOException {<NEW_LINE>Calendar calendar = (Calendar) uicalendar;<NEW_LINE>ResponseWriter writer = context.getResponseWriter();<NEW_LINE>String clientId = calendar.getClientId(context);<NEW_LINE>String styleClass = calendar.getStyleClass();<NEW_LINE>styleClass = (styleClass == null) ? Calendar.CONTAINER_CLASS : Calendar.CONTAINER_CLASS + " " + styleClass;<NEW_LINE>String inputId = clientId + "_input";<NEW_LINE>boolean popup = calendar.isPopup();<NEW_LINE>writer.startElement("span", calendar);<NEW_LINE>writer.writeAttribute("id", clientId, null);<NEW_LINE>writer.writeAttribute("class", styleClass, null);<NEW_LINE>if (calendar.getStyle() != null) {<NEW_LINE>writer.writeAttribute("style", calendar.getStyle(), null);<NEW_LINE>}<NEW_LINE>// inline container<NEW_LINE>if (!popup) {<NEW_LINE>writer.startElement("div", null);<NEW_LINE>writer.writeAttribute(<MASK><NEW_LINE>writer.endElement("div");<NEW_LINE>}<NEW_LINE>// input<NEW_LINE>encodeInput(context, calendar, inputId, value, popup);<NEW_LINE>writer.endElement("span");<NEW_LINE>} | "id", clientId + "_inline", null); |
1,020,204 | public void createPartControl(Composite parent) {<NEW_LINE>Server server = ServerManager.getInstance().getServer(serverId);<NEW_LINE>this.setPartName("ResponseTime[" + server.getName() + "]");<NEW_LINE>GridLayout layout = new GridLayout(1, true);<NEW_LINE>layout.marginHeight = 5;<NEW_LINE>layout.marginWidth = 5;<NEW_LINE>parent.setLayout(layout);<NEW_LINE>parent.setBackground(ColorUtil.getInstance().getColor(SWT.COLOR_WHITE));<NEW_LINE>parent.setBackgroundMode(SWT.INHERIT_FORCE);<NEW_LINE>canvas = new FigureCanvas(parent);<NEW_LINE>canvas.setLayoutData(new GridData(GridData.FILL_BOTH));<NEW_LINE><MASK><NEW_LINE>canvas.addControlListener(new ControlListener() {<NEW_LINE><NEW_LINE>public void controlMoved(ControlEvent arg0) {<NEW_LINE>}<NEW_LINE><NEW_LINE>public void controlResized(ControlEvent arg0) {<NEW_LINE>Rectangle r = canvas.getClientArea();<NEW_LINE>xyGraph.setSize(r.width, r.height);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>xyGraph = new XYGraph();<NEW_LINE>xyGraph.setShowLegend(true);<NEW_LINE>xyGraph.setShowTitle(false);<NEW_LINE>canvas.setContents(xyGraph);<NEW_LINE>xyGraph.primaryXAxis.setDateEnabled(true);<NEW_LINE>xyGraph.primaryXAxis.setShowMajorGrid(true);<NEW_LINE>xyGraph.primaryYAxis.setAutoScale(true);<NEW_LINE>xyGraph.primaryYAxis.setShowMajorGrid(true);<NEW_LINE>xyGraph.primaryXAxis.setFormatPattern("HH:mm:ss");<NEW_LINE>xyGraph.primaryYAxis.setFormatPattern("#,##0");<NEW_LINE>xyGraph.primaryXAxis.setTitle("");<NEW_LINE>xyGraph.primaryYAxis.setTitle("");<NEW_LINE>xyGraph.primaryYAxis.addMouseListener(new RangeMouseListener(getViewSite().getShell(), xyGraph.primaryYAxis));<NEW_LINE>CircularBufferDataProvider avgProvider = new CircularBufferDataProvider(true);<NEW_LINE>avgProvider.setBufferSize(((int) (TIME_RANGE / REFRESH_INTERVAL) + 1));<NEW_LINE>avgProvider.setCurrentXDataArray(new double[] {});<NEW_LINE>avgProvider.setCurrentYDataArray(new double[] {});<NEW_LINE>avgTrace = new Trace("Response Time(ms)", xyGraph.primaryXAxis, xyGraph.primaryYAxis, avgProvider);<NEW_LINE>avgTrace.setPointStyle(PointStyle.NONE);<NEW_LINE>avgTrace.setTraceType(TraceType.AREA);<NEW_LINE>avgTrace.setLineWidth(PManager.getInstance().getInt(PreferenceConstants.P_CHART_LINE_WIDTH));<NEW_LINE>avgTrace.setTraceColor(ColorUtil.getInstance().getColor(SWT.COLOR_DARK_GREEN));<NEW_LINE>xyGraph.addTrace(avgTrace);<NEW_LINE>ScouterUtil.addHorizontalRangeListener(xyGraph.getPlotArea(), new OpenDigestTableAction(serverId), false);<NEW_LINE>thread = new RefreshThread(this, REFRESH_INTERVAL);<NEW_LINE>thread.start();<NEW_LINE>} | canvas.setScrollBarVisibility(FigureCanvas.NEVER); |
460,725 | private void initialize(int n) {<NEW_LINE>if (columnNames == null || columnNames.size() != n) {<NEW_LINE>columnNames = createDefaultColumnNames(n);<NEW_LINE>}<NEW_LINE>exampleCountPerColumn = Nd4j.zeros(DataType.DOUBLE, n);<NEW_LINE>labelsSumPerColumn = Nd4j.<MASK><NEW_LINE>sumSquaredErrorsPerColumn = Nd4j.zeros(DataType.DOUBLE, n);<NEW_LINE>sumAbsErrorsPerColumn = Nd4j.zeros(DataType.DOUBLE, n);<NEW_LINE>currentMean = Nd4j.zeros(DataType.DOUBLE, n);<NEW_LINE>currentPredictionMean = Nd4j.zeros(DataType.DOUBLE, n);<NEW_LINE>sumOfProducts = Nd4j.zeros(DataType.DOUBLE, n);<NEW_LINE>sumSquaredLabels = Nd4j.zeros(DataType.DOUBLE, n);<NEW_LINE>sumSquaredPredicted = Nd4j.zeros(DataType.DOUBLE, n);<NEW_LINE>sumLabels = Nd4j.zeros(DataType.DOUBLE, n);<NEW_LINE>initialized = true;<NEW_LINE>} | zeros(DataType.DOUBLE, n); |
97,809 | public synchronized void createUser(User user, int account) {<NEW_LINE>ContentValues values = new ContentValues();<NEW_LINE>long id = user.getId();<NEW_LINE>String screenName = user.getScreenName();<NEW_LINE>String name = user.getName();<NEW_LINE>String proPicUrl = user.getOriginalProfileImageURL();<NEW_LINE>values.put(FollowersSQLiteHelper.COLUMN_ACCOUNT, account);<NEW_LINE>values.put(FollowersSQLiteHelper.COLUMN_ID, id);<NEW_LINE>values.put(FollowersSQLiteHelper.COLUMN_NAME, name);<NEW_LINE>values.put(FollowersSQLiteHelper.COLUMN_PRO_PIC, proPicUrl);<NEW_LINE>values.put(FollowersSQLiteHelper.COLUMN_SCREEN_NAME, screenName);<NEW_LINE>if (database == null || !database.isOpen()) {<NEW_LINE>open();<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>database.insert(<MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>// already exist. primary key must be unique<NEW_LINE>}<NEW_LINE>} | FollowersSQLiteHelper.TABLE_HOME, null, values); |
592,316 | public Blob createBlob() throws SQLException {<NEW_LINE>final <MASK><NEW_LINE>if (isTraceOn && tc.isEntryEnabled())<NEW_LINE>Tr.entry(this, tc, "createBlob");<NEW_LINE>Blob blob;<NEW_LINE>try {<NEW_LINE>activate();<NEW_LINE>blob = connImpl.createBlob();<NEW_LINE>if (freeResourcesOnClose)<NEW_LINE>blobs.add(blob);<NEW_LINE>} catch (SQLException sqlX) {<NEW_LINE>FFDCFilter.processException(sqlX, getClass().getName() + ".createBlob", "1040", this);<NEW_LINE>throw proccessSQLException(sqlX);<NEW_LINE>} catch (NullPointerException nullX) {<NEW_LINE>// No FFDC code needed; we might be closed.<NEW_LINE>throw runtimeXIfNotClosed(nullX);<NEW_LINE>} catch (AbstractMethodError methError) {<NEW_LINE>// No FFDC code needed; wrong JDBC level.<NEW_LINE>throw AdapterUtil.notSupportedX("Connection.createBlob", methError);<NEW_LINE>} catch (RuntimeException runX) {<NEW_LINE>FFDCFilter.processException(runX, getClass().getName() + ".createBlob", "1108", this);<NEW_LINE>if (isTraceOn && tc.isEntryEnabled())<NEW_LINE>Tr.exit(this, tc, "createBlob", runX);<NEW_LINE>throw runX;<NEW_LINE>} catch (Error err) {<NEW_LINE>FFDCFilter.processException(err, getClass().getName() + ".createBlob", "1115", this);<NEW_LINE>if (isTraceOn && tc.isEntryEnabled())<NEW_LINE>Tr.exit(this, tc, "createBlob", err);<NEW_LINE>throw err;<NEW_LINE>}<NEW_LINE>if (isTraceOn && tc.isEntryEnabled())<NEW_LINE>Tr.exit(this, tc, "createBlob", AdapterUtil.toString(blob));<NEW_LINE>return blob;<NEW_LINE>} | boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); |
1,558,726 | public void deleteByIdWithResponse(String id, Context context) {<NEW_LINE>String workspaceName = <MASK><NEW_LINE>if (workspaceName == null) {<NEW_LINE>throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id)));<NEW_LINE>}<NEW_LINE>String kustoPoolName = Utils.getValueFromIdByName(id, "kustoPools");<NEW_LINE>if (kustoPoolName == null) {<NEW_LINE>throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'kustoPools'.", id)));<NEW_LINE>}<NEW_LINE>String principalAssignmentName = Utils.getValueFromIdByName(id, "principalAssignments");<NEW_LINE>if (principalAssignmentName == null) {<NEW_LINE>throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'principalAssignments'.", id)));<NEW_LINE>}<NEW_LINE>String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups");<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));<NEW_LINE>}<NEW_LINE>this.delete(workspaceName, kustoPoolName, principalAssignmentName, resourceGroupName, context);<NEW_LINE>} | Utils.getValueFromIdByName(id, "workspaces"); |
1,147,681 | private List<DataSourceListBo> reorderDataSourceListBos(List<DataSourceListBo> dataSourceListBos) {<NEW_LINE>// reorder dataSourceBo using id and timeSlot<NEW_LINE>MultiKeyMap<Long, DataSourceListBo> dataSourceListBoMap = new MultiKeyMap<>();<NEW_LINE>for (DataSourceListBo dataSourceListBo : dataSourceListBos) {<NEW_LINE>for (DataSourceBo dataSourceBo : dataSourceListBo.getList()) {<NEW_LINE>int id = dataSourceBo.getId();<NEW_LINE>long timestamp = dataSourceBo.getTimestamp();<NEW_LINE>long timeSlot = AgentStatUtils.getBaseTimestamp(timestamp);<NEW_LINE>DataSourceListBo mappedDataSourceListBo = dataSourceListBoMap.get(id, timeSlot);<NEW_LINE>if (mappedDataSourceListBo == null) {<NEW_LINE>mappedDataSourceListBo = new DataSourceListBo();<NEW_LINE>mappedDataSourceListBo.<MASK><NEW_LINE>mappedDataSourceListBo.setStartTimestamp(dataSourceBo.getStartTimestamp());<NEW_LINE>mappedDataSourceListBo.setTimestamp(dataSourceBo.getTimestamp());<NEW_LINE>dataSourceListBoMap.put((long) id, timeSlot, mappedDataSourceListBo);<NEW_LINE>}<NEW_LINE>// set fastest timestamp<NEW_LINE>if (mappedDataSourceListBo.getTimestamp() > dataSourceBo.getTimestamp()) {<NEW_LINE>mappedDataSourceListBo.setTimestamp(dataSourceBo.getTimestamp());<NEW_LINE>}<NEW_LINE>mappedDataSourceListBo.add(dataSourceBo);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Collection<DataSourceListBo> values = dataSourceListBoMap.values();<NEW_LINE>return new ArrayList<>(values);<NEW_LINE>} | setAgentId(dataSourceBo.getAgentId()); |
1,727,684 | public final Operand16Context operand16() throws RecognitionException {<NEW_LINE>Operand16Context _localctx = new Operand16Context(_ctx, getState());<NEW_LINE>enterRule(_localctx, 38, RULE_operand16);<NEW_LINE>try {<NEW_LINE>enterOuterAlt(_localctx, 1);<NEW_LINE>{<NEW_LINE>setState(341);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>switch(_input.LA(1)) {<NEW_LINE>case T__448:<NEW_LINE>case T__449:<NEW_LINE>case T__450:<NEW_LINE>case T__451:<NEW_LINE>case T__452:<NEW_LINE>case T__453:<NEW_LINE>case T__454:<NEW_LINE>case T__455:<NEW_LINE>case T__456:<NEW_LINE>case T__457:<NEW_LINE>case T__458:<NEW_LINE>case T__459:<NEW_LINE>case T__460:<NEW_LINE>case T__461:<NEW_LINE>case T__462:<NEW_LINE>case T__463:<NEW_LINE>case T__464:<NEW_LINE>case T__465:<NEW_LINE>case T__466:<NEW_LINE>case T__467:<NEW_LINE>case T__468:<NEW_LINE>case T__469:<NEW_LINE>case T__470:<NEW_LINE>case T__471:<NEW_LINE>{<NEW_LINE>setState(329);<NEW_LINE>((Operand16Context) _localctx).register16 = register16();<NEW_LINE>((Operand16Context) _localctx).op = ((Operand16Context) _localctx).register16.op;<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case T__422:<NEW_LINE>case T__536:<NEW_LINE>case T__537:<NEW_LINE>case T__538:<NEW_LINE>case T__539:<NEW_LINE>case T__540:<NEW_LINE>case T__541:<NEW_LINE>case IDENT:<NEW_LINE>case BIN_NUMBER:<NEW_LINE>case HEX_NUMBER:<NEW_LINE>case NUMBER:<NEW_LINE>{<NEW_LINE>setState(332);<NEW_LINE>((Operand16Context) _localctx).memory_reference = memory_reference();<NEW_LINE>((Operand16Context) _localctx).op = ((Operand16Context) _localctx).memory_reference.op;<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case T__542:<NEW_LINE>{<NEW_LINE>setState(335);<NEW_LINE>((Operand16Context) _localctx).immediate = immediate();<NEW_LINE>((Operand16Context) _localctx).op = ((Operand16Context) _localctx).immediate.op;<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case T__543:<NEW_LINE>{<NEW_LINE>setState(338);<NEW_LINE>((Operand16Context) <MASK><NEW_LINE>((Operand16Context) _localctx).op = ((Operand16Context) _localctx).argument.op;<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new NoViableAltException(this);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (RecognitionException re) {<NEW_LINE>_localctx.exception = re;<NEW_LINE>_errHandler.reportError(this, re);<NEW_LINE>_errHandler.recover(this, re);<NEW_LINE>} finally {<NEW_LINE>exitRule();<NEW_LINE>}<NEW_LINE>return _localctx;<NEW_LINE>} | _localctx).argument = argument(); |
41,713 | public A addAllToPreferredDuringSchedulingIgnoredDuringExecution(java.util.Collection<io.kubernetes.client.openapi.models.V1WeightedPodAffinityTerm> items) {<NEW_LINE>if (this.preferredDuringSchedulingIgnoredDuringExecution == null) {<NEW_LINE>this.preferredDuringSchedulingIgnoredDuringExecution = new java.util.ArrayList<io.kubernetes.client.openapi.models.V1WeightedPodAffinityTermBuilder>();<NEW_LINE>}<NEW_LINE>for (io.kubernetes.client.openapi.models.V1WeightedPodAffinityTerm item : items) {<NEW_LINE>io.kubernetes.client.openapi.models.V1WeightedPodAffinityTermBuilder builder = new io.kubernetes.client.<MASK><NEW_LINE>_visitables.get("preferredDuringSchedulingIgnoredDuringExecution").add(builder);<NEW_LINE>this.preferredDuringSchedulingIgnoredDuringExecution.add(builder);<NEW_LINE>}<NEW_LINE>return (A) this;<NEW_LINE>} | openapi.models.V1WeightedPodAffinityTermBuilder(item); |
1,306,748 | private void processCustomRoles(String parent, boolean isOrgLevel) throws Exception {<NEW_LINE>logger.atInfo().log("Processing custom roles: " + parent);<NEW_LINE>Set<Role> customRole = null;<NEW_LINE>try {<NEW_LINE>if (isOrgLevel) {<NEW_LINE>customRole = iamClient.fetchCustomRolesOrgLevel(parent);<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} catch (IOException | GeneralSecurityException e) {<NEW_LINE>logger.atSevere().withCause(e).log("Exception while feching custom roles: " + parent);<NEW_LINE>try {<NEW_LINE>if (resultsFile != null) {<NEW_LINE>resultsFile.close();<NEW_LINE>}<NEW_LINE>} catch (IOException ie) {<NEW_LINE>logger.atSevere().withCause(ie).log("Exception while closing file steam.");<NEW_LINE>}<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>logger.atInfo().log("Total number of custom roles at " + parent + ":" + customRole.size());<NEW_LINE>Iterator<Role> iterator = customRole.iterator();<NEW_LINE>while (iterator.hasNext()) {<NEW_LINE>Role role = iterator.next();<NEW_LINE>Set<String> customRolePermissionsSet = new HashSet<String>(role.getIncludedPermissions());<NEW_LINE>logger.atInfo().log("Finding possible matching roles for: " + role.getName());<NEW_LINE>Map<String, Set<String>> possibleMatchingRoles = roleUtil.findPosibleMatchingRoles(customRolePermissionsSet, predefinedRolesWithSupportedPermissions);<NEW_LINE>Map<String, Set<String>> matchingRoles = roleUtil.findMachingPredefindedRoles(role, possibleMatchingRoles);<NEW_LINE>printResult(parent, matchingRoles, role);<NEW_LINE>}<NEW_LINE>} | customRole = iamClient.fetchCustomRolesProjectLevel(parent); |
1,128,732 | final DeleteDistributionConfigurationResult executeDeleteDistributionConfiguration(DeleteDistributionConfigurationRequest deleteDistributionConfigurationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteDistributionConfigurationRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteDistributionConfigurationRequest> request = null;<NEW_LINE>Response<DeleteDistributionConfigurationResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteDistributionConfigurationRequestProtocolMarshaller(protocolFactory).marshall<MASK><NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "imagebuilder");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteDistributionConfiguration");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteDistributionConfigurationResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteDistributionConfigurationResultJsonUnmarshaller());<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(deleteDistributionConfigurationRequest)); |
838,952 | // GEN-LAST:event_codenameOneTabsActionPerformed<NEW_LINE>private void propertiesMouseClicked(java.awt.event.MouseEvent evt) {<NEW_LINE>// GEN-FIRST:event_propertiesMouseClicked<NEW_LINE>if (BaseForm.isRightClick(evt)) {<NEW_LINE>AbstractAction clearModified = new AbstractAction() {<NEW_LINE><NEW_LINE>public void actionPerformed(ActionEvent e) {<NEW_LINE><MASK><NEW_LINE>if (row > -1) {<NEW_LINE>int propertyId = ((ComponentPropertyEditorModel) properties.getModel()).getRowId(row);<NEW_LINE>String propertyName = (String) properties.getValueAt(row, 0);<NEW_LINE>clearPropertyModification(getSelectedComponents()[0], propertyId, propertyName);<NEW_LINE>saveUI();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>clearModified.putValue(AbstractAction.NAME, "Clear Modified Flag");<NEW_LINE>JPopupMenu popup = new JPopupMenu();<NEW_LINE>popup.add(clearModified);<NEW_LINE>popup.show(properties, evt.getX(), evt.getY());<NEW_LINE>}<NEW_LINE>} | int row = properties.getSelectedRow(); |
1,837,878 | public void statsRequest(PEPeer originator, Map request, Map reply) {<NEW_LINE><MASK><NEW_LINE>gm.statsRequest(request, reply);<NEW_LINE>Map info = new HashMap();<NEW_LINE>reply.put("dl", info);<NEW_LINE>try {<NEW_LINE>info.put("u_lim", new Long(getUploadRateLimitBytesPerSecond()));<NEW_LINE>info.put("d_lim", new Long(getDownloadRateLimitBytesPerSecond()));<NEW_LINE>info.put("u_rate", new Long(stats.getProtocolSendRate() + stats.getDataSendRate()));<NEW_LINE>info.put("d_rate", new Long(stats.getProtocolReceiveRate() + stats.getDataReceiveRate()));<NEW_LINE>info.put("u_slot", new Long(getMaxUploads()));<NEW_LINE>info.put("c_max", new Long(getMaxConnections()[0]));<NEW_LINE>info.put("c_leech", new Long(download_manager.getNbPeers()));<NEW_LINE>info.put("c_seed", new Long(download_manager.getNbSeeds()));<NEW_LINE>PEPeerManager pm = peer_manager;<NEW_LINE>if (pm != null) {<NEW_LINE>info.put("c_rem", pm.getNbRemoteTCPConnections());<NEW_LINE>info.put("c_rem_utp", pm.getNbRemoteUTPConnections());<NEW_LINE>info.put("c_rem_udp", pm.getNbRemoteUDPConnections());<NEW_LINE>List<PEPeer> peers = pm.getPeers();<NEW_LINE>List<Long> slot_up = new ArrayList<>();<NEW_LINE>info.put("slot_up", slot_up);<NEW_LINE>for (PEPeer p : peers) {<NEW_LINE>if (!p.isChokedByMe()) {<NEW_LINE>long up = p.getStats().getDataSendRate() + p.getStats().getProtocolSendRate();<NEW_LINE>slot_up.add(up);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Throwable e) {<NEW_LINE>}<NEW_LINE>} | GlobalManager gm = download_manager.getGlobalManager(); |
591,143 | public static ListVpcEndpointsResponse unmarshall(ListVpcEndpointsResponse listVpcEndpointsResponse, UnmarshallerContext _ctx) {<NEW_LINE>listVpcEndpointsResponse.setRequestId(_ctx.stringValue("ListVpcEndpointsResponse.RequestId"));<NEW_LINE>listVpcEndpointsResponse.setNextToken(_ctx.stringValue("ListVpcEndpointsResponse.NextToken"));<NEW_LINE>listVpcEndpointsResponse.setMaxResults(_ctx.stringValue("ListVpcEndpointsResponse.MaxResults"));<NEW_LINE>List<Endpoint> endpoints = new ArrayList<Endpoint>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListVpcEndpointsResponse.Endpoints.Length"); i++) {<NEW_LINE>Endpoint endpoint = new Endpoint();<NEW_LINE>endpoint.setVpcId(_ctx.stringValue("ListVpcEndpointsResponse.Endpoints[" + i + "].VpcId"));<NEW_LINE>endpoint.setEndpointName(_ctx.stringValue("ListVpcEndpointsResponse.Endpoints[" + i + "].EndpointName"));<NEW_LINE>endpoint.setEndpointType(_ctx.stringValue("ListVpcEndpointsResponse.Endpoints[" + i + "].EndpointType"));<NEW_LINE>endpoint.setCreateTime(_ctx.stringValue("ListVpcEndpointsResponse.Endpoints[" + i + "].CreateTime"));<NEW_LINE>endpoint.setServiceId(_ctx.stringValue("ListVpcEndpointsResponse.Endpoints[" + i + "].ServiceId"));<NEW_LINE>endpoint.setZoneAffinityEnabled(_ctx.booleanValue("ListVpcEndpointsResponse.Endpoints[" + i + "].ZoneAffinityEnabled"));<NEW_LINE>endpoint.setEndpointDomain(_ctx.stringValue<MASK><NEW_LINE>endpoint.setEndpointStatus(_ctx.stringValue("ListVpcEndpointsResponse.Endpoints[" + i + "].EndpointStatus"));<NEW_LINE>endpoint.setRegionId(_ctx.stringValue("ListVpcEndpointsResponse.Endpoints[" + i + "].RegionId"));<NEW_LINE>endpoint.setResourceOwner(_ctx.booleanValue("ListVpcEndpointsResponse.Endpoints[" + i + "].ResourceOwner"));<NEW_LINE>endpoint.setBandwidth(_ctx.longValue("ListVpcEndpointsResponse.Endpoints[" + i + "].Bandwidth"));<NEW_LINE>endpoint.setConnectionStatus(_ctx.stringValue("ListVpcEndpointsResponse.Endpoints[" + i + "].ConnectionStatus"));<NEW_LINE>endpoint.setEndpointDescription(_ctx.stringValue("ListVpcEndpointsResponse.Endpoints[" + i + "].EndpointDescription"));<NEW_LINE>endpoint.setEndpointId(_ctx.stringValue("ListVpcEndpointsResponse.Endpoints[" + i + "].EndpointId"));<NEW_LINE>endpoint.setEndpointBusinessStatus(_ctx.stringValue("ListVpcEndpointsResponse.Endpoints[" + i + "].EndpointBusinessStatus"));<NEW_LINE>endpoint.setServiceName(_ctx.stringValue("ListVpcEndpointsResponse.Endpoints[" + i + "].ServiceName"));<NEW_LINE>endpoints.add(endpoint);<NEW_LINE>}<NEW_LINE>listVpcEndpointsResponse.setEndpoints(endpoints);<NEW_LINE>return listVpcEndpointsResponse;<NEW_LINE>} | ("ListVpcEndpointsResponse.Endpoints[" + i + "].EndpointDomain")); |
1,308,119 | static // / @brief Print the solution.<NEW_LINE>void printSolution(DataModel data, RoutingModel routing, RoutingIndexManager manager, Assignment solution) {<NEW_LINE>// Solution cost.<NEW_LINE>logger.info("Objective : " + solution.objectiveValue());<NEW_LINE>// Inspect solution.<NEW_LINE>logger.info("Route for Vehicle 0:");<NEW_LINE>long routeDistance = 0;<NEW_LINE>String route = "";<NEW_LINE>long <MASK><NEW_LINE>while (!routing.isEnd(index)) {<NEW_LINE>route += manager.indexToNode(index) + " -> ";<NEW_LINE>long previousIndex = index;<NEW_LINE>index = solution.value(routing.nextVar(index));<NEW_LINE>routeDistance += routing.getArcCostForVehicle(previousIndex, index, 0);<NEW_LINE>}<NEW_LINE>route += manager.indexToNode(routing.end(0));<NEW_LINE>logger.info(route);<NEW_LINE>logger.info("Distance of the route: " + routeDistance + "m");<NEW_LINE>} | index = routing.start(0); |
353,146 | private Cursor handleBack(SqlSlowSqlCcl slowSqlCcl, ExecutionContext executionContext) {<NEW_LINE>int affectedRows = 0;<NEW_LINE>try (Connection metaDbConn = MetaDbUtil.getConnection()) {<NEW_LINE>metaDbConn.setAutoCommit(false);<NEW_LINE>CclTriggerAccessor cclTriggerAccessor = new CclTriggerAccessor();<NEW_LINE>cclTriggerAccessor.setConnection(metaDbConn);<NEW_LINE>CclRuleAccessor cclRuleAccessor = new CclRuleAccessor();<NEW_LINE>cclRuleAccessor.setConnection(metaDbConn);<NEW_LINE>List<CclTriggerRecord> cclTriggerRecords = cclTriggerAccessor.queryByIds(cclTriggerIds);<NEW_LINE>if (CollectionUtils.isNotEmpty(cclTriggerRecords)) {<NEW_LINE>List<Integer> cclTriggerPriorities = cclTriggerRecords.stream().map(e -> e.priority).collect(Collectors.toList());<NEW_LINE>affectedRows = cclRuleAccessor.deleteByTriggers(cclTriggerPriorities);<NEW_LINE>}<NEW_LINE>cclTriggerAccessor.deleteByIds(cclTriggerIds);<NEW_LINE>String dataId = MetaDbDataIdBuilder.<MASK><NEW_LINE>MetaDbConfigManager metaDbConfigManager = MetaDbConfigManager.getInstance();<NEW_LINE>metaDbConfigManager.notify(dataId, metaDbConn);<NEW_LINE>MetaDbUtil.commit(metaDbConn);<NEW_LINE>metaDbConfigManager.sync(dataId);<NEW_LINE>} catch (Throwable e) {<NEW_LINE>throw new TddlNestableRuntimeException(e);<NEW_LINE>}<NEW_LINE>return new AffectRowCursor(new int[] { affectedRows });<NEW_LINE>} | getCclRuleDataId(InstIdUtil.getInstId()); |
1,772,050 | private void handleController0() {<NEW_LINE>if (buttonUp(ControllerListener.TRIGGER_BUTTON)) {<NEW_LINE>addButtonAction(ControllerId.ZERO, ButtonState.UP);<NEW_LINE>} else if (buttonDown(ControllerListener.TRIGGER_BUTTON)) {<NEW_LINE>addButtonAction(ControllerId.ZERO, ButtonState.DOWN);<NEW_LINE>} else if (buttonUp(ControllerListener.GRIP_BUTTON)) {<NEW_LINE>addButtonAction(ControllerId.ONE, ButtonState.UP);<NEW_LINE>} else if (buttonDown(ControllerListener.GRIP_BUTTON)) {<NEW_LINE>addButtonAction(ControllerId.ONE, ButtonState.DOWN);<NEW_LINE>} else if (buttonUp(ControllerListener.APP_MENU_BUTTON)) {<NEW_LINE>addButtonAction(<MASK><NEW_LINE>} else if (buttonDown(ControllerListener.APP_MENU_BUTTON)) {<NEW_LINE>addButtonAction(ControllerId.TWO, ButtonState.DOWN);<NEW_LINE>} else if (buttonDown(ControllerListener.TOUCHPAD_BUTTON)) {<NEW_LINE>addAxisAction(ControllerId.X_AXIS, ButtonState.DOWN, -cachedStateAfter.rAxis[0].x);<NEW_LINE>addAxisAction(ControllerId.Y_AXIS, ButtonState.DOWN, cachedStateAfter.rAxis[0].y);<NEW_LINE>} else if (buttonUp(ControllerListener.TOUCHPAD_BUTTON)) {<NEW_LINE>addAxisAction(ControllerId.X_AXIS, ButtonState.UP, 0.0f);<NEW_LINE>addAxisAction(ControllerId.Y_AXIS, ButtonState.UP, 0.0f);<NEW_LINE>}<NEW_LINE>} | ControllerId.TWO, ButtonState.UP); |
1,748,564 | public static void handleFilteredAttributes(Field component, Datasource datasource, MetaPropertyPath mpp) {<NEW_LINE>if (component.isRequired() && datasource.getState() == Datasource.State.VALID && datasource.getItem() != null && mpp.getMetaProperty().getRange().isClass()) {<NEW_LINE>Entity targetItem = datasource.getItem();<NEW_LINE>MetaProperty[] propertiesChain = mpp.getMetaProperties();<NEW_LINE>if (propertiesChain.length > 1) {<NEW_LINE>String basePropertyItem = Arrays.stream(propertiesChain).limit(propertiesChain.length - 1).map(MetadataObject::getName).collect(Collectors.joining("."));<NEW_LINE>targetItem = datasource.getItem().getValueEx(basePropertyItem);<NEW_LINE>}<NEW_LINE>if (targetItem instanceof BaseGenericIdEntity) {<NEW_LINE>String metaPropertyName = mpp<MASK><NEW_LINE>Object value = targetItem.getValue(metaPropertyName);<NEW_LINE>BaseGenericIdEntity baseGenericIdEntity = (BaseGenericIdEntity) targetItem;<NEW_LINE>String[] filteredAttributes = getFilteredAttributes(baseGenericIdEntity);<NEW_LINE>if (value == null && filteredAttributes != null && ArrayUtils.contains(filteredAttributes, metaPropertyName)) {<NEW_LINE>component.setRequired(false);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .getMetaProperty().getName(); |
864,303 | private void sendAltContacts(DHTUDPPacketRequestPing request, DHTUDPPacketReplyPing reply) {<NEW_LINE>if (request.getProtocolVersion() >= DHTTransportUDP.PROTOCOL_VERSION_ALT_CONTACTS) {<NEW_LINE>int[] alt_nets = request.getAltNetworks();<NEW_LINE>int[<MASK><NEW_LINE>if (alt_nets.length > 0) {<NEW_LINE>List<DHTTransportAlternativeContact> alt_contacts = new ArrayList<>();<NEW_LINE>Map<Integer, DHTTransportAlternativeNetwork> providers = alt_net_providers;<NEW_LINE>for (int i = 0; i < alt_nets.length; i++) {<NEW_LINE>int count = counts[i];<NEW_LINE>if (count == 0) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>int net = alt_nets[i];<NEW_LINE>DHTTransportAlternativeNetworkImpl local = alt_net_states.get(net);<NEW_LINE>if (local == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>int wanted = local.getRequiredContactCount();<NEW_LINE>if (wanted > 0) {<NEW_LINE>DHTTransportAlternativeNetwork provider = providers.get(net);<NEW_LINE>if (provider != null) {<NEW_LINE>local.addContactsForSend(provider.getContacts(wanted));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// need to limit response for large serialisations<NEW_LINE>if (net == DHTTransportAlternativeNetwork.AT_I2P) {<NEW_LINE>count = Math.min(2, count);<NEW_LINE>}<NEW_LINE>alt_contacts.addAll(local.getContacts(count, true));<NEW_LINE>}<NEW_LINE>if (alt_contacts.size() > 0) {<NEW_LINE>reply.setAltContacts(alt_contacts);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ] counts = request.getAltNetworkCounts(); |
1,540,124 | public static String updateUserRole(String ApplicationRoot, String playerId, String newRole) {<NEW_LINE>log.debug("*** Setter.updateUserRole ***");<NEW_LINE>String result = null;<NEW_LINE>try {<NEW_LINE>Connection conn = Database.getCoreConnection(ApplicationRoot);<NEW_LINE>log.debug("Preparing userUpdateRole call");<NEW_LINE>CallableStatement callstmnt = conn.prepareCall("call userUpdateRole(?, ?)");<NEW_LINE><MASK><NEW_LINE>callstmnt.setString(2, newRole);<NEW_LINE>log.debug("Executing userUpdateRole");<NEW_LINE>ResultSet resultSet = callstmnt.executeQuery();<NEW_LINE>resultSet.next();<NEW_LINE>result = resultSet.getString(1);<NEW_LINE>Database.closeConnection(conn);<NEW_LINE>} catch (SQLException e) {<NEW_LINE>log.error("userUpdateRole Failure: " + e.toString());<NEW_LINE>result = null;<NEW_LINE>}<NEW_LINE>log.debug("*** END updateUserRole ***");<NEW_LINE>return result;<NEW_LINE>} | callstmnt.setString(1, playerId); |
940,751 | private void test(int substringSearchMethodId) {<NEW_LINE>String text = "abcdrenetestreneabdreneabcdd";<NEW_LINE>String pattern1 = "rene";<NEW_LINE>SubstringSearch substringSearch1 = createSubstringSearch(substringSearchMethodId, pattern1);<NEW_LINE>if (substringSearch1 == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>StringJoiner offsets1 = new StringJoiner(", ");<NEW_LINE>for (int offset : substringSearch1.findAll(text)) {<NEW_LINE>offsets1.add<MASK><NEW_LINE>}<NEW_LINE>StdOut.println("Offsets 1: " + offsets1.toString());<NEW_LINE>StdOut.println("Expected: 4, 12, 19\n");<NEW_LINE>String pattern2 = "abcd";<NEW_LINE>SubstringSearch substringSearch2 = createSubstringSearch(substringSearchMethodId, pattern2);<NEW_LINE>StringJoiner offsets2 = new StringJoiner(", ");<NEW_LINE>for (int offset : substringSearch2.findAll(text)) {<NEW_LINE>offsets2.add(String.valueOf(offset));<NEW_LINE>}<NEW_LINE>StdOut.println("Offsets 2: " + offsets2.toString());<NEW_LINE>StdOut.println("Expected: 0, 23\n");<NEW_LINE>String pattern3 = "d";<NEW_LINE>SubstringSearch substringSearch3 = createSubstringSearch(substringSearchMethodId, pattern3);<NEW_LINE>StringJoiner offsets3 = new StringJoiner(", ");<NEW_LINE>for (int offset : substringSearch3.findAll(text)) {<NEW_LINE>offsets3.add(String.valueOf(offset));<NEW_LINE>}<NEW_LINE>StdOut.println("Offsets 3: " + offsets3.toString());<NEW_LINE>StdOut.println("Expected: 3, 18, 26, 27\n");<NEW_LINE>String pattern4 = "zzz";<NEW_LINE>SubstringSearch substringSearch4 = createSubstringSearch(substringSearchMethodId, pattern4);<NEW_LINE>StringJoiner offsets4 = new StringJoiner(", ");<NEW_LINE>for (int offset : substringSearch4.findAll(text)) {<NEW_LINE>offsets4.add(String.valueOf(offset));<NEW_LINE>}<NEW_LINE>StdOut.println("Offsets 4: " + offsets4.toString());<NEW_LINE>StdOut.println("Expected: \n");<NEW_LINE>} | (String.valueOf(offset)); |
743,624 | public DescribeServiceUpdatesResult unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>DescribeServiceUpdatesResult describeServiceUpdatesResult = new DescribeServiceUpdatesResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>if (context.isStartOfDocument())<NEW_LINE>targetDepth += 2;<NEW_LINE>while (true) {<NEW_LINE>XMLEvent xmlEvent = context.nextEvent();<NEW_LINE>if (xmlEvent.isEndDocument())<NEW_LINE>return describeServiceUpdatesResult;<NEW_LINE>if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {<NEW_LINE>if (context.testExpression("Marker", targetDepth)) {<NEW_LINE>describeServiceUpdatesResult.setMarker(StringStaxUnmarshaller.getInstance<MASK><NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("ServiceUpdates", targetDepth)) {<NEW_LINE>describeServiceUpdatesResult.withServiceUpdates(new ArrayList<ServiceUpdate>());<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("ServiceUpdates/ServiceUpdate", targetDepth)) {<NEW_LINE>describeServiceUpdatesResult.withServiceUpdates(ServiceUpdateStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent.isEndElement()) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>return describeServiceUpdatesResult;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ().unmarshall(context)); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.