idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
180,753 | protected void doStart() throws Exception {<NEW_LINE>getConnectionFactories().stream().filter(ConnectionFactory.Configuring.class::isInstance).map(ConnectionFactory.Configuring.class::cast).forEach(configuring -> configuring.configure(this));<NEW_LINE>_shutdown = new Graceful.Shutdown(this) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean isShutdownDone() {<NEW_LINE>if (!_endpoints.isEmpty())<NEW_LINE>return false;<NEW_LINE>for (Thread a : _acceptors) {<NEW_LINE>if (a != null)<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>if (_defaultProtocol == null)<NEW_LINE>throw new IllegalStateException("No default protocol for " + this);<NEW_LINE>_defaultConnectionFactory = getConnectionFactory(_defaultProtocol);<NEW_LINE>if (_defaultConnectionFactory == null)<NEW_LINE>throw new IllegalStateException("No protocol factory for default protocol '" + _defaultProtocol + "' in " + this);<NEW_LINE>SslConnectionFactory ssl = getConnectionFactory(SslConnectionFactory.class);<NEW_LINE>if (ssl != null) {<NEW_LINE>String next = ssl.getNextProtocol();<NEW_LINE>ConnectionFactory cf = getConnectionFactory(next);<NEW_LINE>if (cf == null)<NEW_LINE>throw new IllegalStateException("No protocol factory for SSL next protocol: '" + next + "' in " + this);<NEW_LINE>}<NEW_LINE>_lease = ThreadPoolBudget.leaseFrom(getExecutor(), this, _acceptors.length);<NEW_LINE>super.doStart();<NEW_LINE>for (int i = 0; i < _acceptors.length; i++) {<NEW_LINE>Acceptor a = new Acceptor(i);<NEW_LINE>addBean(a);<NEW_LINE>getExecutor().execute(a);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>} | LOG.info("Started {}", this); |
690,973 | static byte[] convert(String source, FileFormat fileFormat, StructurizrPlantUMLExporter structurizrPlantUMLExporter, JsonObject options) {<NEW_LINE>StructurizrDslParser parser = new StructurizrDslParser();<NEW_LINE>try {<NEW_LINE>parser.parse(source);<NEW_LINE>Collection<View> views = parser.getWorkspace().getViews().getViews();<NEW_LINE>if (views.isEmpty()) {<NEW_LINE>throw new BadRequestException("Empty diagram, does not have any view.");<NEW_LINE>}<NEW_LINE>View selectedView;<NEW_LINE>String <MASK><NEW_LINE>if (viewKey != null && !viewKey.trim().isEmpty()) {<NEW_LINE>Optional<View> viewFound = views.stream().filter(view -> Objects.equals(view.getKey(), viewKey)).findFirst();<NEW_LINE>if (!viewFound.isPresent()) {<NEW_LINE>throw new BadRequestException("Unable to find view for key: " + viewKey + ".");<NEW_LINE>}<NEW_LINE>selectedView = viewFound.get();<NEW_LINE>} else {<NEW_LINE>// take the first view if not specified<NEW_LINE>selectedView = views.iterator().next();<NEW_LINE>}<NEW_LINE>final Diagram diagram;<NEW_LINE>if (selectedView instanceof DynamicView) {<NEW_LINE>diagram = structurizrPlantUMLExporter.export((DynamicView) selectedView);<NEW_LINE>} else if (selectedView instanceof DeploymentView) {<NEW_LINE>diagram = structurizrPlantUMLExporter.export((DeploymentView) selectedView);<NEW_LINE>} else if (selectedView instanceof ComponentView) {<NEW_LINE>diagram = structurizrPlantUMLExporter.export((ComponentView) selectedView);<NEW_LINE>} else if (selectedView instanceof ContainerView) {<NEW_LINE>diagram = structurizrPlantUMLExporter.export((ContainerView) selectedView);<NEW_LINE>} else if (selectedView instanceof SystemContextView) {<NEW_LINE>diagram = structurizrPlantUMLExporter.export((SystemContextView) selectedView);<NEW_LINE>} else if (selectedView instanceof SystemLandscapeView) {<NEW_LINE>diagram = structurizrPlantUMLExporter.export((SystemLandscapeView) selectedView);<NEW_LINE>} else {<NEW_LINE>throw new BadRequestException("View type is not supported: " + selectedView.getClass().getSimpleName() + ", must be a DynamicView, DeploymentView, ComponentView, ContainerView, SystemContextView or SystemLandscapeView.");<NEW_LINE>}<NEW_LINE>return Plantuml.convert(diagram.getDefinition(), fileFormat, new JsonObject());<NEW_LINE>} catch (StructurizrDslParserException e) {<NEW_LINE>String cause = e.getMessage();<NEW_LINE>final String message;<NEW_LINE>if (cause != null && !cause.trim().isEmpty()) {<NEW_LINE>message = "Unable to parse the Structurizr DSL. " + cause + ".";<NEW_LINE>} else {<NEW_LINE>message = "Unable to parse the Structurizr DSL.";<NEW_LINE>}<NEW_LINE>throw new BadRequestException(message, e);<NEW_LINE>}<NEW_LINE>} | viewKey = options.getString("view-key"); |
66,898 | private SwapTarget findSwapTargetItem(SwapTarget dest, FindSwapTargetContext fc, boolean alternative) {<NEW_LINE>RecyclerView.ViewHolder swapTargetHolder = null;<NEW_LINE>dest.clear();<NEW_LINE>if ((fc.draggingItem == null) || (getWrappedAdapterPosition(fc.draggingItem) != RecyclerView.NO_POSITION && fc.draggingItem.getItemId() == fc.draggingItemInfo.id)) {<NEW_LINE>switch(fc.layoutType) {<NEW_LINE>case CustomRecyclerViewUtils.LAYOUT_TYPE_GRID_HORIZONTAL:<NEW_LINE>case CustomRecyclerViewUtils.LAYOUT_TYPE_GRID_VERTICAL:<NEW_LINE>swapTargetHolder = findSwapTargetItemForGridLayoutManager(fc, alternative);<NEW_LINE>break;<NEW_LINE>case CustomRecyclerViewUtils.LAYOUT_TYPE_STAGGERED_GRID_HORIZONTAL:<NEW_LINE>case CustomRecyclerViewUtils.LAYOUT_TYPE_STAGGERED_GRID_VERTICAL:<NEW_LINE>swapTargetHolder = findSwapTargetItemForStaggeredGridLayoutManager(fc, alternative);<NEW_LINE>break;<NEW_LINE>case CustomRecyclerViewUtils.LAYOUT_TYPE_LINEAR_HORIZONTAL:<NEW_LINE>case CustomRecyclerViewUtils.LAYOUT_TYPE_LINEAR_VERTICAL:<NEW_LINE>swapTargetHolder = findSwapTargetItemForLinearLayoutManager(fc, alternative);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (swapTargetHolder == fc.draggingItem) {<NEW_LINE>swapTargetHolder = null;<NEW_LINE>dest.self = true;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>// check wrappedAdapterRange<NEW_LINE>if (swapTargetHolder != null && fc.wrappedAdapterRange != null) {<NEW_LINE>if (!fc.wrappedAdapterRange.checkInRange(swapTargetWrappedItemPosition)) {<NEW_LINE>swapTargetHolder = null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>dest.holder = swapTargetHolder;<NEW_LINE>dest.position = (swapTargetHolder != null) ? swapTargetWrappedItemPosition : RecyclerView.NO_POSITION;<NEW_LINE>return dest;<NEW_LINE>} | final int swapTargetWrappedItemPosition = getWrappedAdapterPosition(swapTargetHolder); |
1,339,542 | private FileType loadFileType(@Nonnull Element typeElement, boolean isDefault) {<NEW_LINE>String fileTypeName = typeElement.getAttributeValue(ATTRIBUTE_NAME);<NEW_LINE>String fileTypeDescr = typeElement.getAttributeValue(ATTRIBUTE_DESCRIPTION);<NEW_LINE>String iconPath = typeElement.getAttributeValue("icon");<NEW_LINE>String extensionsStr = StringUtil.nullize(typeElement.getAttributeValue("extensions"));<NEW_LINE>if (isDefault && extensionsStr != null) {<NEW_LINE>// todo support wildcards<NEW_LINE>extensionsStr = filterAlreadyRegisteredExtensions(extensionsStr);<NEW_LINE>}<NEW_LINE>FileType type = isDefault ? getFileTypeByName(fileTypeName) : null;<NEW_LINE>if (type != null) {<NEW_LINE>return type;<NEW_LINE>}<NEW_LINE>Element element = typeElement.getChild(AbstractFileType.ELEMENT_HIGHLIGHTING);<NEW_LINE>if (element == null) {<NEW_LINE>type = new UserBinaryFileType();<NEW_LINE>} else {<NEW_LINE>SyntaxTable table = AbstractFileType.readSyntaxTable(element);<NEW_LINE>type = new AbstractFileType(table);<NEW_LINE>((AbstractFileType) type).initSupport();<NEW_LINE>}<NEW_LINE>setFileTypeAttributes((UserFileType) type, fileTypeName, fileTypeDescr, iconPath);<NEW_LINE>registerFileTypeWithoutNotification(type<MASK><NEW_LINE>if (isDefault) {<NEW_LINE>myDefaultTypes.add(type);<NEW_LINE>if (type instanceof ExternalizableFileType) {<NEW_LINE>((ExternalizableFileType) type).markDefaultSettings();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>Element extensions = typeElement.getChild(AbstractFileType.ELEMENT_EXTENSION_MAP);<NEW_LINE>if (extensions != null) {<NEW_LINE>for (Pair<FileNameMatcher, String> association : AbstractFileType.readAssociations(extensions)) {<NEW_LINE>associate(type, association.getFirst(), false);<NEW_LINE>}<NEW_LINE>for (RemovedMappingTracker.RemovedMapping removedAssociation : RemovedMappingTracker.readRemovedMappings(extensions)) {<NEW_LINE>removeAssociation(type, removedAssociation.getFileNameMatcher(), false);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return type;<NEW_LINE>} | , parse(extensionsStr), isDefault); |
1,620,302 | private TornadoInstalledCode compileTask(SchedulableTask task) {<NEW_LINE>final CompilableTask executable = (CompilableTask) task;<NEW_LINE>final ResolvedJavaMethod resolvedMethod = TornadoCoreRuntime.getTornadoRuntime().resolveMethod(executable.getMethod());<NEW_LINE>final Sketch sketch = TornadoSketcher.lookup(resolvedMethod, task.meta().getDriverIndex(), task.meta().getDeviceIndex());<NEW_LINE>// copy meta data into task<NEW_LINE>final TaskMetaData taskMeta = executable.meta();<NEW_LINE>final Access[] sketchAccess = sketch.getArgumentsAccess();<NEW_LINE>final Access[] taskAccess = taskMeta.getArgumentsAccess();<NEW_LINE>System.arraycopy(sketchAccess, 0, taskAccess, 0, sketchAccess.length);<NEW_LINE>try {<NEW_LINE>OCLProviders providers = (OCLProviders) getBackend().getProviders();<NEW_LINE>TornadoProfiler profiler = task.getProfiler();<NEW_LINE>profiler.start(ProfilerType.TASK_COMPILE_GRAAL_TIME, taskMeta.getId());<NEW_LINE>final OCLCompilationResult result = OCLCompiler.compileSketchForDevice(sketch, <MASK><NEW_LINE>profiler.stop(ProfilerType.TASK_COMPILE_GRAAL_TIME, taskMeta.getId());<NEW_LINE>profiler.sum(ProfilerType.TOTAL_GRAAL_COMPILE_TIME, profiler.getTaskTimer(ProfilerType.TASK_COMPILE_GRAAL_TIME, taskMeta.getId()));<NEW_LINE>RuntimeUtilities.maybePrintSource(result.getTargetCode());<NEW_LINE>return null;<NEW_LINE>} catch (Exception e) {<NEW_LINE>driver.fatal("unable to compile %s for device %s", task.getId(), getDeviceName());<NEW_LINE>driver.fatal("exception occured when compiling %s", ((CompilableTask) task).getMethod().getName());<NEW_LINE>driver.fatal("exception: %s", e.toString());<NEW_LINE>throw new TornadoBailoutRuntimeException("[Error During the Task Compilation] ", e);<NEW_LINE>}<NEW_LINE>} | executable, providers, getBackend()); |
1,170,734 | public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {<NEW_LINE>View view = inflater.inflate(R.layout.list_fragment, container, false);<NEW_LINE>mListView = view.findViewById(android.R.id.list);<NEW_LINE>mBackgroundList = view.findViewById(R.id.background_list);<NEW_LINE>((ImageView) view.findViewById(R.id.background_list_iv)).<MASK><NEW_LINE>((TextView) view.findViewById(R.id.list_status)).setText(R.string.no_xposed_modules_found);<NEW_LINE>mSearchListener = new SearchView.OnQueryTextListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean onQueryTextSubmit(String query) {<NEW_LINE>filter(query);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean onQueryTextChange(String newText) {<NEW_LINE>filter(newText);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>return view;<NEW_LINE>} | setImageResource(R.drawable.ic_nav_modules); |
1,732,444 | public Node writeDescriptor(Node parent, String nodeName, MessageSecurityDescriptor messageSecurityDesc) {<NEW_LINE>Node messageSecurityNode = super.writeDescriptor(parent, nodeName, messageSecurityDesc);<NEW_LINE>List<MessageDescriptor<MASK><NEW_LINE>if (!messageDescriptors.isEmpty()) {<NEW_LINE>MessageNode messageNode = new MessageNode();<NEW_LINE>for (MessageDescriptor messageDesc : messageDescriptors) {<NEW_LINE>messageNode.writeDescriptor(messageSecurityNode, MESSAGE, messageDesc);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// request-protection<NEW_LINE>ProtectionDescriptor requestProtectionDesc = messageSecurityDesc.getRequestProtectionDescriptor();<NEW_LINE>if (requestProtectionDesc != null) {<NEW_LINE>new ProtectionNode().writeDescriptor(messageSecurityNode, REQUEST_PROTECTION, requestProtectionDesc);<NEW_LINE>}<NEW_LINE>// response-protection<NEW_LINE>ProtectionDescriptor responseProtectionDesc = messageSecurityDesc.getResponseProtectionDescriptor();<NEW_LINE>if (responseProtectionDesc != null) {<NEW_LINE>new ProtectionNode().writeDescriptor(messageSecurityNode, RESPONSE_PROTECTION, responseProtectionDesc);<NEW_LINE>}<NEW_LINE>return messageSecurityNode;<NEW_LINE>} | > messageDescriptors = messageSecurityDesc.getMessageDescriptors(); |
1,258,545 | public void doExecute(@Nonnull final Editor editor, @Nullable Caret caret, final DataContext dataContext) {<NEW_LINE>assert caret != null;<NEW_LINE>if (editor.isViewer() || !EditorModificationUtil.requestWriting(editor))<NEW_LINE>return;<NEW_LINE>if (!(editor.getDocument() instanceof DocumentEx)) {<NEW_LINE>myOriginalHandler.execute(editor, caret, dataContext);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final DocumentEx doc = (DocumentEx) editor.getDocument();<NEW_LINE>final Project project = DataManager.getInstance().getDataContext(editor.getContentComponent()).getData(CommonDataKeys.PROJECT);<NEW_LINE>if (project == null)<NEW_LINE>return;<NEW_LINE>final PsiDocumentManager docManager = PsiDocumentManager.getInstance(project);<NEW_LINE>PsiFile psiFile = docManager.getPsiFile(doc);<NEW_LINE>if (psiFile == null) {<NEW_LINE>myOriginalHandler.execute(editor, caret, dataContext);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>int startLine = caretPosition.line;<NEW_LINE>int endLine = startLine + 1;<NEW_LINE>if (caret.hasSelection()) {<NEW_LINE>startLine = doc.getLineNumber(caret.getSelectionStart());<NEW_LINE>endLine = doc.getLineNumber(caret.getSelectionEnd());<NEW_LINE>if (doc.getLineStartOffset(endLine) == caret.getSelectionEnd())<NEW_LINE>endLine--;<NEW_LINE>}<NEW_LINE>if (endLine >= doc.getLineCount())<NEW_LINE>return;<NEW_LINE>int lineCount = endLine - startLine;<NEW_LINE>int line = startLine;<NEW_LINE>((ApplicationEx) ApplicationManager.getApplication()).runWriteActionWithCancellableProgressInDispatchThread("Join Lines", project, null, indicator -> {<NEW_LINE>indicator.setIndeterminate(false);<NEW_LINE>JoinLineProcessor processor = new JoinLineProcessor(doc, psiFile, line, indicator);<NEW_LINE>processor.process(editor, caret, lineCount);<NEW_LINE>});<NEW_LINE>} | LogicalPosition caretPosition = caret.getLogicalPosition(); |
1,291,707 | public static AnnotatedIntervalCollection create(final Path input, final Path inputConfigFile, final Set<String> headersOfInterest) {<NEW_LINE>IOUtils.assertFileIsReadable(input);<NEW_LINE>IOUtils.assertFileIsReadable(inputConfigFile);<NEW_LINE>final AnnotatedIntervalCodec codec = new AnnotatedIntervalCodec(inputConfigFile);<NEW_LINE>final List<AnnotatedInterval> regions = new ArrayList<>();<NEW_LINE>if (codec.canDecode(input.toUri().toString())) {<NEW_LINE>try (final FeatureReader<AnnotatedInterval> reader = AbstractFeatureReader.getFeatureReader(input.toUri().toString(), codec, false)) {<NEW_LINE>// This cast is an artifact of the tribble framework.<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>final AnnotatedIntervalHeader header = (AnnotatedIntervalHeader) reader.getHeader();<NEW_LINE>final List<String> finalAnnotations = determineCollectionAnnotations(headersOfInterest, header.getAnnotations());<NEW_LINE>final CloseableTribbleIterator<AnnotatedInterval> it = reader.iterator();<NEW_LINE>StreamSupport.stream(it.spliterator(), false).filter(r -> r != null).map(r -> copyAnnotatedInterval(r, new HashSet<>(finalAnnotations))).forEach(r <MASK><NEW_LINE>return new AnnotatedIntervalCollection(header.getSamFileHeader(), finalAnnotations, regions);<NEW_LINE>} catch (final IOException ex) {<NEW_LINE>throw new GATKException("Error - IO problem with file " + input, ex);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new UserException.BadInput("Could not parse xsv file: " + input.toUri().toString());<NEW_LINE>}<NEW_LINE>} | -> regions.add(r)); |
1,844,094 | public void refreshState() {<NEW_LINE>detailView.setVisible(this.model.supportsTwoViews());<NEW_LINE>final Collection<Unit> units = model.getMarkedUnits();<NEW_LINE>if (oldUnits.equals(units)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>oldUnits = units;<NEW_LINE>popupActionsSupport.tableDataChanged();<NEW_LINE>buttonsActionsSupport.tableDataChanged();<NEW_LINE>if (units.isEmpty()) {<NEW_LINE>cleanSelectionInfo();<NEW_LINE>} else {<NEW_LINE>setSelectionInfo(<MASK><NEW_LINE>}<NEW_LINE>getDefaultAction().tableDataChanged(units);<NEW_LINE>boolean alreadyScheduled = false;<NEW_LINE>if (getDownloadSizeTask != null) {<NEW_LINE>if (getDownloadSizeTask.getDelay() > 0) {<NEW_LINE>getDownloadSizeTask.schedule(1000);<NEW_LINE>alreadyScheduled = true;<NEW_LINE>} else if (!getDownloadSizeTask.isFinished()) {<NEW_LINE>getDownloadSizeTask.cancel();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (units.size() > 0 && !alreadyScheduled) {<NEW_LINE>getDownloadSizeTask = DOWNLOAD_SIZE_PROCESSOR.post(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>int downloadSize = model.getDownloadSize();<NEW_LINE>if (Thread.interrupted()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (model.getMarkedUnits().isEmpty()) {<NEW_LINE>cleanSelectionInfo();<NEW_LINE>} else {<NEW_LINE>setSelectionInfo(Utilities.getDownloadSizeAsString(downloadSize), model.getMarkedUnits().size());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}, 150);<NEW_LINE>}<NEW_LINE>} | null, units.size()); |
1,149,856 | protected void consumeTypeReferenceWithModifiersAndAnnotations() {<NEW_LINE>// RelationalExpression ::= RelationalExpression 'instanceof' ReferenceType<NEW_LINE>// optimize the push/pop<NEW_LINE>int length;<NEW_LINE>Annotation[] typeAnnotations = null;<NEW_LINE>if ((length = this.expressionLengthStack[this.expressionLengthPtr--]) != 0) {<NEW_LINE>System.arraycopy(this.expressionStack, (this.expressionPtr -= length) + 1, typeAnnotations = new Annotation[length], 0, length);<NEW_LINE>}<NEW_LINE>TypeReference ref = getTypeReference(this.<MASK><NEW_LINE>if (typeAnnotations != null) {<NEW_LINE>int levels = ref.getAnnotatableLevels();<NEW_LINE>if (ref.annotations == null)<NEW_LINE>ref.annotations = new Annotation[levels][];<NEW_LINE>ref.annotations[0] = typeAnnotations;<NEW_LINE>ref.sourceStart = ref.annotations[0][0].sourceStart;<NEW_LINE>ref.bits |= ASTNode.HasTypeAnnotations;<NEW_LINE>}<NEW_LINE>pushOnExpressionStack(ref);<NEW_LINE>// by construction, no base type may be used in getTypeReference<NEW_LINE>// exp.declarationSourceStart = this.intStack[this.intPtr--];<NEW_LINE>// exp.modifiers = this.intStack[this.intPtr--];<NEW_LINE>// the scanner is on the next token already....<NEW_LINE>} | intStack[this.intPtr--]); |
1,364,218 | public void handle(final HttpExchange t) throws IOException {<NEW_LINE>final String date = new Date().toString();<NEW_LINE>_sensors.get(_name).incrementAndGet();<NEW_LINE><MASK><NEW_LINE>Long delay = _delay;<NEW_LINE>if (headers.containsKey("delay")) {<NEW_LINE>List<String> headerValues = headers.get("delay");<NEW_LINE>delay = Long.parseLong(headerValues.get(0));<NEW_LINE>}<NEW_LINE>System.out.println(date + ": " + _serverName + " received a request for the context handler = " + _name);<NEW_LINE>_executorService.schedule(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>String response = "server " + _serverName;<NEW_LINE>try {<NEW_LINE>t.sendResponseHeaders(200, response.length());<NEW_LINE>OutputStream os = t.getResponseBody();<NEW_LINE>os.write(response.getBytes());<NEW_LINE>os.close();<NEW_LINE>} catch (IOException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}, delay, TimeUnit.MILLISECONDS);<NEW_LINE>} | Headers headers = t.getRequestHeaders(); |
209,593 | private Path addSingleInput(Path path) throws IOException {<NEW_LINE>if (map.containsKey(path)) {<NEW_LINE>return map.get(path);<NEW_LINE>}<NEW_LINE>Preconditions.checkArgument(path.normalize().equals(path));<NEW_LINE>if (!path.startsWith(cellPathPrefix)) {<NEW_LINE>map.put(path, path);<NEW_LINE>return path;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if (parent.getNameCount() != cellPathPrefix.getNameCount()) {<NEW_LINE>parent = addSingleInput(parent);<NEW_LINE>}<NEW_LINE>if (!parent.equals(path.getParent())) {<NEW_LINE>// Some parent is a symlink, add the target.<NEW_LINE>Path target = addSingleInput(parent.resolve(path.getFileName()));<NEW_LINE>map.put(path, target);<NEW_LINE>return target;<NEW_LINE>}<NEW_LINE>Path symlinkTarget = delegate.getSymlinkTarget(path);<NEW_LINE>if (symlinkTarget != null) {<NEW_LINE>Path resolvedTarget = path.getParent().resolve(symlinkTarget).normalize();<NEW_LINE>boolean contained = resolvedTarget.startsWith(cellPathPrefix);<NEW_LINE>Path fixedTarget = resolvedTarget;<NEW_LINE>if (contained) {<NEW_LINE>fixedTarget = parent.relativize(resolvedTarget);<NEW_LINE>}<NEW_LINE>delegate.addSymlink(path, fixedTarget);<NEW_LINE>Path target = contained ? addSingleInput(resolvedTarget) : resolvedTarget;<NEW_LINE>map.put(path, target);<NEW_LINE>return target;<NEW_LINE>}<NEW_LINE>if (Files.isRegularFile(path)) {<NEW_LINE>delegate.addFile(path);<NEW_LINE>}<NEW_LINE>map.put(path, path);<NEW_LINE>return path;<NEW_LINE>} | Path parent = path.getParent(); |
590,378 | public static void explodeBlock(World world, BlockPos pos) {<NEW_LINE>if (FMLCommonHandler.instance().getEffectiveSide().isClient()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>double x = pos.getX() + 0.5;<NEW_LINE>double y = pos.getY() + 0.5;<NEW_LINE>double z = pos.getZ() + 0.5;<NEW_LINE>Explosion explosion = new Explosion(world, null, x, y, z, 3f, false, false);<NEW_LINE>explosion.<MASK><NEW_LINE>explosion.doExplosionB(true);<NEW_LINE>for (EntityPlayer player : world.playerEntities) {<NEW_LINE>if (!(player instanceof EntityPlayerMP)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (player.getDistanceSq(pos) < 4096) {<NEW_LINE>((EntityPlayerMP) player).connection.sendPacket(new SPacketExplosion(x, y, z, 3f, explosion.getAffectedBlockPositions(), null));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | getAffectedBlockPositions().add(pos); |
1,064,872 | private void sendEventToJS(String eventName, @Nullable WritableMap params) {<NEW_LINE>boolean isBoundToJS = this.reactContext.hasActiveCatalystInstance();<NEW_LINE>Log.v(TAG, "[RNCallKeepModule] sendEventToJS, eventName: " + eventName + ", bound: " + isBoundToJS + ", hasListeners: " + hasListeners + " args : " + (params != null ? params.toString() : "null"));<NEW_LINE>if (isBoundToJS && hasListeners) {<NEW_LINE>this.reactContext.getJSModule(RCTDeviceEventEmitter.class).emit(eventName, params);<NEW_LINE>} else {<NEW_LINE>WritableMap data = Arguments.createMap();<NEW_LINE>if (params == null) {<NEW_LINE>params = Arguments.createMap();<NEW_LINE>}<NEW_LINE>data.putString("name", eventName);<NEW_LINE><MASK><NEW_LINE>delayedEvents.pushMap(data);<NEW_LINE>}<NEW_LINE>} | data.putMap("data", params); |
1,339,526 | private void addLine(float x1, float y1, float x2, float y2) {<NEW_LINE>// orientation of the line. 1 if y increases, 0 otherwise.<NEW_LINE>float or = 1;<NEW_LINE>if (y2 < y1) {<NEW_LINE>// no need to declare a temp variable. We have or.<NEW_LINE>or = y2;<NEW_LINE>y2 = y1;<NEW_LINE>y1 = or;<NEW_LINE>or = x2;<NEW_LINE>x2 = x1;<NEW_LINE>x1 = or;<NEW_LINE>or = 0;<NEW_LINE>}<NEW_LINE>final int firstCrossing = Math.max((int) Math.ceil(y1), boundsMinY);<NEW_LINE>final int lastCrossing = Math.min((int) Math.ceil(y2), boundsMaxY);<NEW_LINE>if (firstCrossing >= lastCrossing) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (y1 < edgeMinY) {<NEW_LINE>edgeMinY = y1;<NEW_LINE>}<NEW_LINE>if (y2 > edgeMaxY) {<NEW_LINE>edgeMaxY = y2;<NEW_LINE>}<NEW_LINE>final float slope = (x2 - <MASK><NEW_LINE>if (slope > 0) {<NEW_LINE>// <==> x1 < x2<NEW_LINE>if (x1 < edgeMinX) {<NEW_LINE>edgeMinX = x1;<NEW_LINE>}<NEW_LINE>if (x2 > edgeMaxX) {<NEW_LINE>edgeMaxX = x2;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (x2 < edgeMinX) {<NEW_LINE>edgeMinX = x2;<NEW_LINE>}<NEW_LINE>if (x1 > edgeMaxX) {<NEW_LINE>edgeMaxX = x1;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final int ptr = numEdges * SIZEOF_EDGE;<NEW_LINE>edges = Helpers.widenArray(edges, ptr, SIZEOF_EDGE);<NEW_LINE>numEdges++;<NEW_LINE>edges[ptr + OR] = or;<NEW_LINE>edges[ptr + CURX] = x1 + (firstCrossing - y1) * slope;<NEW_LINE>edges[ptr + SLOPE] = slope;<NEW_LINE>edges[ptr + YMAX] = lastCrossing;<NEW_LINE>final int bucketIdx = firstCrossing - boundsMinY;<NEW_LINE>addEdgeToBucket(ptr, bucketIdx);<NEW_LINE>edgeBucketCounts[lastCrossing - boundsMinY] |= 1;<NEW_LINE>} | x1) / (y2 - y1); |
955,854 | public void testJSAD_Receive_Message_P2PTest(HttpServletRequest request, HttpServletResponse response) throws Exception {<NEW_LINE>boolean testFailed = false;<NEW_LINE>QueueConnectionFactory cf1 = (QueueConnectionFactory) new InitialContext().lookup("java:comp/env/jndi_JMS_BASE_QCF");<NEW_LINE>QueueConnection con = cf1.createQueueConnection();<NEW_LINE>con.start();<NEW_LINE>QueueSession sessionSender = con.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);<NEW_LINE>Queue queue = sessionSender.createQueue("QUEUE1");<NEW_LINE>emptyQueue(cf1, queue);<NEW_LINE>QueueSender send = sessionSender.createSender(queue);<NEW_LINE>String outbound = "Hello World from testJSAD_Receive_Message_P2PTest";<NEW_LINE>send.setDeliveryDelay(1000);<NEW_LINE>send.send(sessionSender.createTextMessage(outbound));<NEW_LINE>Queue <MASK><NEW_LINE>QueueReceiver rec = sessionSender.createReceiver(queue1);<NEW_LINE>TextMessage receiveMsg = (TextMessage) rec.receive(30000);<NEW_LINE>String inbound = receiveMsg.getText();<NEW_LINE>if (!outbound.equals(inbound)) {<NEW_LINE>testFailed = true;<NEW_LINE>}<NEW_LINE>sessionSender.close();<NEW_LINE>con.close();<NEW_LINE>if (testFailed) {<NEW_LINE>throw new Exception("testJSAD_Receive_Message_P2PTest failed");<NEW_LINE>}<NEW_LINE>} | queue1 = sessionSender.createQueue("alias2Q1"); |
966,445 | public void invoke() {<NEW_LINE>super.start();<NEW_LINE>this.followOutput(new Slf4jLogConsumer(logger()));<NEW_LINE>// wait for the compose container to stop, which should only happen after it has spawned all the service containers<NEW_LINE>logger().info("Docker Compose container is running for command: {}", Joiner.on(" ").join(this.getCommandParts()));<NEW_LINE>while (this.isRunning()) {<NEW_LINE><MASK><NEW_LINE>Uninterruptibles.sleepUninterruptibly(100, TimeUnit.MILLISECONDS);<NEW_LINE>}<NEW_LINE>logger().info("Docker Compose has finished running");<NEW_LINE>AuditLogger.doComposeLog(this.getCommandParts(), this.getEnv());<NEW_LINE>final Integer exitCode = this.dockerClient.inspectContainerCmd(getContainerId()).exec().getState().getExitCode();<NEW_LINE>if (exitCode == null || exitCode != 0) {<NEW_LINE>throw new ContainerLaunchException("Containerised Docker Compose exited abnormally with code " + exitCode + " whilst running command: " + StringUtils.join(this.getCommandParts(), ' '));<NEW_LINE>}<NEW_LINE>} | logger().trace("Compose container is still running"); |
1,550,199 | private Map<String, Library> _findLibraries() {<NEW_LINE>// use this module classloader<NEW_LINE>ClassLoader originalLoader = this.getClass().getClassLoader();<NEW_LINE>// NOI18N<NEW_LINE>LOGGER.// NOI18N<NEW_LINE>log(// NOI18N<NEW_LINE>Level.FINE, // NOI18N<NEW_LINE>"Scanning facelets libraries, current classloader class={0}, " + "the used URLClassLoader will also contain following roots:", originalLoader.getClass().getName());<NEW_LINE>Collection<URL> urlsToLoad = new ArrayList<>();<NEW_LINE>for (FileObject cpRoot : getJsfSupport().getClassPath().getRoots()) {<NEW_LINE>try {<NEW_LINE>// exclude the jsf jars from the classpath, if jsf20 library is available,<NEW_LINE>// we'll use the jars from the netbeans library instead<NEW_LINE>// any better way?<NEW_LINE>String fsName = cpRoot.getFileSystem().getDisplayName();<NEW_LINE>if (!fsName.endsWith("javax.faces.jar")) {<NEW_LINE>// NOI18N<NEW_LINE>urlsToLoad.add(URLMapper.findURL(cpRoot, URLMapper.INTERNAL));<NEW_LINE>// NOI18N<NEW_LINE>LOGGER.log(Level.FINE, "+++{0}", cpRoot);<NEW_LINE>} else {<NEW_LINE>// NOI18N<NEW_LINE>LOGGER.log(Level.FINE, "---{0}", cpRoot);<NEW_LINE>}<NEW_LINE>} catch (FileStateInvalidException ex) {<NEW_LINE>Exceptions.printStackTrace(ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ClassLoader proxyLoader = new URLClassLoader(urlsToLoad.toArray(new URL[] {}), originalLoader) {<NEW_LINE><NEW_LINE>// prevent services loading from mojarra's sources<NEW_LINE>@Override<NEW_LINE>public URL findResource(String name) {<NEW_LINE>// NOI18N<NEW_LINE>return name.startsWith("META-INF/services") ? <MASK><NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Enumeration<URL> findResources(String name) throws IOException {<NEW_LINE>if (name.startsWith("META-INF/services")) {<NEW_LINE>// NOI18N<NEW_LINE>return Collections.enumeration(Collections.<URL>emptyList());<NEW_LINE>} else {<NEW_LINE>return super.findResources(name);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>ClassLoader originalContextClassLoader = Thread.currentThread().getContextClassLoader();<NEW_LINE>try {<NEW_LINE>Thread.currentThread().setContextClassLoader(proxyLoader);<NEW_LINE>// do the parse<NEW_LINE>return parseLibraries();<NEW_LINE>} finally {<NEW_LINE>// reset the original loader<NEW_LINE>Thread.currentThread().setContextClassLoader(originalContextClassLoader);<NEW_LINE>}<NEW_LINE>} | null : super.findResource(name); |
487,562 | public boolean isReady() {<NEW_LINE>// sort of suboptional to have the isReady method to duplicate the checks in updateNotifications();<NEW_LINE>String name = nameField.getText();<NEW_LINE>if (name != null) {<NEW_LINE>if (name.trim().length() <= 0 || name.trim().length() >= MAX_NAME) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (name.equalsIgnoreCase(NONE_GOUP)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>for (Group group : Group.allGroups()) {<NEW_LINE>if (name.equalsIgnoreCase(group.getName())) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (subprojectsKindRadio.isSelected()) {<NEW_LINE><MASK><NEW_LINE>if (s != null && s.length() > 0) {<NEW_LINE>File f = FileUtil.normalizeFile(new File(s));<NEW_LINE>FileObject fo = FileUtil.toFileObject(f);<NEW_LINE>if (fo != null && fo.isFolder()) {<NEW_LINE>try {<NEW_LINE>return ProjectManager.getDefault().findProject(fo) != null;<NEW_LINE>} catch (IOException x) {<NEW_LINE>Exceptions.printStackTrace(x);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} else if (directoryKindRadio.isSelected()) {<NEW_LINE>String s = directoryField.getText();<NEW_LINE>if (s != null) {<NEW_LINE>return new File(s.trim()).isDirectory();<NEW_LINE>} else {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | String s = masterProjectField.getText(); |
293,296 | protected void initTree() {<NEW_LINE>myTree.getSelectionModel().addTreeSelectionListener(new TreeSelectionListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void valueChanged(TreeSelectionEvent e) {<NEW_LINE>final TreePath path = e.getOldLeadSelectionPath();<NEW_LINE>if (path != null) {<NEW_LINE>final MyNode node = (MyNode) path.getLastPathComponent();<NEW_LINE>final MasterDetailsConfigurable namedConfigurable = node.getConfigurable();<NEW_LINE>if (namedConfigurable instanceof ScopeConfigurable) {<NEW_LINE>((ScopeConfigurable) namedConfigurable).cancelCurrentProgress();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>super.initTree();<NEW_LINE>myTree.setShowsRootHandles(false);<NEW_LINE>new TreeSpeedSearch(myTree, new Convertor<TreePath, String>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String convert(final TreePath treePath) {<NEW_LINE>return ((MyNode) treePath.<MASK><NEW_LINE>}<NEW_LINE>}, true);<NEW_LINE>myTree.getEmptyText().setText(IdeBundle.message("scopes.no.scoped"));<NEW_LINE>} | getLastPathComponent()).getDisplayName(); |
994,415 | void sendHeartbeatSync(Node node) {<NEW_LINE>HeartbeatHandler heartbeatHandler = new HeartbeatHandler(localMember, node);<NEW_LINE>HeartBeatRequest req = new HeartBeatRequest();<NEW_LINE>req.setCommitLogTerm(request.commitLogTerm);<NEW_LINE>req.setCommitLogIndex(request.commitLogIndex);<NEW_LINE>req.setRegenerateIdentifier(request.regenerateIdentifier);<NEW_LINE><MASK><NEW_LINE>req.setTerm(request.term);<NEW_LINE>req.setLeader(localMember.getThisNode());<NEW_LINE>if (request.isSetHeader()) {<NEW_LINE>req.setHeader(request.header);<NEW_LINE>}<NEW_LINE>if (request.isSetPartitionTableBytes()) {<NEW_LINE>req.partitionTableBytes = request.partitionTableBytes;<NEW_LINE>req.setPartitionTableBytesIsSet(true);<NEW_LINE>}<NEW_LINE>localMember.getSerialToParallelPool().submit(() -> {<NEW_LINE>Client client = localMember.getSyncHeartbeatClient(node);<NEW_LINE>if (client != null) {<NEW_LINE>try {<NEW_LINE>logger.debug("{}: Sending heartbeat to {}", memberName, node);<NEW_LINE>HeartBeatResponse heartBeatResponse = client.sendHeartbeat(req);<NEW_LINE>heartbeatHandler.onComplete(heartBeatResponse);<NEW_LINE>} catch (TTransportException e) {<NEW_LINE>if (ClusterIoTDB.getInstance().shouldPrintClientConnectionErrorStack()) {<NEW_LINE>logger.warn("{}: Cannot send heartbeat to node {} due to network", memberName, node, e);<NEW_LINE>} else {<NEW_LINE>logger.warn("{}: Cannot send heartbeat to node {} due to network", memberName, node);<NEW_LINE>}<NEW_LINE>client.getInputProtocol().getTransport().close();<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.warn(memberName + ": Cannot send heart beat to node " + node.toString(), e);<NEW_LINE>} finally {<NEW_LINE>localMember.returnSyncClient(client);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | req.setRequireIdentifier(request.requireIdentifier); |
1,392,683 | public void animatePositionGeo(final Point3d targetGeoLoc, final Point2d offset, Double hdg, final double howLong) {<NEW_LINE>if (!isCompletelySetup()) {<NEW_LINE>if (!rendererAttached) {<NEW_LINE>addPostSurfaceRunnable(() -> animatePositionGeo(targetGeoLoc, offset, hdg, howLong));<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>globeView.cancelAnimation();<NEW_LINE>CoordSystemDisplayAdapter coordAdapter = globeView.coordAdapter;<NEW_LINE>CoordSystem coordSys = (coordAdapter != null) ? coordAdapter.coordSys : null;<NEW_LINE>if (coordSys == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Matrix4d matrix = globeView.calcModelViewMatrix();<NEW_LINE>int[] frameBufSizeArr = getFrameBufferSize();<NEW_LINE>if (frameBufSizeArr == null || frameBufSizeArr.length != 2) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Point2d frameSize = new Point2d(frameBufSizeArr[0], frameBufSizeArr[1]);<NEW_LINE>Point2d localOffset = frameSize.multiplyBy(0.5);<NEW_LINE>if (offset != null) {<NEW_LINE>localOffset = localOffset.addTo(offset.multiplyBy(-1));<NEW_LINE>}<NEW_LINE>// check that the offset is actually within the globe, or we can't do it anyway<NEW_LINE>Point3d offsetLoc = globeView.pointOnSphereFromScreen(localOffset, matrix, frameSize, true);<NEW_LINE>if (offsetLoc == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Point3d destPt = coordAdapter.localToDisplay(coordSys.geographicToLocal(targetGeoLoc));<NEW_LINE>Quaternion newRotQuat = globeView.getRotQuat().multiply(<MASK><NEW_LINE>if (newRotQuat != null && globeView.northUp) {<NEW_LINE>// See where the north pole is going.<NEW_LINE>Point3d northPole = newRotQuat.multiply(new Point3d(0, 0, 1)).normalized();<NEW_LINE>if (northPole.getY() != 0.0) {<NEW_LINE>// Not straight up, rotate it back to vertical.<NEW_LINE>final double angle = Math.atan(northPole.getX() / northPole.getY()) + ((northPole.getY() < 0) ? Math.PI : 0);<NEW_LINE>newRotQuat = newRotQuat.multiply(new AngleAxis(angle, destPt));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (newRotQuat != null) {<NEW_LINE>globeView.setAnimationDelegate(new GlobeAnimateRotation(globeView, renderControl, newRotQuat, targetGeoLoc.getZ(), hdg, howLong, zoomAnimationEasing));<NEW_LINE>}<NEW_LINE>} | new Quaternion(destPt, offsetLoc)); |
715,316 | ActionResult<Wo> execute(EffectivePerson effectivePerson, String flag, JsonElement jsonElement) throws Exception {<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>ActionResult<Wo> result = new ActionResult<>();<NEW_LINE>Wi wi = this.convertToWrapIn(jsonElement, Wi.class);<NEW_LINE>Business business = new Business(emc);<NEW_LINE>Application application = emc.flag(wi.getApplication(), Application.class);<NEW_LINE>if (null == application) {<NEW_LINE>throw new ExceptionEntityNotExist(wi.getApplication(), Application.class);<NEW_LINE>}<NEW_LINE>if (!business.editable(effectivePerson, application)) {<NEW_LINE>throw new ExceptionAccessDenied(effectivePerson.getDistinguishedName());<NEW_LINE>}<NEW_LINE>if (StringUtils.isNotEmpty(wi.getProcess())) {<NEW_LINE>Process process = emc.flag(wi.getProcess(), Process.class);<NEW_LINE>if (null == process) {<NEW_LINE>throw new ExceptionEntityNotExist(wi.getProcess(), Process.class);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Mapping mapping = emc.flag(flag, Mapping.class);<NEW_LINE>Wi.copier.copy(wi, mapping);<NEW_LINE>this.empty(mapping);<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>Class.forName(DynamicEntity.CLASS_PACKAGE + "." + mapping.getTableName());<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new ExceptionDynamicClassNotExist(mapping.getTableName());<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>gson.fromJson(mapping.getData(), new TypeToken<List<Mapping.Item>>() {<NEW_LINE>}.getType());<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new ExceptionDataError();<NEW_LINE>}<NEW_LINE>emc.beginTransaction(Mapping.class);<NEW_LINE>emc.check(mapping, CheckPersistType.all);<NEW_LINE>emc.commit();<NEW_LINE>CacheManager.notify(Mapping.class);<NEW_LINE>Wo wo = new Wo();<NEW_LINE>wo.setId(mapping.getId());<NEW_LINE>result.setData(wo);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>} | this.duplicate(business, mapping); |
1,365,511 | public static void main(String[] args) {<NEW_LINE>Exercise33_ShortestPathInAGrid shortestPathInAGrid = new Exercise33_ShortestPathInAGrid();<NEW_LINE>StdOut.println("Moving either up, down, left or right:");<NEW_LINE>double[][] matrix1 = { { 0, 1 }, { 3, 1 } };<NEW_LINE>StdOut.print("Path: ");<NEW_LINE>Iterable<DirectedEdge> shortestPath1 = shortestPathInAGrid.shortestPathInGridAll4Directions(matrix1);<NEW_LINE>for (DirectedEdge edge : shortestPath1) {<NEW_LINE>StdOut.print(edge.from() + "->" + edge.to() + " ");<NEW_LINE>}<NEW_LINE>StdOut.println("\nExpected: 0->1 1->3");<NEW_LINE>double[][] matrix2 = { { 0, 2, 1 }, { 1, 3, 2 }, { 4, 2, 5 } };<NEW_LINE>StdOut.print("\nPath: ");<NEW_LINE>Iterable<DirectedEdge> shortestPath2 = shortestPathInAGrid.shortestPathInGridAll4Directions(matrix2);<NEW_LINE>for (DirectedEdge edge : shortestPath2) {<NEW_LINE>StdOut.print(edge.from() + "->" + edge.to() + " ");<NEW_LINE>}<NEW_LINE>StdOut.println("\nExpected: 0->1 1->2 2->5 5->8");<NEW_LINE>double[][] matrix3 = { { 0, 4, 10, 10, 10 }, { 1, 8, 1, 1, 1 }, { 1, 8, 1, 10, 1 }, { 1, 1, 1, 10, 1 }, { 10, 10, 10, 10, 2 } };<NEW_LINE>StdOut.print("\nPath: ");<NEW_LINE>Iterable<DirectedEdge> <MASK><NEW_LINE>for (DirectedEdge edge : shortestPath3) {<NEW_LINE>StdOut.print(edge.from() + "->" + edge.to() + " ");<NEW_LINE>}<NEW_LINE>StdOut.println("\nExpected: 0->5 5->10 10->15 15->16 16->17 17->12 12->7 7->8 8->9 9->14 14->19 19->24");<NEW_LINE>StdOut.println("\nMoving only right and down:");<NEW_LINE>StdOut.print("Path: ");<NEW_LINE>Iterable<DirectedEdge> shortestPath4 = shortestPathInAGrid.shortestPathInGridOnlyRightOrDown(matrix3);<NEW_LINE>for (DirectedEdge edge : shortestPath4) {<NEW_LINE>StdOut.print(edge.from() + "->" + edge.to() + " ");<NEW_LINE>}<NEW_LINE>StdOut.println("\nExpected: 0->5 5->6 6->7 7->8 8->9 9->14 14->19 19->24");<NEW_LINE>} | shortestPath3 = shortestPathInAGrid.shortestPathInGridAll4Directions(matrix3); |
1,465,835 | public JComponent createComponent(@Nonnull ExternalModuleImportContext<C> context, @Nonnull Disposable uiDisposable) {<NEW_LINE>if (myComponent != null) {<NEW_LINE>return myComponent;<NEW_LINE>}<NEW_LINE>myControl = context.getImportProvider().getControl();<NEW_LINE>myComponent = new PaintAwarePanel(new GridBagLayout());<NEW_LINE>AbstractExternalModuleImportProvider<C> provider = context.getImportProvider();<NEW_LINE>ProjectSystemId externalSystemId = provider.getExternalSystemId();<NEW_LINE>JLabel linkedProjectPathLabel = new JLabel(ExternalSystemBundle.message("settings.label.select.project", externalSystemId.getReadableName()));<NEW_LINE>ExternalSystemManager<?, ?, ?, ?, ?> manager = ExternalSystemApiUtil.getManager(externalSystemId);<NEW_LINE>assert manager != null;<NEW_LINE><MASK><NEW_LINE>myLinkedProjectPathField = new TextFieldWithBrowseButton();<NEW_LINE>myLinkedProjectPathField.addBrowseFolderListener("", ExternalSystemBundle.message("settings.label.select.project", externalSystemId.getReadableName()), null, fileChooserDescriptor, TextComponentAccessor.TEXT_FIELD_WHOLE_TEXT);<NEW_LINE>myLinkedProjectPathField.getTextField().getDocument().addDocumentListener(new DocumentListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void insertUpdate(DocumentEvent e) {<NEW_LINE>myControl.onLinkedProjectPathChange(myLinkedProjectPathField.getText());<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void removeUpdate(DocumentEvent e) {<NEW_LINE>myControl.onLinkedProjectPathChange(myLinkedProjectPathField.getText());<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void changedUpdate(DocumentEvent e) {<NEW_LINE>myControl.onLinkedProjectPathChange(myLinkedProjectPathField.getText());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>myComponent.add(linkedProjectPathLabel, ExternalSystemUiUtil.getLabelConstraints(0));<NEW_LINE>myComponent.add(myLinkedProjectPathField, ExternalSystemUiUtil.getFillLineConstraints(0));<NEW_LINE>ExternalSystemSettingsControl projectSettings = myControl.getProjectSettingsControl();<NEW_LINE>projectSettings.fillUi(uiDisposable, myComponent, 0);<NEW_LINE>ExternalSystemSettingsControl systemSettingsControl = myControl.getSystemSettingsControl();<NEW_LINE>if (systemSettingsControl != null) {<NEW_LINE>systemSettingsControl.fillUi(uiDisposable, myComponent, 0);<NEW_LINE>}<NEW_LINE>ExternalSystemUiUtil.fillBottom(myComponent);<NEW_LINE>String path = context.getPath();<NEW_LINE>myControl.getProjectSettings().setExternalProjectPath(path);<NEW_LINE>myLinkedProjectPathField.setText(path);<NEW_LINE>provider.doPrepare(context);<NEW_LINE>projectSettings.reset();<NEW_LINE>if (systemSettingsControl != null) {<NEW_LINE>systemSettingsControl.reset();<NEW_LINE>}<NEW_LINE>return myComponent;<NEW_LINE>} | FileChooserDescriptor fileChooserDescriptor = manager.getExternalProjectDescriptor(); |
614,416 | protected TableViewSWT<PEPiece> initYourTableView(String table_id) {<NEW_LINE>if (table_id == TableManager.TABLE_TORRENT_PIECES) {<NEW_LINE>tv = TableViewFactory.createTableViewSWT(PLUGIN_DS_TYPE, TableManager.TABLE_TORRENT_PIECES, getPropertiesPrefix(), basicItems, basicItems[0].getName(), SWT.SINGLE | SWT.FULL_SELECTION | SWT.VIRTUAL);<NEW_LINE>} else {<NEW_LINE>TableColumnCore[] items = getBasicColumnItems(TableManager.TABLE_ALL_PIECES);<NEW_LINE>TableColumnCore[] basicItems = new TableColumnCore[items.length + 1];<NEW_LINE>System.arraycopy(items, 0, <MASK><NEW_LINE>basicItems[items.length] = new DownloadNameItem(TableManager.TABLE_ALL_PIECES);<NEW_LINE>TableColumnManager tcManager = TableColumnManager.getInstance();<NEW_LINE>tcManager.setDefaultColumnNames(TableManager.TABLE_ALL_PIECES, basicItems);<NEW_LINE>// PEPiece subviews assume single download<NEW_LINE>tv = // PEPiece subviews assume single download<NEW_LINE>TableViewFactory.// PEPiece subviews assume single download<NEW_LINE>createTableViewSWT(PEPiece[].class, TableManager.TABLE_ALL_PIECES, getPropertiesPrefix(), basicItems, basicItems[0].getName(), SWT.SINGLE | SWT.FULL_SELECTION | SWT.VIRTUAL);<NEW_LINE>}<NEW_LINE>if (bubbleTextBox != null) {<NEW_LINE>tv.enableFilterCheck(bubbleTextBox, this);<NEW_LINE>}<NEW_LINE>registerPluginViews();<NEW_LINE>tv.addMenuFillListener(this);<NEW_LINE>tv.addLifeCycleListener(this);<NEW_LINE>tv.addSelectionListener(this, false);<NEW_LINE>return tv;<NEW_LINE>} | basicItems, 0, items.length); |
99,071 | public ListArchiveRulesResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ListArchiveRulesResult listArchiveRulesResult = new ListArchiveRulesResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return listArchiveRulesResult;<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("archiveRules", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listArchiveRulesResult.setArchiveRules(new ListUnmarshaller<ArchiveRuleSummary>(ArchiveRuleSummaryJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("nextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listArchiveRulesResult.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 listArchiveRulesResult;<NEW_LINE>} | JsonToken token = context.getCurrentToken(); |
1,816,969 | public void writeRecords(final List<? extends OIdentifiable> resultSet, final int limit, final OCallable<Object, OIdentifiable> iAfterDump) {<NEW_LINE>final Map<String, Integer> columns = parseColumns(resultSet, limit);<NEW_LINE>if (columnSorting != null) {<NEW_LINE>Collections.sort(resultSet, new Comparator<Object>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public int compare(final Object o1, final Object o2) {<NEW_LINE>final ODocument doc1 = ((OIdentifiable) o1).getRecord();<NEW_LINE>final ODocument doc2 = ((<MASK><NEW_LINE>final Object value1 = doc1.field(columnSorting.getKey());<NEW_LINE>final Object value2 = doc2.field(columnSorting.getKey());<NEW_LINE>final boolean ascending = columnSorting.getValue();<NEW_LINE>final int result;<NEW_LINE>if (value2 == null)<NEW_LINE>result = 1;<NEW_LINE>else if (value1 == null)<NEW_LINE>result = 0;<NEW_LINE>else if (value1 instanceof Comparable)<NEW_LINE>result = ((Comparable) value1).compareTo(value2);<NEW_LINE>else<NEW_LINE>result = value1.toString().compareTo(value2.toString());<NEW_LINE>return ascending ? result : result * -1;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>int fetched = 0;<NEW_LINE>for (OIdentifiable record : resultSet) {<NEW_LINE>dumpRecordInTable(fetched++, record, columns);<NEW_LINE>if (iAfterDump != null)<NEW_LINE>iAfterDump.call(record);<NEW_LINE>if (limit > -1 && fetched >= limit) {<NEW_LINE>printHeaderLine(columns);<NEW_LINE>out.onMessage("\nLIMIT EXCEEDED: resultset contains more items not displayed (limit=" + limit + ")");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (fetched > 0)<NEW_LINE>printHeaderLine(columns);<NEW_LINE>if (footer != null) {<NEW_LINE>dumpRecordInTable(-1, footer, columns);<NEW_LINE>printHeaderLine(columns);<NEW_LINE>}<NEW_LINE>} | OIdentifiable) o2).getRecord(); |
1,511,098 | public void writeToText(TextWriterStream out, String label) {<NEW_LINE>if (label != null) {<NEW_LINE>out.commentPrintLn(label);<NEW_LINE>}<NEW_LINE>out.commentPrintLn("Model class: " + <MASK><NEW_LINE>out.commentPrintLn("Centroid: " + FormatUtil.format(getPrototype()));<NEW_LINE>out.commentPrintLn("Strong Eigenvectors:");<NEW_LINE>String strong = FormatUtil.format(getPCAResult().getStrongEigenvectors());<NEW_LINE>while (strong.endsWith("\n")) {<NEW_LINE>strong = strong.substring(0, strong.length() - 1);<NEW_LINE>}<NEW_LINE>out.commentPrintLn(strong);<NEW_LINE>out.commentPrintLn("Weak Eigenvectors:");<NEW_LINE>String weak = FormatUtil.format(getPCAResult().getWeakEigenvectors());<NEW_LINE>while (weak.endsWith("\n")) {<NEW_LINE>weak = weak.substring(0, weak.length() - 1);<NEW_LINE>}<NEW_LINE>out.commentPrintLn(weak);<NEW_LINE>out.commentPrintLn("Eigenvalues: " + FormatUtil.format(getPCAResult().getEigenvalues()));<NEW_LINE>} | getClass().getName()); |
1,644,317 | private OrderLineCandidate toOrderLineCandidate(final QuickInput quickInput) {<NEW_LINE>final IOrderLineQuickInput orderLineQuickInput = quickInput.getQuickInputDocumentAs(IOrderLineQuickInput.class);<NEW_LINE>// Validate quick input:<NEW_LINE>final BigDecimal quickInputQty = orderLineQuickInput.getQty();<NEW_LINE>if (quickInputQty == null || quickInputQty.signum() <= 0) {<NEW_LINE>logger.<MASK><NEW_LINE>// TODO trl<NEW_LINE>throw new AdempiereException("Qty shall be greather than zero");<NEW_LINE>}<NEW_LINE>final I_C_Order order = quickInput.getRootDocumentAs(I_C_Order.class);<NEW_LINE>final OrderId orderId = OrderId.ofRepoId(order.getC_Order_ID());<NEW_LINE>final BPartnerId bpartnerId = BPartnerId.ofRepoIdOrNull(order.getC_BPartner_ID());<NEW_LINE>final ProductAndAttributes productAndAttributes = ProductLookupDescriptor.toProductAndAttributes(orderLineQuickInput.getM_Product_ID());<NEW_LINE>final UomId uomId = productBL.getStockUOMId(productAndAttributes.getProductId());<NEW_LINE>return OrderLineCandidate.builder().orderId(orderId).productId(productAndAttributes.getProductId()).attributes(productAndAttributes.getAttributes()).piItemProductId(HUPIItemProductId.ofRepoIdOrNull(orderLineQuickInput.getM_HU_PI_Item_Product_ID())).qty(Quantitys.create(quickInputQty, uomId)).bestBeforePolicy(ShipmentAllocationBestBeforePolicy.ofNullableCode(orderLineQuickInput.getShipmentAllocation_BestBefore_Policy())).bpartnerId(bpartnerId).soTrx(SOTrx.ofBoolean(order.isSOTrx())).build();<NEW_LINE>} | warn("Invalid Qty={} for {}", quickInputQty, orderLineQuickInput); |
1,656,326 | public void marshall(StartChildWorkflowExecutionInitiatedEventAttributes startChildWorkflowExecutionInitiatedEventAttributes, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (startChildWorkflowExecutionInitiatedEventAttributes == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(startChildWorkflowExecutionInitiatedEventAttributes.getWorkflowId(), WORKFLOWID_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(startChildWorkflowExecutionInitiatedEventAttributes.getControl(), CONTROL_BINDING);<NEW_LINE>protocolMarshaller.marshall(startChildWorkflowExecutionInitiatedEventAttributes.getInput(), INPUT_BINDING);<NEW_LINE>protocolMarshaller.marshall(startChildWorkflowExecutionInitiatedEventAttributes.getExecutionStartToCloseTimeout(), EXECUTIONSTARTTOCLOSETIMEOUT_BINDING);<NEW_LINE>protocolMarshaller.marshall(startChildWorkflowExecutionInitiatedEventAttributes.getTaskList(), TASKLIST_BINDING);<NEW_LINE>protocolMarshaller.marshall(startChildWorkflowExecutionInitiatedEventAttributes.getTaskPriority(), TASKPRIORITY_BINDING);<NEW_LINE>protocolMarshaller.marshall(startChildWorkflowExecutionInitiatedEventAttributes.getDecisionTaskCompletedEventId(), DECISIONTASKCOMPLETEDEVENTID_BINDING);<NEW_LINE>protocolMarshaller.marshall(startChildWorkflowExecutionInitiatedEventAttributes.getChildPolicy(), CHILDPOLICY_BINDING);<NEW_LINE>protocolMarshaller.marshall(startChildWorkflowExecutionInitiatedEventAttributes.getTaskStartToCloseTimeout(), TASKSTARTTOCLOSETIMEOUT_BINDING);<NEW_LINE>protocolMarshaller.marshall(startChildWorkflowExecutionInitiatedEventAttributes.getTagList(), TAGLIST_BINDING);<NEW_LINE>protocolMarshaller.marshall(startChildWorkflowExecutionInitiatedEventAttributes.getLambdaRole(), LAMBDAROLE_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | startChildWorkflowExecutionInitiatedEventAttributes.getWorkflowType(), WORKFLOWTYPE_BINDING); |
649,320 | public File[] makeZipFile(String filename) {<NEW_LINE>File indexFile = null;<NEW_LINE>File stackFile = null;<NEW_LINE>ZipOutputStream zos = null;<NEW_LINE>File zipFile = new File(filename + ".zip");<NEW_LINE>try {<NEW_LINE>zos = new ZipOutputStream(new BufferedOutputStream(new FileOutputStream(zipFile)));<NEW_LINE>zos.setLevel(9);<NEW_LINE>// Index file<NEW_LINE>indexFile <MASK><NEW_LINE>if (!indexFile.exists()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>ZipFileUtil.sendZipFile(zos, indexFile);<NEW_LINE>// stack log file<NEW_LINE>stackFile = new File(filename + ".log");<NEW_LINE>if (!stackFile.exists()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>ZipFileUtil.sendZipFile(zos, stackFile);<NEW_LINE>zos.flush();<NEW_LINE>} catch (Exception ex) {<NEW_LINE>ex.printStackTrace();<NEW_LINE>return null;<NEW_LINE>} finally {<NEW_LINE>if (zos != null) {<NEW_LINE>try {<NEW_LINE>zos.close();<NEW_LINE>} catch (Exception ex) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>File[] files = new File[3];<NEW_LINE>files[0] = zipFile;<NEW_LINE>files[1] = indexFile;<NEW_LINE>files[2] = stackFile;<NEW_LINE>return files;<NEW_LINE>} | = new File(filename + ".inx"); |
1,545,088 | public Object createGeospatialQuery(String geolocationColumnName, Object shape, Object query) {<NEW_LINE>Circle circle = (Circle) shape;<NEW_LINE>List circleList = new ArrayList();<NEW_LINE>// Centre<NEW_LINE>circleList.add(new double[] { circle.getCentre().x, circle<MASK><NEW_LINE>// of<NEW_LINE>// circle<NEW_LINE>// Radius<NEW_LINE>circleList.add(circle.getRadius());<NEW_LINE>BasicDBObject q = (BasicDBObject) query;<NEW_LINE>if (q == null)<NEW_LINE>q = new BasicDBObject();<NEW_LINE>if (circle.getSurfaceType().equals(SurfaceType.SPHERICAL)) {<NEW_LINE>q.put(geolocationColumnName, new BasicDBObject("$geoWithin", new BasicDBObject("$centerSphere", circleList)));<NEW_LINE>} else {<NEW_LINE>q.put(geolocationColumnName, new BasicDBObject("$geoWithin", new BasicDBObject("$center", circleList)));<NEW_LINE>}<NEW_LINE>return q;<NEW_LINE>} | .getCentre().y }); |
103,524 | private static void addFixedSplit(final List<Integer> splitPoints, final List<GenomeLoc> locs, final long locsSize, final int startIndex, final int stopIndex, final int numParts) {<NEW_LINE><MASK><NEW_LINE>if (numParts < 2) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final int halfParts = (numParts + 1) / 2;<NEW_LINE>final Pair<Integer, Long> splitPoint = getFixedSplit(locs, locsSize, startIndex, stopIndex, halfParts, numParts - halfParts);<NEW_LINE>final int splitIndex = splitPoint.getLeft();<NEW_LINE>final long splitSize = splitPoint.getRight();<NEW_LINE>splitPoints.add(splitIndex);<NEW_LINE>addFixedSplit(splitPoints, locs, splitSize, startIndex, splitIndex, halfParts);<NEW_LINE>addFixedSplit(splitPoints, locs, locsSize - splitSize, splitIndex, stopIndex, numParts - halfParts);<NEW_LINE>} | Utils.nonNull(splitPoints, "splitPoints is null"); |
171,086 | public void show(View anchor, float anchorOverlap) {<NEW_LINE>updateItems();<NEW_LINE>if (mSystemUiVisibilityHelper != null)<NEW_LINE><MASK><NEW_LINE>// don't steal the focus, this will prevent the keyboard from changing<NEW_LINE>setFocusable(false);<NEW_LINE>// draw over stuff if needed<NEW_LINE>setClippingEnabled(false);<NEW_LINE>final Rect displayFrame = new Rect();<NEW_LINE>anchor.getWindowVisibleDisplayFrame(displayFrame);<NEW_LINE>final int[] anchorPos = new int[2];<NEW_LINE>anchor.getLocationOnScreen(anchorPos);<NEW_LINE>final int distanceToBottom = displayFrame.bottom - (anchorPos[1] + anchor.getHeight());<NEW_LINE>final int distanceToTop = anchorPos[1] - displayFrame.top;<NEW_LINE>LinearLayout linearLayout = getLinearLayout();<NEW_LINE>linearLayout.measure(View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED), View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED));<NEW_LINE>setWidth(linearLayout.getMeasuredWidth());<NEW_LINE>int xOffset = anchorPos[0] + anchor.getPaddingLeft();<NEW_LINE>if (xOffset + linearLayout.getMeasuredWidth() > displayFrame.right)<NEW_LINE>xOffset = displayFrame.right - linearLayout.getMeasuredWidth();<NEW_LINE>int overlapAmount = (int) (anchor.getHeight() * anchorOverlap);<NEW_LINE>int yOffset;<NEW_LINE>if (distanceToBottom > linearLayout.getMeasuredHeight()) {<NEW_LINE>// show below anchor<NEW_LINE>yOffset = anchorPos[1] + overlapAmount;<NEW_LINE>setAnimationStyle(R.style.PopupAnimationTop);<NEW_LINE>} else if (distanceToTop > distanceToBottom) {<NEW_LINE>// show above anchor<NEW_LINE>yOffset = anchorPos[1] + overlapAmount - linearLayout.getMeasuredHeight();<NEW_LINE>setAnimationStyle(R.style.PopupAnimationBottom);<NEW_LINE>if (distanceToTop < linearLayout.getMeasuredHeight()) {<NEW_LINE>// enable scroll<NEW_LINE>setHeight(distanceToTop + overlapAmount);<NEW_LINE>yOffset += linearLayout.getMeasuredHeight() - distanceToTop - overlapAmount;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// show below anchor with scroll<NEW_LINE>yOffset = anchorPos[1] + overlapAmount;<NEW_LINE>setAnimationStyle(R.style.PopupAnimationTop);<NEW_LINE>setHeight(distanceToBottom + overlapAmount);<NEW_LINE>}<NEW_LINE>showAtLocation(anchor, Gravity.START | Gravity.TOP, xOffset, yOffset);<NEW_LINE>} | mSystemUiVisibilityHelper.copyVisibility(getContentView()); |
1,842,898 | final UpdateRulesOfIpGroupResult executeUpdateRulesOfIpGroup(UpdateRulesOfIpGroupRequest updateRulesOfIpGroupRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateRulesOfIpGroupRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateRulesOfIpGroupRequest> request = null;<NEW_LINE>Response<UpdateRulesOfIpGroupResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new UpdateRulesOfIpGroupRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateRulesOfIpGroupRequest));<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, "WorkSpaces");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateRulesOfIpGroup");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateRulesOfIpGroupResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateRulesOfIpGroupResultJsonUnmarshaller());<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); |
401,075 | public void bindViewHolder(FlexibleAdapter adapter, ViewHolder viewHolder, int position, List<Object> payloads) {<NEW_LINE>Context context = viewHolder.itemView.getContext();<NEW_LINE>viewHolder.accountColorIndicator.setBackgroundColor(getAccountColorIndicator());<NEW_LINE>viewHolder.accountColorIndicatorBack.setBackgroundColor(getAccountColorIndicatorBack());<NEW_LINE>final int[] accountGroupColors = context.getResources().getIntArray(getThemeResource(context, R.attr.contact_list_account_group_background));<NEW_LINE>final int level = AccountManager.getInstance().getColorLevel(getAccountJid());<NEW_LINE>viewHolder.backgroundView.setBackgroundColor(accountGroupColors[level]);<NEW_LINE>viewHolder.tvAccountName.setText(getName());<NEW_LINE>viewHolder.<MASK><NEW_LINE>Drawable offlineModeImage = context.getResources().getDrawable(R.drawable.ic_show_offline_small);<NEW_LINE>offlineModeImage.setLevel(getOfflineModeLevel());<NEW_LINE>viewHolder.tvContactCount.setCompoundDrawablesWithIntrinsicBounds(offlineModeImage, null, null, null);<NEW_LINE>String statusText = getStatus();<NEW_LINE>if (statusText.isEmpty())<NEW_LINE>statusText = context.getString(getStatusId());<NEW_LINE>viewHolder.tvStatus.setText(statusText);<NEW_LINE>if (SettingsManager.contactsShowAvatars()) {<NEW_LINE>viewHolder.ivAvatar.setVisibility(View.VISIBLE);<NEW_LINE>viewHolder.ivStatus.setVisibility(View.VISIBLE);<NEW_LINE>viewHolder.ivAvatar.setImageDrawable(getAvatar());<NEW_LINE>viewHolder.ivOnlyStatus.setVisibility(View.GONE);<NEW_LINE>} else {<NEW_LINE>viewHolder.ivAvatar.setVisibility(View.GONE);<NEW_LINE>viewHolder.ivStatus.setVisibility(View.GONE);<NEW_LINE>viewHolder.ivOnlyStatus.setVisibility(View.VISIBLE);<NEW_LINE>}<NEW_LINE>viewHolder.ivStatus.setImageLevel(getStatusLevel());<NEW_LINE>viewHolder.ivOnlyStatus.setImageLevel(getStatusLevel());<NEW_LINE>viewHolder.tvAccountName.setCompoundDrawablesWithIntrinsicBounds(null, null, isCustomNotification() ? context.getResources().getDrawable(R.drawable.ic_notif_custom) : null, null);<NEW_LINE>} | tvContactCount.setText(getContactCount()); |
40,832 | public Condition createPredicateReference(@Nullable DbColumn theSourceJoinColumn, String theResourceName, String theParamName, List<String> theQualifiers, List<? extends IQueryParameterType> theList, SearchFilterParser.CompareOperation theOperation, RequestDetails theRequest, RequestPartitionId theRequestPartitionId, SearchQueryBuilder theSqlBuilder) {<NEW_LINE>if ((theOperation != null) && (theOperation != SearchFilterParser.CompareOperation.eq) && (theOperation != SearchFilterParser.CompareOperation.ne)) {<NEW_LINE>throw new InvalidRequestException(Msg.code(1212) + "Invalid operator specified for reference predicate. Supported operators for reference predicate are \"eq\" and \"ne\".");<NEW_LINE>}<NEW_LINE>if (theList.get(0).getMissing() != null) {<NEW_LINE>SearchParamPresentPredicateBuilder join = theSqlBuilder.addSearchParamPresentPredicateBuilder(theSourceJoinColumn);<NEW_LINE>return join.createPredicateParamMissingForReference(theResourceName, theParamName, theList.get(0).getMissing(), theRequestPartitionId);<NEW_LINE>}<NEW_LINE>ResourceLinkPredicateBuilder predicateBuilder = createOrReusePredicateBuilder(PredicateBuilderTypeEnum.REFERENCE, theSourceJoinColumn, theParamName, () -> theSqlBuilder.addReferencePredicateBuilder(this, theSourceJoinColumn)).getResult();<NEW_LINE>return predicateBuilder.createPredicate(theRequest, theResourceName, theParamName, <MASK><NEW_LINE>} | theQualifiers, theList, theOperation, theRequestPartitionId); |
616,249 | @Nonnull<NEW_LINE>public EnumActionResult onItemUse(@Nonnull EntityPlayer player, @Nonnull World world, @Nonnull BlockPos pos, @Nonnull EnumHand hand, @Nonnull EnumFacing side, float hitX, float hitY, float hitZ) {<NEW_LINE>if (world.isRemote) {<NEW_LINE>return EnumActionResult.SUCCESS;<NEW_LINE>}<NEW_LINE>Block conduitBlock = Registry.getConduitBlock();<NEW_LINE>if (conduitBlock != null) {<NEW_LINE>ItemStack stack = player.getHeldItem(hand);<NEW_LINE>BlockPos <MASK><NEW_LINE>if (player.canPlayerEdit(placeAt, side, stack) && PaintUtil.getSourceBlock(stack) != null) {<NEW_LINE>if (world.isAirBlock(placeAt)) {<NEW_LINE>world.setBlockState(placeAt, conduitBlock.getDefaultState());<NEW_LINE>IConduitBundle bundle = NullHelper.notnullM((IConduitBundle) world.getTileEntity(placeAt), "placing block yielded no tileentity");<NEW_LINE>IBlockState bs = PaintUtil.getSourceBlock(stack);<NEW_LINE>bundle.setFacadeType(EnumFacadeType.getTypeFromMeta(stack.getItemDamage()));<NEW_LINE>bundle.setPaintSource(bs);<NEW_LINE>ConduitUtil.playPlaceSound(bs.getBlock().getSoundType(), world, pos);<NEW_LINE>if (!player.capabilities.isCreativeMode) {<NEW_LINE>stack.shrink(1);<NEW_LINE>}<NEW_LINE>return EnumActionResult.SUCCESS;<NEW_LINE>} else {<NEW_LINE>TileEntity tileEntity = world.getTileEntity(placeAt);<NEW_LINE>if (tileEntity instanceof IConduitBundle) {<NEW_LINE>if (((IConduitBundle) tileEntity).handleFacadeClick(world, placeAt, player, side.getOpposite(), stack, hand, hitX, hitY, hitZ)) {<NEW_LINE>return EnumActionResult.SUCCESS;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return EnumActionResult.PASS;<NEW_LINE>} | placeAt = pos.offset(side); |
1,068,621 | final ListWorkteamsResult executeListWorkteams(ListWorkteamsRequest listWorkteamsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listWorkteamsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListWorkteamsRequest> request = null;<NEW_LINE>Response<ListWorkteamsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListWorkteamsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listWorkteamsRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "SageMaker");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListWorkteams");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListWorkteamsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListWorkteamsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | HandlerContextKey.SIGNING_REGION, getSigningRegion()); |
1,846,593 | protected MultiGetShardResponse shardOperation(MultiGetShardRequest request, ShardId shardId) {<NEW_LINE>IndexService indexService = indicesService.indexServiceSafe(shardId.getIndex());<NEW_LINE>IndexShard indexShard = indexService.getShard(shardId.id());<NEW_LINE>if (request.refresh() && request.realtime() == false) {<NEW_LINE>indexShard.refresh("refresh_flag_mget");<NEW_LINE>}<NEW_LINE>MultiGetShardResponse response = new MultiGetShardResponse();<NEW_LINE>for (int i = 0; i < request.locations.size(); i++) {<NEW_LINE>MultiGetRequest.Item item = request.items.get(i);<NEW_LINE>try {<NEW_LINE>GetResult getResult = indexShard.getService().get(item.id(), item.storedFields(), request.realtime(), item.version(), item.versionType(), item.fetchSourceContext());<NEW_LINE>response.add(request.locations.get(i), new GetResponse(getResult));<NEW_LINE>} catch (RuntimeException e) {<NEW_LINE>if (TransportActions.isShardNotAvailableException(e)) {<NEW_LINE>throw e;<NEW_LINE>} else {<NEW_LINE>logger.debug(() -> new ParameterizedMessage("{} failed to execute multi_get for [{}]", shardId, item<MASK><NEW_LINE>response.add(request.locations.get(i), new MultiGetResponse.Failure(request.index(), item.id(), e));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return response;<NEW_LINE>} | .id()), e); |
1,688,597 | private ObjectVector filterLimitedModules(IPath jrtPath, ObjectVector imageRoots, List<String> rootModuleNames) {<NEW_LINE>Set<String> limitModulesSet = new HashSet<>(rootModuleNames);<NEW_LINE>ModuleLookup lookup = new ModuleLookup(jrtPath.toFile());<NEW_LINE>// collect all module roots:<NEW_LINE>for (int i = 0; i < imageRoots.size(); i++) {<NEW_LINE>lookup.recordRoot((JrtPackageFragmentRoot) imageRoots.elementAt(i));<NEW_LINE>}<NEW_LINE>// for those contained in limitModules, add the transitive closure:<NEW_LINE>for (int i = 0; i < imageRoots.size(); i++) {<NEW_LINE>String moduleName = ((JrtPackageFragmentRoot) imageRoots.elementAt(i)).moduleName;<NEW_LINE>if (limitModulesSet.contains(moduleName))<NEW_LINE>lookup.addTransitive(moduleName);<NEW_LINE>}<NEW_LINE>// map the result back to package fragment roots:<NEW_LINE>ObjectVector result = new ObjectVector(<MASK><NEW_LINE>for (IModule mod : lookup.resultModuleSet) {<NEW_LINE>result.add(lookup.getRoot(mod));<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | lookup.resultModuleSet.size()); |
1,609,324 | protected void registerParamAnnotations() {<NEW_LINE>{<NEW_LINE>registerParameterAnnotation(PathParam.class, (param, data, paramIndex) -> {<NEW_LINE>final String name = param.value();<NEW_LINE>checkState(emptyToNull(name<MASK><NEW_LINE>nameParam(data, name, paramIndex);<NEW_LINE>});<NEW_LINE>registerParameterAnnotation(QueryParam.class, (param, data, paramIndex) -> {<NEW_LINE>final String name = param.value();<NEW_LINE>checkState(emptyToNull(name) != null, "QueryParam.value() was empty on parameter %s", paramIndex);<NEW_LINE>final String query = addTemplatedParam(name);<NEW_LINE>data.template().query(name, query);<NEW_LINE>nameParam(data, name, paramIndex);<NEW_LINE>});<NEW_LINE>registerParameterAnnotation(HeaderParam.class, (param, data, paramIndex) -> {<NEW_LINE>final String name = param.value();<NEW_LINE>checkState(emptyToNull(name) != null, "HeaderParam.value() was empty on parameter %s", paramIndex);<NEW_LINE>final String header = addTemplatedParam(name);<NEW_LINE>data.template().header(name, header);<NEW_LINE>nameParam(data, name, paramIndex);<NEW_LINE>});<NEW_LINE>registerParameterAnnotation(FormParam.class, (param, data, paramIndex) -> {<NEW_LINE>final String name = param.value();<NEW_LINE>checkState(emptyToNull(name) != null, "FormParam.value() was empty on parameter %s", paramIndex);<NEW_LINE>data.formParams().add(name);<NEW_LINE>nameParam(data, name, paramIndex);<NEW_LINE>});<NEW_LINE>}<NEW_LINE>} | ) != null, "PathParam.value() was empty on parameter %s", paramIndex); |
1,369,439 | protected static // }<NEW_LINE>String calculateExtraClassPath(Class<?> cls, Path... paths) throws Exception {<NEW_LINE>List<String> jars = new ArrayList<>();<NEW_LINE>jars.addAll(calculateExtraClassPathDefault());<NEW_LINE>Module module = cls.getAnnotation(Module.class);<NEW_LINE>for (String str : module.storeJars()) {<NEW_LINE>File file = new File(Config.dir_store_jars(), str + ".jar");<NEW_LINE>if (file.exists()) {<NEW_LINE>jars.add(file.getAbsolutePath());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (String str : module.customJars()) {<NEW_LINE>File file = new File(Config.dir_custom_jars(), str + ".jar");<NEW_LINE>if (file.exists()) {<NEW_LINE>jars.add(file.getAbsolutePath());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (String str : module.dynamicJars()) {<NEW_LINE>File file = new File(Config.dir_dynamic_jars(), str + ".jar");<NEW_LINE>if (file.exists()) {<NEW_LINE>jars.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (Path path : paths) {<NEW_LINE>if (Files.exists(path) && Files.isDirectory(path)) {<NEW_LINE>try (Stream<Path> stream = Files.walk(path, FileVisitOption.FOLLOW_LINKS)) {<NEW_LINE>stream.filter(Files::isRegularFile).filter(p -> p.toAbsolutePath().toString().toLowerCase().endsWith(".jar")).forEach(p -> jars.add(p.toAbsolutePath().toString()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return StringUtils.join(jars, ";");<NEW_LINE>} | add(file.getAbsolutePath()); |
1,538,477 | final CreateSubscriberResult executeCreateSubscriber(CreateSubscriberRequest createSubscriberRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createSubscriberRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateSubscriberRequest> request = null;<NEW_LINE>Response<CreateSubscriberResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateSubscriberRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createSubscriberRequest));<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, "Budgets");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateSubscriber");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateSubscriberResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateSubscriberResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); |
52,179 | public void start() {<NEW_LINE>UlimitCheck.printUlimits();<NEW_LINE>videobridgeExpireThread.start();<NEW_LINE>// <conference><NEW_LINE>ProviderManager.addIQProvider(ColibriConferenceIQ.ELEMENT, ColibriConferenceIQ.NAMESPACE, new ColibriConferenceIqProvider());<NEW_LINE>// <force-shutdown><NEW_LINE>ForcefulShutdownIqProvider.registerIQProvider();<NEW_LINE>// <graceful-shutdown><NEW_LINE>GracefulShutdownIqProvider.registerIQProvider();<NEW_LINE>// <stats><NEW_LINE>// registers itself with Smack<NEW_LINE>new ColibriStatsIqProvider();<NEW_LINE>// ICE-UDP <transport><NEW_LINE>ProviderManager.addExtensionProvider(IceUdpTransportPacketExtension.ELEMENT, IceUdpTransportPacketExtension.NAMESPACE, new DefaultPacketExtensionProvider<>(IceUdpTransportPacketExtension.class));<NEW_LINE>// RAW-UDP <candidate xmlns=urn:xmpp:jingle:transports:raw-udp:1><NEW_LINE>DefaultPacketExtensionProvider<UdpCandidatePacketExtension> udpCandidatePacketExtensionProvider = new DefaultPacketExtensionProvider<>(UdpCandidatePacketExtension.class);<NEW_LINE>ProviderManager.addExtensionProvider(UdpCandidatePacketExtension.<MASK><NEW_LINE>// ICE-UDP <candidate xmlns=urn:xmpp:jingle:transports:ice-udp:1"><NEW_LINE>DefaultPacketExtensionProvider<IceCandidatePacketExtension> iceCandidatePacketExtensionProvider = new DefaultPacketExtensionProvider<>(IceCandidatePacketExtension.class);<NEW_LINE>ProviderManager.addExtensionProvider(IceCandidatePacketExtension.ELEMENT, IceCandidatePacketExtension.NAMESPACE, iceCandidatePacketExtensionProvider);<NEW_LINE>// ICE <rtcp-mux/><NEW_LINE>ProviderManager.addExtensionProvider(IceRtcpmuxPacketExtension.ELEMENT, IceRtcpmuxPacketExtension.NAMESPACE, new DefaultPacketExtensionProvider<>(IceRtcpmuxPacketExtension.class));<NEW_LINE>// DTLS-SRTP <fingerprint><NEW_LINE>ProviderManager.addExtensionProvider(DtlsFingerprintPacketExtension.ELEMENT, DtlsFingerprintPacketExtension.NAMESPACE, new DefaultPacketExtensionProvider<>(DtlsFingerprintPacketExtension.class));<NEW_LINE>// Health-check<NEW_LINE>HealthCheckIQProvider.registerIQProvider();<NEW_LINE>// Colibri2<NEW_LINE>IqProviderUtils.registerProviders();<NEW_LINE>} | ELEMENT, UdpCandidatePacketExtension.NAMESPACE, udpCandidatePacketExtensionProvider); |
1,154,837 | public Object _01_louvainParallel() {<NEW_LINE>return runQuery(db, "CALL algo.louvain(null, null, {maxIterations:1, concurrency:" + threads + "}) " + "YIELD loadMillis, computeMillis, writeMillis, nodes, communityCount, iterations", r -> {<NEW_LINE>long load = r.getNumber("loadMillis").longValue();<NEW_LINE>long compute = r.getNumber("computeMillis").longValue();<NEW_LINE>long write = r.getNumber("writeMillis").longValue();<NEW_LINE>long count = r.getNumber("communityCount").longValue();<NEW_LINE>long iter = r.getNumber("iterations").longValue();<NEW_LINE>long nodes = r.getNumber("nodes").longValue();<NEW_LINE>System.out.println("communities = " + count);<NEW_LINE>System.<MASK><NEW_LINE>System.out.println("nodes = " + nodes);<NEW_LINE>System.out.println("load = " + load);<NEW_LINE>System.out.println("compute = " + compute);<NEW_LINE>System.out.println("write = " + write);<NEW_LINE>});<NEW_LINE>} | out.println("iter = " + iter); |
1,136,361 | public void assemble() {<NEW_LINE>BuildOperationLogger operationLogger = getOperationLoggerFactory().newOperationLogger(getName(), getTemporaryDir());<NEW_LINE>boolean cleanedOutputs = StaleOutputCleaner.cleanOutputs(getDeleter(), getOutputs().getPreviousOutputFiles(), getObjectFileDir());<NEW_LINE>DefaultAssembleSpec spec = new DefaultAssembleSpec();<NEW_LINE>spec.setTempDir(getTemporaryDir());<NEW_LINE>spec.setObjectFileDir(getObjectFileDir());<NEW_LINE>spec.source(getSource());<NEW_LINE>spec.include(getIncludes());<NEW_LINE>spec.args(getAssemblerArgs());<NEW_LINE>spec.setOperationLogger(operationLogger);<NEW_LINE>NativeToolChainInternal nativeToolChain = (NativeToolChainInternal) toolChain.get();<NEW_LINE>NativePlatformInternal nativePlatform = <MASK><NEW_LINE>Compiler<AssembleSpec> compiler = nativeToolChain.select(nativePlatform).newCompiler(AssembleSpec.class);<NEW_LINE>WorkResult result = BuildOperationLoggingCompilerDecorator.wrap(compiler).execute(spec);<NEW_LINE>setDidWork(result.getDidWork() || cleanedOutputs);<NEW_LINE>} | (NativePlatformInternal) targetPlatform.get(); |
922,218 | public static HttpPutClientInvocation createUpdateInvocation(IBaseResource theResource, String theResourceBody, IIdType theId, FhirContext theContext) {<NEW_LINE>String resourceName = theContext.getResourceType(theResource);<NEW_LINE>StringBuilder urlBuilder = new StringBuilder();<NEW_LINE>urlBuilder.append(resourceName);<NEW_LINE>urlBuilder.append('/');<NEW_LINE>urlBuilder.append(theId.getIdPart());<NEW_LINE>String urlExtension = urlBuilder.toString();<NEW_LINE>HttpPutClientInvocation retVal;<NEW_LINE>if (StringUtils.isBlank(theResourceBody)) {<NEW_LINE>retVal = new HttpPutClientInvocation(theContext, theResource, urlExtension);<NEW_LINE>} else {<NEW_LINE>retVal = new HttpPutClientInvocation(<MASK><NEW_LINE>}<NEW_LINE>retVal.setForceResourceId(theId);<NEW_LINE>if (theId.hasVersionIdPart()) {<NEW_LINE>retVal.addHeader(Constants.HEADER_IF_MATCH, '"' + theId.getVersionIdPart() + '"');<NEW_LINE>}<NEW_LINE>return retVal;<NEW_LINE>} | theContext, theResourceBody, false, urlExtension); |
1,846,684 | public FileObject fromServer(Project project, URL serverUrl) {<NEW_LINE>String <MASK><NEW_LINE>String prefix = JsTestDriver.getServerURL();<NEW_LINE>if (!prefix.endsWith("/")) {<NEW_LINE>// NOI18N<NEW_LINE>// NOI18N<NEW_LINE>prefix += "/";<NEW_LINE>}<NEW_LINE>// NOI18N<NEW_LINE>prefix += "test/";<NEW_LINE>if (!serverU.startsWith(prefix)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>String projectRelativePath = serverU.substring(prefix.length());<NEW_LINE>if (projectRelativePath.isEmpty()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>// NOI18N<NEW_LINE>projectRelativePath = URLDecoder.decode(projectRelativePath, "UTF-8");<NEW_LINE>} catch (UnsupportedEncodingException ex) {<NEW_LINE>LOGGER.log(Level.WARNING, null, ex);<NEW_LINE>}<NEW_LINE>// try relative project path<NEW_LINE>FileObject projectDirectory = project.getProjectDirectory();<NEW_LINE>FileObject fileObject = projectDirectory.getFileObject(projectRelativePath);<NEW_LINE>if (fileObject != null) {<NEW_LINE>return fileObject;<NEW_LINE>}<NEW_LINE>// try absolute url for tests outside project folder<NEW_LINE>FileObject testsFolder = getTestsFolder(project);<NEW_LINE>if (testsFolder != null && !isUnderneath(projectDirectory, testsFolder)) {<NEW_LINE>File file = new File(projectRelativePath);<NEW_LINE>if (file.isFile()) {<NEW_LINE>return FileUtil.toFileObject(file);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | serverU = WebUtils.urlToString(serverUrl); |
1,588,647 | public static HttpService createDefaultConfig(Config c) {<NEW_LINE>final Config param = c;<NEW_LINE>try {<NEW_LINE>ConfigSupport.apply(new SingleConfigCode<Config>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Object run(Config param) throws PropertyVetoException, TransactionFailure {<NEW_LINE>HttpService httpService = param.createChild(HttpService.class);<NEW_LINE>AccessLog accessLog = httpService.createChild(AccessLog.class);<NEW_LINE>List<VirtualServer> vsList = httpService.getVirtualServer();<NEW_LINE>httpService.setAccessLog(accessLog);<NEW_LINE>VirtualServer vs = <MASK><NEW_LINE>vs.setId("server");<NEW_LINE>vs.setNetworkListeners("http-listener-1,http-listener-2");<NEW_LINE>VirtualServer vs1 = httpService.createChild(VirtualServer.class);<NEW_LINE>vs1.setId("__asadmin");<NEW_LINE>vs1.setNetworkListeners("admin-listener");<NEW_LINE>vsList.add(vs);<NEW_LINE>vsList.add(vs1);<NEW_LINE>param.getContainers().add(httpService);<NEW_LINE>return httpService;<NEW_LINE>}<NEW_LINE>}, param);<NEW_LINE>} catch (TransactionFailure ex) {<NEW_LINE>// Will use the BG logging infrastrucre... And probably some exception type?<NEW_LINE>LOGGER.log(Level.INFO, ConfigApiLoggerInfo.unableToCreateHttpServiceConfig, ex);<NEW_LINE>}<NEW_LINE>return param.getExtensionByType(HttpService.class);<NEW_LINE>} | httpService.createChild(VirtualServer.class); |
1,393,017 | private Mono<Response<LoadTestResourceInner>> createOrUpdateWithResponseAsync(String resourceGroupName, String loadTestName, LoadTestResourceInner loadTestResource, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (loadTestName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter loadTestName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (loadTestResource == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter loadTestResource is required and cannot be null."));<NEW_LINE>} else {<NEW_LINE>loadTestResource.validate();<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), loadTestName, loadTestResource, accept, context);<NEW_LINE>} | error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); |
327,221 | public Object parseContent(Object object, JSONObject exJson) throws Exception {<NEW_LINE>object = JSONObject.toJSON(object);<NEW_LINE>if (object instanceof JSONObject) {<NEW_LINE>JSONObject jsonObject = (JSONObject) object;<NEW_LINE>if ("innerFun".equals(jsonObject.getString("__innerType__"))) {<NEW_LINE>String name = jsonObject.getString("name");<NEW_LINE>JSONObject nameJson = exJson.getJSONObject(name);<NEW_LINE>nameJson = nameJson == null ? exJson : nameJson;<NEW_LINE>jsonObject = Tools.deepMerge(nameJson, jsonObject);<NEW_LINE>return innerFunResult(jsonObject);<NEW_LINE>} else {<NEW_LINE>JSONObject retJson = new JSONObject();<NEW_LINE>for (String key : jsonObject.keySet()) {<NEW_LINE>retJson.put(key, parseContent(jsonObject.<MASK><NEW_LINE>}<NEW_LINE>return retJson;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (object instanceof JSONArray) {<NEW_LINE>JSONArray jsonArray = (JSONArray) object;<NEW_LINE>for (int index = 0; index < jsonArray.size(); index++) {<NEW_LINE>jsonArray.set(index, parseContent(jsonArray.get(index), exJson));<NEW_LINE>}<NEW_LINE>return jsonArray;<NEW_LINE>}<NEW_LINE>return object;<NEW_LINE>} | get(key), exJson)); |
1,531,676 | public static List<SupervisorSummary> mkSupervisorSummaries(Map<String, SupervisorInfo> supervisorInfos, Map<String, Assignment> assignments) {<NEW_LINE>Map<String, Integer> supervisorToLeftSlotNum = new HashMap<>();<NEW_LINE>for (Entry<String, Assignment> entry : assignments.entrySet()) {<NEW_LINE>Set<ResourceWorkerSlot> workers = entry.getValue().getWorkers();<NEW_LINE>for (ResourceWorkerSlot worker : workers) {<NEW_LINE><MASK><NEW_LINE>SupervisorInfo supervisorInfo = supervisorInfos.get(supervisorId);<NEW_LINE>if (supervisorInfo == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Integer slots = supervisorToLeftSlotNum.get(supervisorId);<NEW_LINE>if (slots == null) {<NEW_LINE>slots = 0;<NEW_LINE>supervisorToLeftSlotNum.put(supervisorId, slots);<NEW_LINE>}<NEW_LINE>supervisorToLeftSlotNum.put(supervisorId, ++slots);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<SupervisorSummary> ret = new ArrayList<>();<NEW_LINE>for (Entry<String, SupervisorInfo> entry : supervisorInfos.entrySet()) {<NEW_LINE>String supervisorId = entry.getKey();<NEW_LINE>SupervisorInfo supervisorInfo = entry.getValue();<NEW_LINE>SupervisorSummary summary = mkSupervisorSummary(supervisorInfo, supervisorId, supervisorToLeftSlotNum);<NEW_LINE>ret.add(summary);<NEW_LINE>}<NEW_LINE>Collections.sort(ret, new Comparator<SupervisorSummary>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public int compare(SupervisorSummary o1, SupervisorSummary o2) {<NEW_LINE>return o1.get_host().compareTo(o2.get_host());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return ret;<NEW_LINE>} | String supervisorId = worker.getNodeId(); |
249,265 | public void reduce(final IntWritable key, final Iterator<Text> values, OutputCollector<IntWritable, Text> output, final Reporter reporter) throws IOException {<NEW_LINE>String component_id_str = "";<NEW_LINE>Set<Integer> from_nodes_set <MASK><NEW_LINE>boolean self_contained = false;<NEW_LINE>String line = "";<NEW_LINE>while (values.hasNext()) {<NEW_LINE>Text from_cur_node = values.next();<NEW_LINE>line = from_cur_node.toString();<NEW_LINE>if (line.startsWith("m")) {<NEW_LINE>// component info<NEW_LINE>if (component_id_str.length() == 0)<NEW_LINE>component_id_str = line.substring(3);<NEW_LINE>} else {<NEW_LINE>// edge line<NEW_LINE>int from_node_int = Integer.parseInt(line);<NEW_LINE>from_nodes_set.add(from_node_int);<NEW_LINE>if (key.get() == from_node_int)<NEW_LINE>self_contained = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (// add self loop, if not exists.<NEW_LINE>self_contained == false)<NEW_LINE>from_nodes_set.add(key.get());<NEW_LINE>Iterator from_nodes_it = from_nodes_set.iterator();<NEW_LINE>while (from_nodes_it.hasNext()) {<NEW_LINE>String component_info;<NEW_LINE>int cur_key_int = ((Integer) from_nodes_it.next()).intValue();<NEW_LINE>if (cur_key_int == key.get()) {<NEW_LINE>component_info = "msi" + component_id_str;<NEW_LINE>output.collect(new IntWritable(cur_key_int), new Text(component_info));<NEW_LINE>} else {<NEW_LINE>component_info = "moi" + component_id_str;<NEW_LINE>output.collect(new IntWritable(cur_key_int), new Text(component_info));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | = new HashSet<Integer>(); |
1,105,988 | public List<String> applyRuntimeToFile(File dataFile, Integer retries) throws IOException, NoSuchMethodException, InterruptedException {<NEW_LINE>// Vars Required in function<NEW_LINE>Process runtime;<NEW_LINE>String pythonVersion = runtimeVersion();<NEW_LINE>Integer retriesRemaining = retries - 1;<NEW_LINE>String stderr;<NEW_LINE>// Apply Python<NEW_LINE>try {<NEW_LINE>LOG.info("Apply Python to File: " + dataFile.getAbsolutePath());<NEW_LINE>runtime = getProcessBuilder().command(pythonVersion, functionName(), dataFile.getAbsolutePath()).start();<NEW_LINE>LOG.info("Waiting For Results: " + dataFile.getAbsolutePath());<NEW_LINE>if (retriesRemaining > 0) {<NEW_LINE>if (runtime != null) {<NEW_LINE>runtime.destroyForcibly();<NEW_LINE>}<NEW_LINE>return applyRuntimeToFile(dataFile, retriesRemaining);<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>LOG.info("IO Exception Seen");<NEW_LINE>if (e.getMessage().startsWith(missingPythonErrorMessage)) {<NEW_LINE>// Build Python and Retry<NEW_LINE>buildPythonExecutable(pythonVersion);<NEW_LINE>if (retriesRemaining > 0) {<NEW_LINE>return applyRuntimeToFile(dataFile, retriesRemaining);<NEW_LINE>} else {<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.info("Non IO Exception Seen");<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>// Test Runtime Exists (should not be possible to hit this case)<NEW_LINE>if (runtime == null) {<NEW_LINE>throw new IOException("no runtime was provided");<NEW_LINE>}<NEW_LINE>// Process Python Results<NEW_LINE>LOG.info("Process Python Results: " + dataFile.getAbsolutePath());<NEW_LINE>List<String> results = new ArrayList<>();<NEW_LINE>try {<NEW_LINE>final BufferedReader reader = new BufferedReader(new InputStreamReader(runtime.getInputStream()));<NEW_LINE>reader.lines().iterator(<MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>} finally {<NEW_LINE>runtime.destroy();<NEW_LINE>}<NEW_LINE>return results;<NEW_LINE>} | ).forEachRemaining(results::add); |
79,245 | private I_M_ProductPrice buildNewProductPriceRecord(@NonNull final CreateProductPriceRequest request) {<NEW_LINE>final I_M_ProductPrice record = InterfaceWrapperHelper.newInstance(I_M_ProductPrice.class);<NEW_LINE>record.setAD_Org_ID(request.getOrgId().getRepoId());<NEW_LINE>record.setM_Product_ID(request.getProductId().getRepoId());<NEW_LINE>record.setM_PriceList_Version_ID(request.getPriceListVersionId().getRepoId());<NEW_LINE>record.setPriceLimit(request.getPriceLimit());<NEW_LINE>record.setPriceList(request.getPriceList());<NEW_LINE>record.setPriceStd(request.getPriceStd());<NEW_LINE>record.setC_UOM_ID(request.<MASK><NEW_LINE>record.setC_TaxCategory_ID(request.getTaxCategoryId().getRepoId());<NEW_LINE>if (request.getIsActive() != null) {<NEW_LINE>record.setIsActive(request.getIsActive());<NEW_LINE>}<NEW_LINE>if (request.getSeqNo() != null) {<NEW_LINE>record.setSeqNo(request.getSeqNo());<NEW_LINE>}<NEW_LINE>return record;<NEW_LINE>} | getUomId().getRepoId()); |
536,498 | final GetQueueAttributesResult executeGetQueueAttributes(GetQueueAttributesRequest getQueueAttributesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getQueueAttributesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetQueueAttributesRequest> request = null;<NEW_LINE>Response<GetQueueAttributesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetQueueAttributesRequestMarshaller().marshall(super.beforeMarshalling(getQueueAttributesRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetQueueAttributes");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<GetQueueAttributesResult> responseHandler = new StaxResponseHandler<GetQueueAttributesResult>(new GetQueueAttributesResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.SERVICE_ID, "SQS"); |
1,644,323 | public static Object intoFlipper(EditorValue editorValue) {<NEW_LINE>return editorValue.when(new EditorValue.EditorVisitor<Object>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Object isShape(EditorShape object) {<NEW_LINE>FlipperObject.Builder bb = new FlipperObject.Builder();<NEW_LINE>for (Map.Entry<String, EditorValue> entry : object.value.entrySet()) {<NEW_LINE>bb.put(entry.getKey(), intoFlipper(entry.getValue()));<NEW_LINE>}<NEW_LINE>return bb.build();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Object isArray(EditorArray array) {<NEW_LINE>FlipperArray.Builder bb = new FlipperArray.Builder();<NEW_LINE>for (EditorValue entry : array.value) {<NEW_LINE>Object flipper = intoFlipper(entry);<NEW_LINE>if (flipper instanceof FlipperValue) {<NEW_LINE>bb<MASK><NEW_LINE>} else if (flipper instanceof FlipperObject) {<NEW_LINE>bb.put((FlipperObject) flipper);<NEW_LINE>} else if (flipper instanceof FlipperArray) {<NEW_LINE>bb.put((FlipperArray) flipper);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return bb.build();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Object isPick(EditorPick pick) {<NEW_LINE>return InspectorValue.mutable(InspectorValue.Type.Picker, new InspectorValue.Picker(pick.values, pick.selected));<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Object isNumber(EditorNumber number) {<NEW_LINE>return InspectorValue.mutable(number.value);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Object isString(EditorString string) {<NEW_LINE>return InspectorValue.mutable(string.value);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Object isBool(EditorBool bool) {<NEW_LINE>return InspectorValue.mutable(bool.value);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | .put((FlipperValue) flipper); |
504,939 | public static synchronized MetaPushConsumer mkInstance(MetaClientConfig config, MessageListenerConcurrently listener) throws Exception {<NEW_LINE>String topic = config.getTopic();<NEW_LINE>String groupId = config.getConsumerGroup();<NEW_LINE>String key = groupId;<NEW_LINE>MetaPushConsumer consumer = consumers.get(key);<NEW_LINE>if (consumer != null) {<NEW_LINE>LOG.info("Consumer of " + key + " has been created, don't recreate it ");<NEW_LINE>// Attention, this place return null to info duplicated consumer<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>sb.append("Begin to init meta client \n");<NEW_LINE>sb.append(",configuration:").append(config);<NEW_LINE>LOG.info(sb.toString());<NEW_LINE>consumer = new MetaPushConsumer(groupId);<NEW_LINE><MASK><NEW_LINE>if (nameServer != null) {<NEW_LINE>String namekey = "rocketmq.namesrv.domain";<NEW_LINE>String value = System.getProperty(namekey);<NEW_LINE>// this is for alipay<NEW_LINE>if (value == null) {<NEW_LINE>System.setProperty(namekey, nameServer);<NEW_LINE>} else if (value.equals(nameServer) == false) {<NEW_LINE>throw new Exception("Different nameserver address in the same worker " + value + ":" + nameServer);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String instanceName = groupId + "@" + JStormUtils.process_pid();<NEW_LINE>// consumer.setInstanceName(instanceName);<NEW_LINE>consumer.setConsumeFromWhere(ConsumeFromWhere.CONSUME_FROM_LAST_OFFSET);<NEW_LINE>consumer.subscribe(config.getTopic(), config.getSubExpress());<NEW_LINE>consumer.registerMessageListener(listener);<NEW_LINE>consumer.setPullThresholdForQueue(config.getQueueSize());<NEW_LINE>consumer.setConsumeMessageBatchMaxSize(config.getSendBatchSize());<NEW_LINE>consumer.setPullBatchSize(config.getPullBatchSize());<NEW_LINE>consumer.setPullInterval(config.getPullInterval());<NEW_LINE>consumer.setConsumeThreadMin(config.getPullThreadNum());<NEW_LINE>consumer.setConsumeThreadMax(config.getPullThreadNum());<NEW_LINE>Date date = config.getStartTimeStamp();<NEW_LINE>if (date != null) {<NEW_LINE>LOG.info("Begin to reset meta offset to " + date);<NEW_LINE>try {<NEW_LINE>MetaHelper.resetOffsetByTimestamp(MessageModel.CLUSTERING, instanceName, config.getConsumerGroup(), config.getTopic(), date.getTime());<NEW_LINE>LOG.info("Successfully reset meta offset to " + date);<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.error("Failed to reset meta offset to " + date);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>LOG.info("Don't reset meta offset ");<NEW_LINE>}<NEW_LINE>consumer.start();<NEW_LINE>consumers.put(key, consumer);<NEW_LINE>LOG.info("Successfully create " + key + " consumer");<NEW_LINE>return consumer;<NEW_LINE>} | String nameServer = config.getNameServer(); |
1,240,281 | protected void startReceiver() {<NEW_LINE>int receiverThreadCount = config.getReceiverThreadCount();<NEW_LINE>for (int i = 0; i < receiverThreadCount; i++) {<NEW_LINE>Worker receiver = new Worker("DTLS-Cluster-" + getNodeID() + "-Receiver-" + i + "-" + clusterInternalSocketAddress) {<NEW_LINE><NEW_LINE>private final byte[] receiverBuffer <MASK><NEW_LINE><NEW_LINE>private final DatagramPacket clusterPacket = new DatagramPacket(receiverBuffer, receiverBuffer.length);<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void doWork() throws Exception {<NEW_LINE>clusterPacket.setData(receiverBuffer);<NEW_LINE>clusterInternalSocket.receive(clusterPacket);<NEW_LINE>Byte type = getClusterRecordType(clusterPacket);<NEW_LINE>if (type != null) {<NEW_LINE>if (ensureLength(type, clusterPacket)) {<NEW_LINE>processDatagramFromClusterNetwork(type, clusterPacket);<NEW_LINE>} else if (clusterHealth != null) {<NEW_LINE>clusterHealth.dropForwardMessage();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>processManagementDatagramFromClusterNetwork(clusterPacket);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>receiver.setDaemon(true);<NEW_LINE>receiver.start();<NEW_LINE>clusterReceiverThreads.add(receiver);<NEW_LINE>}<NEW_LINE>LOGGER.info("cluster-node {}: started {}", getNodeID(), clusterInternalSocket.getLocalSocketAddress());<NEW_LINE>} | = new byte[inboundDatagramBufferSize + MAX_DATAGRAM_OFFSET]; |
531,622 | boolean checkEquivalence(ZooKeeperClient zkc, String path) {<NEW_LINE>try {<NEW_LINE>LogSegmentMetadata other = FutureUtils.result(read(zkc, path));<NEW_LINE>if (LOG.isTraceEnabled()) {<NEW_LINE>LOG.trace("Verifying {} against {}", this, other);<NEW_LINE>}<NEW_LINE>boolean retVal;<NEW_LINE>// All fields may not be comparable so only compare the ones<NEW_LINE>// that can be compared<NEW_LINE>// completionTime is set when a node is finalized, so that<NEW_LINE>// cannot be compared<NEW_LINE>// if the node is inprogress, don't compare the lastTxId either<NEW_LINE>if (this.getLogSegmentSequenceNumber() != other.getLogSegmentSequenceNumber() || this.logSegmentId != other.logSegmentId || this.firstTxId != other.firstTxId) {<NEW_LINE>retVal = false;<NEW_LINE>} else if (this.inprogress) {<NEW_LINE>retVal = other.inprogress;<NEW_LINE>} else {<NEW_LINE>retVal = (!other.inprogress && (this.lastTxId == other.lastTxId));<NEW_LINE>}<NEW_LINE>if (!retVal) {<NEW_LINE>LOG.warn("Equivalence check failed between {} and {}", this, other);<NEW_LINE>}<NEW_LINE>return retVal;<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.error("Could not check equivalence between:" + <MASK><NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} | this + " and data in " + path, e); |
1,453,184 | private void initGeneralMessageClass() {<NEW_LINE>for (AccountType accountType : AccountType.values()) {<NEW_LINE>messageClassMap.put(new WeixinMessageKey(MessageType.text.name(), null, accountType), TextMessage.class);<NEW_LINE>messageClassMap.put(new WeixinMessageKey(MessageType.image.name(), null, accountType), ImageMessage.class);<NEW_LINE>messageClassMap.put(new WeixinMessageKey(MessageType.voice.name(), null, accountType), VoiceMessage.class);<NEW_LINE>messageClassMap.put(new WeixinMessageKey(MessageType.video.name(), null, accountType), VideoMessage.class);<NEW_LINE>messageClassMap.put(new WeixinMessageKey(MessageType.shortvideo.name(), null, accountType), VideoMessage.class);<NEW_LINE>messageClassMap.put(new WeixinMessageKey(MessageType.location.name(), null<MASK><NEW_LINE>messageClassMap.put(new WeixinMessageKey(MessageType.link.name(), null, accountType), LinkMessage.class);<NEW_LINE>}<NEW_LINE>} | , accountType), LocationMessage.class); |
354,282 | private static void logState(PartitionDegraderLoadBalancerState oldState, PartitionDegraderLoadBalancerState newState, int partitionId, DegraderLoadBalancerStrategyConfig config, List<DegraderTrackerClient> unHealthyClients, boolean clientDegraded) {<NEW_LINE>Map<URI, Integer<MASK><NEW_LINE>final int LOG_UNHEALTHY_CLIENT_NUMBERS = 10;<NEW_LINE>if (_log.isDebugEnabled()) {<NEW_LINE>_log.debug("Strategy updated: partitionId= " + partitionId + ", newState=" + newState + ", unhealthyClients = [" + (unHealthyClients.stream().map(client -> getClientStats(client, partitionId, pointsMap, config)).collect(Collectors.joining(","))) + "], config=" + config + ", HashRing coverage=" + newState.getRing());<NEW_LINE>} else if (allowToLog(oldState, newState, clientDegraded)) {<NEW_LINE>_log.info("Strategy updated: partitionId= " + partitionId + ", newState=" + newState + ", unhealthyClients = [" + (unHealthyClients.stream().limit(LOG_UNHEALTHY_CLIENT_NUMBERS).map(client -> getClientStats(client, partitionId, pointsMap, config)).collect(Collectors.joining(","))) + (unHealthyClients.size() > LOG_UNHEALTHY_CLIENT_NUMBERS ? "...(total " + unHealthyClients.size() + ")" : "") + "], oldState =" + oldState + ", new state's config=" + config);<NEW_LINE>}<NEW_LINE>} | > pointsMap = newState.getPointsMap(); |
1,062,749 | private void split(MAsset asset) {<NEW_LINE>asset.changeStatus(MAsset.A_ASSET_STATUS_Preservation, getDateDoc());<NEW_LINE>// Update Product Balance<NEW_LINE>MAssetProduct assetProduct = MAssetProduct.getCreate(getCtx(), getA_Asset_ID(), asset.getM_Product_ID(), asset.getM_AttributeSetInstance_ID(), get_TrxName());<NEW_LINE>assetProduct.setA_QTY_Current(BigDecimal.ZERO);<NEW_LINE>assetProduct.setAD_Org_ID(asset.getAD_Org_ID());<NEW_LINE>assetProduct.saveEx();<NEW_LINE>assetProduct.updateAsset(asset);<NEW_LINE>asset.setA_QTY_Current(BigDecimal.ZERO);<NEW_LINE>asset.setQty(BigDecimal.ZERO);<NEW_LINE>asset.saveEx();<NEW_LINE>MDepreciationWorkfile assetBalance = MDepreciationWorkfile.get(getCtx(), getA_Asset_ID(), getPostingType(), get_TrxName());<NEW_LINE>assetBalance.setA_Asset_Cost(BigDecimal.ZERO);<NEW_LINE>assetBalance.setA_Salvage_Value(BigDecimal.ZERO);<NEW_LINE>assetBalance.setA_Accumulated_Depr(BigDecimal.ZERO);<NEW_LINE>assetBalance.setA_Asset_Remaining(BigDecimal.ZERO);<NEW_LINE>assetBalance.setA_Accumulated_Depr_F(BigDecimal.ZERO);<NEW_LINE><MASK><NEW_LINE>assetBalance.setIsDepreciated(false);<NEW_LINE>assetBalance.saveEx();<NEW_LINE>// Delete not processed expense entries<NEW_LINE>MDepreciationExp.getNotProcessedEntries(getCtx(), getA_Asset_ID(), getPostingType(), get_TrxName()).forEach(depreciation -> depreciation.deleteEx(false));<NEW_LINE>// Update Asset History<NEW_LINE>MAssetChange.createSplit(this, assetBalance);<NEW_LINE>} | assetBalance.setA_Asset_Remaining_F(BigDecimal.ZERO); |
1,484,878 | public RollingUpdateOp start(final DeploymentGroup deploymentGroup, final ZooKeeperClient client) throws KeeperException {<NEW_LINE>client.ensurePath(Paths.statusDeploymentGroupTasks());<NEW_LINE>final List<ZooKeeperOperation> ops = Lists.newArrayList();<NEW_LINE>final List<Map<String, Object>> events = Lists.newArrayList();<NEW_LINE>final List<RolloutTask<MASK><NEW_LINE>events.add(eventFactory.rollingUpdateStarted(deploymentGroup));<NEW_LINE>final Stat tasksStat = client.exists(Paths.statusDeploymentGroupTasks(deploymentGroup.getName()));<NEW_LINE>if (tasksStat == null) {<NEW_LINE>// Create the tasks path if it doesn't already exist. The following operations (delete or set)<NEW_LINE>// assume the node already exists. If the tasks path is created/deleted before the transaction<NEW_LINE>// is committed it will fail. This will on occasion generate a user-visible error but is<NEW_LINE>// better than having inconsistent state.<NEW_LINE>ops.add(create(Paths.statusDeploymentGroupTasks(deploymentGroup.getName())));<NEW_LINE>}<NEW_LINE>final DeploymentGroupStatus status;<NEW_LINE>if (rolloutTasks.isEmpty()) {<NEW_LINE>status = DeploymentGroupStatus.newBuilder().setState(DONE).build();<NEW_LINE>ops.add(delete(Paths.statusDeploymentGroupTasks(deploymentGroup.getName())));<NEW_LINE>events.add(eventFactory.rollingUpdateDone(deploymentGroup));<NEW_LINE>} else {<NEW_LINE>final DeploymentGroupTasks tasks = DeploymentGroupTasks.newBuilder().setRolloutTasks(rolloutTasks).setTaskIndex(0).setDeploymentGroup(deploymentGroup).build();<NEW_LINE>status = DeploymentGroupStatus.newBuilder().setState(ROLLING_OUT).build();<NEW_LINE>ops.add(set(Paths.statusDeploymentGroupTasks(deploymentGroup.getName()), tasks));<NEW_LINE>}<NEW_LINE>// NOTE: If the DG was removed this set() cause the transaction to fail, because removing<NEW_LINE>// the DG removes this node. It's *important* that there's an operation that causes the<NEW_LINE>// transaction to fail if the DG was removed or we'll end up with inconsistent state.<NEW_LINE>ops.add(set(Paths.statusDeploymentGroup(deploymentGroup.getName()), status));<NEW_LINE>return new RollingUpdateOp(ImmutableList.copyOf(ops), ImmutableList.copyOf(events));<NEW_LINE>} | > rolloutTasks = tasks.getRolloutTasks(); |
531,443 | public static int interpolateColor(int[] colors, float proportion) {<NEW_LINE>int rTotal = 0<MASK><NEW_LINE>// We correct the ratio to colors.length - 1 so that<NEW_LINE>// for i == colors.length - 1 and p == 1, then the final ratio is 1 (see below)<NEW_LINE>float p = proportion * (colors.length - 1);<NEW_LINE>for (int i = 0; i < colors.length; i++) {<NEW_LINE>// The ratio mostly resides on the 1 - Math.abs(p - i) calculation :<NEW_LINE>// Since for p == i, then the ratio is 1 and for p == i + 1 or p == i -1, then the ratio is 0<NEW_LINE>// This calculation works BECAUSE p lies within [0, length - 1] and i lies within [0, length - 1] as well<NEW_LINE>float iRatio = Math.max(1 - Math.abs(p - i), 0.0f);<NEW_LINE>rTotal += (int) (Color.red(colors[i]) * iRatio);<NEW_LINE>gTotal += (int) (Color.green(colors[i]) * iRatio);<NEW_LINE>bTotal += (int) (Color.blue(colors[i]) * iRatio);<NEW_LINE>}<NEW_LINE>return Color.rgb(rTotal, gTotal, bTotal);<NEW_LINE>} | , gTotal = 0, bTotal = 0; |
74,299 | public Object evaluate(EditorAdaptor vim, Queue<String> command) {<NEW_LINE>try {<NEW_LINE>if (command.size() != 2 || command.peek().length() != 1) {<NEW_LINE>throw new IllegalArgumentException(":surround expects a character key and a definition");<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>String[] surroundDef = command.poll().replaceAll("(?i)<SPACE>", " ").split("\\\\r");<NEW_LINE>if (surroundDef.length != 2) {<NEW_LINE>throw new IllegalArgumentException(":surround definition must contain '\\r'");<NEW_LINE>}<NEW_LINE>char keyChar = key.charAt(0);<NEW_LINE>String left = surroundDef[0];<NEW_LINE>String right = surroundDef[1];<NEW_LINE>delimiterRegistry.addBinding(leafBind(keyChar, (DelimiterHolder) new SimpleDelimiterHolder(left, right)));<NEW_LINE>} catch (Exception e) {<NEW_LINE>vim.getUserInterfaceService().setErrorMessage(e.getMessage());<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | String key = command.poll(); |
663,244 | private RouteSearchParameters processRouteRequestOptions(RouteSearchParameters params) throws StatusCodeException {<NEW_LINE>params = processRequestOptions(routeOptions, params);<NEW_LINE>if (routeOptions.hasProfileParams())<NEW_LINE>params.setProfileParams(convertParameters(routeOptions, params.getProfileType()));<NEW_LINE>if (routeOptions.hasVehicleType())<NEW_LINE>params.setVehicleType(convertVehicleType(routeOptions.getVehicleType(), params.getProfileType()));<NEW_LINE>if (routeOptions.hasRoundTripOptions()) {<NEW_LINE>RouteRequestRoundTripOptions roundTripOptions = routeOptions.getRoundTripOptions();<NEW_LINE>if (roundTripOptions.hasLength()) {<NEW_LINE>params.<MASK><NEW_LINE>} else {<NEW_LINE>throw new MissingParameterException(RoutingErrorCodes.MISSING_PARAMETER, RouteRequestRoundTripOptions.PARAM_LENGTH);<NEW_LINE>}<NEW_LINE>if (roundTripOptions.hasPoints()) {<NEW_LINE>params.setRoundTripPoints(roundTripOptions.getPoints());<NEW_LINE>}<NEW_LINE>if (roundTripOptions.hasSeed()) {<NEW_LINE>params.setRoundTripSeed(roundTripOptions.getSeed());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return params;<NEW_LINE>} | setRoundTripLength(roundTripOptions.getLength()); |
1,670,510 | private void addSetterInPathOccurrence(String propertyPath, String[] pathTokens, SpringBean bean, TypeMirror beanType, Collection<ExecutableElement> methods, List<Occurrence> result) throws BadLocationException {<NEW_LINE>Location loc = bean.getLocation();<NEW_LINE>if (loc == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int beanOffset = loc.getOffset();<NEW_LINE>if (beanOffset == -1) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>PropertyChildFinder finder <MASK><NEW_LINE>if (!finder.find(propertyPath)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int foundOffset = finder.getFoundOffset();<NEW_LINE>String foundValue = finder.getValue();<NEW_LINE>int index = foundValue.indexOf(propertyPath);<NEW_LINE>if (index == -1) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>PropertyPathElement[] pathElements = evaluatePropertyPath(cc.getElementUtilities(), beanType, pathTokens);<NEW_LINE>if (pathElements.length <= 1) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>PropertyPathElement setterElement = pathElements[pathElements.length - 1];<NEW_LINE>if (!isSameOrOverrides(setterElement.getProperty().getSetter(), methods)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String displayText = createPropertyChildDisplayText(foundValue, index + setterElement.getStartIndex(), setterElement.getEndIndex() - setterElement.getStartIndex());<NEW_LINE>PositionRef startRef = docAccess.createPositionRef(foundOffset + index + setterElement.getStartIndex(), Bias.Forward);<NEW_LINE>PositionRef endRef = docAccess.createPositionRef(foundOffset + index + setterElement.getEndIndex(), Bias.Backward);<NEW_LINE>result.add(new PropertyRefOccurrence(displayText, docAccess.getFileObject(), new PositionBounds(startRef, endRef)));<NEW_LINE>} | = new PropertyChildFinder(syntaxSupport, beanOffset); |
1,053,066 | static Object autofuzz(FuzzedDataProvider data, Method method, AutofuzzCodegenVisitor visitor) {<NEW_LINE>Object result;<NEW_LINE>if (Modifier.isStatic(method.getModifiers())) {<NEW_LINE>if (visitor != null) {<NEW_LINE>// This group will always have two elements: The class name and the method call.<NEW_LINE>visitor.pushGroup(String.format("%s.", method.getDeclaringClass().getCanonicalName()), "", "");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>result = autofuzz(data, method, null, visitor);<NEW_LINE>} finally {<NEW_LINE>if (visitor != null) {<NEW_LINE>visitor.popGroup();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (visitor != null) {<NEW_LINE>// This group will always have two elements: The thisObject and the method call.<NEW_LINE>// Since the this object can be a complex expression, wrap it in paranthesis.<NEW_LINE>visitor.pushGroup("(", ").", "");<NEW_LINE>}<NEW_LINE>Object thisObject = consume(data, method.getDeclaringClass(), visitor);<NEW_LINE>if (thisObject == null) {<NEW_LINE>throw new AutofuzzConstructionException();<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>result = autofuzz(<MASK><NEW_LINE>} finally {<NEW_LINE>if (visitor != null) {<NEW_LINE>visitor.popGroup();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | data, method, thisObject, visitor); |
1,674,891 | public FileKey requestRoomRescueKey(Long fileId, String version, String xSdsAuthToken) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// verify the required parameter 'fileId' is set<NEW_LINE>if (fileId == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'fileId' when calling requestRoomRescueKey");<NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/v4/nodes/files/{file_id}/data_room_file_key".replaceAll("\\{" + "file_id" + "\\}", apiClient.escapeString(fileId.toString()));<NEW_LINE>// query params<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>localVarQueryParams.addAll(apiClient.parameterToPairs("", "version", version));<NEW_LINE>if (xSdsAuthToken != null)<NEW_LINE>localVarHeaderParams.put("X-Sds-Auth-Token", apiClient.parameterToString(xSdsAuthToken));<NEW_LINE>final String[] localVarAccepts = { "application/json" };<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>final String[] localVarContentTypes = {};<NEW_LINE>final String <MASK><NEW_LINE>String[] localVarAuthNames = new String[] { "oauth2" };<NEW_LINE>GenericType<FileKey> localVarReturnType = new GenericType<FileKey>() {<NEW_LINE>};<NEW_LINE>return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);<NEW_LINE>} | localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); |
865,216 | private void undefinePlays(ThingType thingType, Set<PlaysConstraint> playsConstraints) {<NEW_LINE>try (ThreadTrace ignored = traceOnThread(TRACE_PREFIX + "undefine_plays")) {<NEW_LINE>playsConstraints.forEach(plays -> {<NEW_LINE>Type roleType = getRoleType(plays.role().label().get());<NEW_LINE>if (roleType == null && !undefined.contains(plays.role())) {<NEW_LINE>throw TypeDBException.of(TYPE_NOT_FOUND, plays.role().label().get().label());<NEW_LINE>} else if (plays.overridden().isPresent()) {<NEW_LINE>throw TypeDBException.of(INVALID_UNDEFINE_PLAYS_OVERRIDE, plays.overridden().get().label().get().label(), plays.role().label().get());<NEW_LINE>} else if (roleType != null) {<NEW_LINE>thingType.<MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>} | unsetPlays(roleType.asRoleType()); |
695,635 | public Stream<MapResult> parallel2(@Name("fragment") String fragment, @Name("params") Map<String, Object> params, @Name("parallelizeOn") String key) {<NEW_LINE>if (params == null)<NEW_LINE>return Cypher.runCypherQuery(tx, fragment, params);<NEW_LINE>if (key == null || !params.containsKey(key))<NEW_LINE>throw new RuntimeException("Can't parallelize on key " + key + " available keys " + params.keySet());<NEW_LINE>Object value = params.get(key);<NEW_LINE>if (!(value instanceof Collection))<NEW_LINE>throw new RuntimeException("Can't parallelize a non collection " + key + " : " + value);<NEW_LINE>final String statement = withParamsAndIterator(fragment, params.keySet(), key);<NEW_LINE>tx.execute("EXPLAIN " + statement).close();<NEW_LINE>Collection<Object> coll = (Collection<Object>) value;<NEW_LINE><MASK><NEW_LINE>int partitions = PARTITIONS;<NEW_LINE>int batchSize = Math.max(total / partitions, 1);<NEW_LINE>if (batchSize > MAX_BATCH) {<NEW_LINE>batchSize = MAX_BATCH;<NEW_LINE>partitions = (total / batchSize) + 1;<NEW_LINE>}<NEW_LINE>List<Future<List<Map<String, Object>>>> futures = new ArrayList<>(partitions);<NEW_LINE>List<Object> partition = new ArrayList<>(batchSize);<NEW_LINE>for (Object o : coll) {<NEW_LINE>partition.add(o);<NEW_LINE>if (partition.size() == batchSize) {<NEW_LINE>futures.add(submit(db, statement, params, key, partition, terminationGuard));<NEW_LINE>partition = new ArrayList<>(batchSize);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!partition.isEmpty()) {<NEW_LINE>futures.add(submit(db, statement, params, key, partition, terminationGuard));<NEW_LINE>}<NEW_LINE>return futures.stream().flatMap(f -> {<NEW_LINE>try {<NEW_LINE>return f.get().stream().map(MapResult::new);<NEW_LINE>} catch (InterruptedException | ExecutionException e) {<NEW_LINE>throw new RuntimeException("Error executing in parallel " + statement, e);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | int total = coll.size(); |
1,322,276 | public JsonStructure forward(MediaContent content) {<NEW_LINE>Media media = content.media;<NEW_LINE>JsonObjectBuilder mediaJson = json.createObjectBuilder();<NEW_LINE>mediaJson.add(FULL_FIELD_NAME_BITRATE, media.bitrate);<NEW_LINE>if (media.copyright == null) {<NEW_LINE>mediaJson.add(FULL_FIELD_NAME_COPYRIGHT, JsonValue.NULL);<NEW_LINE>} else {<NEW_LINE>mediaJson.add(FULL_FIELD_NAME_COPYRIGHT, media.copyright);<NEW_LINE>}<NEW_LINE>mediaJson.add(FULL_FIELD_NAME_DURATION, media.duration);<NEW_LINE>mediaJson.add(FULL_FIELD_NAME_FORMAT, media.format);<NEW_LINE>mediaJson.add(FULL_FIELD_NAME_HEIGHT, media.height);<NEW_LINE>JsonArrayBuilder personsJson = json.createArrayBuilder();<NEW_LINE>for (String person : media.persons) {<NEW_LINE>personsJson.add(person);<NEW_LINE>}<NEW_LINE>mediaJson.add(FULL_FIELD_NAME_PERSONS, personsJson);<NEW_LINE>mediaJson.add(FULL_FIELD_NAME_PLAYER, media.player.name());<NEW_LINE>mediaJson.add(FULL_FIELD_NAME_SIZE, media.size);<NEW_LINE>mediaJson.add(FULL_FIELD_NAME_TITLE, media.title);<NEW_LINE>mediaJson.add(FULL_FIELD_NAME_URI, media.uri);<NEW_LINE>mediaJson.<MASK><NEW_LINE>JsonArrayBuilder imagesJson = json.createArrayBuilder();<NEW_LINE>for (Image image : content.images) {<NEW_LINE>JsonObjectBuilder imageJson = json.createObjectBuilder();<NEW_LINE>imageJson.add(FULL_FIELD_NAME_TITLE, image.title);<NEW_LINE>imageJson.add(FULL_FIELD_NAME_URI, image.uri);<NEW_LINE>imageJson.add(FULL_FIELD_NAME_HEIGHT, image.height);<NEW_LINE>imageJson.add(FULL_FIELD_NAME_WIDTH, image.width);<NEW_LINE>imageJson.add(FULL_FIELD_NAME_SIZE, image.size.name());<NEW_LINE>imagesJson.add(imageJson);<NEW_LINE>}<NEW_LINE>JsonObjectBuilder contentJson = json.createObjectBuilder();<NEW_LINE>contentJson.add(FULL_FIELD_NAME_MEDIA, mediaJson);<NEW_LINE>contentJson.add(FULL_FIELD_NAME_IMAGES, imagesJson);<NEW_LINE>return contentJson.build();<NEW_LINE>} | add(FULL_FIELD_NAME_WIDTH, media.width); |
831,811 | private static EndpointRequest createEndpointRequestData() {<NEW_LINE>HashMap<String, List<String>> customAttributes = new HashMap<>();<NEW_LINE>List<String> favoriteTeams = new ArrayList<>();<NEW_LINE>favoriteTeams.add("Lakers");<NEW_LINE>favoriteTeams.add("Warriors");<NEW_LINE>customAttributes.put("team", favoriteTeams);<NEW_LINE>EndpointDemographic demographic = new EndpointDemographic().withAppVersion("1.0").withMake("apple").withModel("iPhone").withModelVersion("7").withPlatform("ios").withPlatformVersion("10.1.1").withTimezone("America/Los_Angeles");<NEW_LINE>EndpointLocation location = new EndpointLocation().withCity("Los Angeles").withCountry("US").withLatitude(34.0).withLongitude(-118.2).withPostalCode("90068").withRegion("CA");<NEW_LINE>Map<String, Double> metrics = new HashMap<>();<NEW_LINE>metrics.put("health", 100.00);<NEW_LINE>metrics.put("luck", 75.00);<NEW_LINE>EndpointUser user = new EndpointUser().withUserId(UUID.randomUUID().toString());<NEW_LINE>// Quoted "Z" to indicate UTC, no timezone offset<NEW_LINE>DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm'Z'");<NEW_LINE>String nowAsISO = df<MASK><NEW_LINE>EndpointRequest endpointRequest = new EndpointRequest().withAddress(UUID.randomUUID().toString()).withAttributes(customAttributes).withChannelType("APNS").withDemographic(demographic).withEffectiveDate(nowAsISO).withLocation(location).withMetrics(metrics).withOptOut("NONE").withRequestId(UUID.randomUUID().toString()).withUser(user);<NEW_LINE>return endpointRequest;<NEW_LINE>} | .format(new Date()); |
1,603,577 | private void loadNode241() {<NEW_LINE>AddressSpaceFileTypeNode node = new AddressSpaceFileTypeNode(this.context, Identifiers.NamespaceMetadataType_NamespaceFile, new QualifiedName(0, "NamespaceFile"), new LocalizedText("en", "NamespaceFile"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), UByte.valueOf(0));<NEW_LINE>node.addReference(new Reference(Identifiers.NamespaceMetadataType_NamespaceFile, Identifiers.HasProperty, Identifiers.NamespaceMetadataType_NamespaceFile_Size.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.NamespaceMetadataType_NamespaceFile, Identifiers.HasProperty, Identifiers.NamespaceMetadataType_NamespaceFile_Writable.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.NamespaceMetadataType_NamespaceFile, Identifiers.HasProperty, Identifiers.NamespaceMetadataType_NamespaceFile_UserWritable.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.NamespaceMetadataType_NamespaceFile, Identifiers.HasProperty, Identifiers.NamespaceMetadataType_NamespaceFile_OpenCount.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.NamespaceMetadataType_NamespaceFile, Identifiers.HasComponent, Identifiers.NamespaceMetadataType_NamespaceFile_Open.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.NamespaceMetadataType_NamespaceFile, Identifiers.HasComponent, Identifiers.NamespaceMetadataType_NamespaceFile_Close.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.NamespaceMetadataType_NamespaceFile, Identifiers.HasComponent, Identifiers.NamespaceMetadataType_NamespaceFile_Read.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.NamespaceMetadataType_NamespaceFile, Identifiers.HasComponent, Identifiers.NamespaceMetadataType_NamespaceFile_Write.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.NamespaceMetadataType_NamespaceFile, Identifiers.HasComponent, Identifiers.NamespaceMetadataType_NamespaceFile_GetPosition.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.NamespaceMetadataType_NamespaceFile, Identifiers.HasComponent, Identifiers.NamespaceMetadataType_NamespaceFile_SetPosition<MASK><NEW_LINE>node.addReference(new Reference(Identifiers.NamespaceMetadataType_NamespaceFile, Identifiers.HasTypeDefinition, Identifiers.AddressSpaceFileType.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.NamespaceMetadataType_NamespaceFile, Identifiers.HasModellingRule, Identifiers.ModellingRule_Optional.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.NamespaceMetadataType_NamespaceFile, Identifiers.HasComponent, Identifiers.NamespaceMetadataType.expanded(), false));<NEW_LINE>this.nodeManager.addNode(node);<NEW_LINE>} | .expanded(), true)); |
1,035,756 | final ListDeviceFleetsResult executeListDeviceFleets(ListDeviceFleetsRequest listDeviceFleetsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listDeviceFleetsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListDeviceFleetsRequest> request = null;<NEW_LINE>Response<ListDeviceFleetsResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new ListDeviceFleetsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listDeviceFleetsRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "SageMaker");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListDeviceFleets");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListDeviceFleetsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListDeviceFleetsResultJsonUnmarshaller());<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,804,028 | protected void layoutChildren() {<NEW_LINE>super.layoutChildren();<NEW_LINE>double sw = sampleNode.getLayoutBounds().getWidth();<NEW_LINE>double sh = sampleNode.getLayoutBounds().getHeight();<NEW_LINE>double scale = Math.min(getWidth() / sw, getHeight() / sh);<NEW_LINE>if (resizable) {<NEW_LINE>sw *= scale;<NEW_LINE>sh *= scale;<NEW_LINE>if (sampleNode.maxWidth(-1) > 0) {<NEW_LINE>sw = Math.min(sw, sampleNode.maxWidth(-1));<NEW_LINE>}<NEW_LINE>if (sampleNode.maxHeight(-1) > 0) {<NEW_LINE>sh = Math.min(sh, sampleNode.maxHeight(-1));<NEW_LINE>}<NEW_LINE>sampleNode.resizeRelocate(Math.round((getWidth() - sw) / 2), Math.round((getHeight() - sh) / 2), sw, sh);<NEW_LINE>} else {<NEW_LINE>// We never scale up the sample<NEW_LINE>scale = Math.min(1, scale);<NEW_LINE>sampleNode.setScaleX(scale);<NEW_LINE>sampleNode.setScaleY(scale);<NEW_LINE>layoutInArea(sampleNode, 0, 0, getWidth(), getHeight(), 0, <MASK><NEW_LINE>}<NEW_LINE>} | HPos.CENTER, VPos.CENTER); |
1,004,694 | public com.amazonaws.services.dynamodbv2.model.ContinuousBackupsUnavailableException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.dynamodbv2.model.ContinuousBackupsUnavailableException continuousBackupsUnavailableException = new com.amazonaws.services.dynamodbv2.model.ContinuousBackupsUnavailableException(null);<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 null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return continuousBackupsUnavailableException;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
399,543 | private static RecordChangeLogEntry retrieveLogEntry(@NonNull final ResultSet rs, @NonNull final AdTableId tableId) throws SQLException {<NEW_LINE>final POInfo poInfo = POInfo.getPOInfo(tableId);<NEW_LINE>final RecordChangeLogEntryValuesResolver valueResolver = adTabled2RecordChangeLogEntryValuesResolver.getOrLoad(tableId, id -> RecordChangeLogEntryValuesResolver.of(poInfo));<NEW_LINE>final POTrlInfo adColumnTrlInfo = adColumnPOInfo.getTrlInfo();<NEW_LINE>final String columnName = rs.getString("ColumnName");<NEW_LINE>final ITranslatableString columnDisplayName = retrieveColumnDisplayName(rs, adColumnTrlInfo);<NEW_LINE>final Instant changeTimestamp = TimeUtil.asInstant(rs.getTimestamp("Updated"));<NEW_LINE>final UserId changedByUserId = UserId.ofRepoIdOrNull(rs.getInt("UpdatedBy"));<NEW_LINE>final int displayType = rs.getInt("AD_Reference_ID");<NEW_LINE>final Object valueOld = valueResolver.convertToDisplayValue(rs<MASK><NEW_LINE>final Object valueNew = valueResolver.convertToDisplayValue(rs.getString("NewValue"), columnName);<NEW_LINE>return RecordChangeLogEntry.builder().columnName(columnName).columnDisplayName(columnDisplayName).displayType(displayType).valueOld(valueOld).valueNew(valueNew).changedTimestamp(changeTimestamp).changedByUserId(changedByUserId).build();<NEW_LINE>} | .getString("OldValue"), columnName); |
127,351 | public void process(List<List<Map<String, Object>>> resultList, boolean readonly) {<NEW_LINE>DatasourceStatus datasourceStatus = new DatasourceStatus();<NEW_LINE>datasourceStatus.setDbSynStatus(DbSynEnum.DB_SYN_NORMAL);<NEW_LINE>datasourceStatus.setSlaveBehindMaster(false);<NEW_LINE>Map<String, Object> result = resultList.get(0).get(0);<NEW_LINE>boolean master = !readonly && !("1".equalsIgnoreCase(Objects.toString(result.getOrDefault("READ_ONLY", null))));<NEW_LINE>double behind;<NEW_LINE>if (!"ONLINE".equalsIgnoreCase(Objects.toString(result.getOrDefault("MEMBER_STATE", "OFFLINE")))) {<NEW_LINE>heartbeatFlow.setStatus(datasourceStatus, DatasourceEnum.ERROR_STATUS);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>{<NEW_LINE>behind = ((Number) (result.get(<MASK><NEW_LINE>double delay;<NEW_LINE>if ((delay = (behind - heartbeatFlow.getSlaveThreshold())) > 0) {<NEW_LINE>datasourceStatus.setSlaveBehindMaster(true);<NEW_LINE>LOGGER.warn("found MySQL MGR GTID delay !!! " + " delay: " + delay);<NEW_LINE>} else {<NEW_LINE>datasourceStatus.setSlaveBehindMaster(false);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>datasourceStatus.setMaster(master);<NEW_LINE>heartbeatFlow.setStatus(datasourceStatus, DatasourceEnum.OK_STATUS);<NEW_LINE>} | "BEHIND"))).doubleValue(); |
1,173,808 | private void showRenderXMLResponse(SampleResult res) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>results.setContentType("text/xml");<NEW_LINE>results.setCaretPosition(0);<NEW_LINE>byte[] source = res.getResponseData();<NEW_LINE>final ByteArrayInputStream baIS = new ByteArrayInputStream(source);<NEW_LINE>for (int i = 0; i < source.length - XML_PFX.length; i++) {<NEW_LINE>if (JOrphanUtils.startsWith(source, XML_PFX, i)) {<NEW_LINE>// NOSONAR Skip the leading bytes (if any)<NEW_LINE>baIS.skip(i);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>StringWriter sw = new StringWriter();<NEW_LINE>Tidy tidy = XPathUtil.makeTidyParser(true, true, true, sw);<NEW_LINE>org.w3c.dom.Document document = tidy.parseDOM(baIS, null);<NEW_LINE>document.normalize();<NEW_LINE>if (tidy.getParseErrors() > 0) {<NEW_LINE>showErrorMessageDialog(sw.toString(), "Tidy: " + tidy.getParseErrors() + " errors, " + tidy.getParseWarnings() + " warnings", JOptionPane.WARNING_MESSAGE);<NEW_LINE>}<NEW_LINE>JPanel domTreePanel = new DOMTreePanel(document);<NEW_LINE>new <MASK><NEW_LINE>resultsScrollPane.setViewportView(domTreePanel);<NEW_LINE>} | ExpandPopupMenu().add(domTreePanel); |
509,035 | private Mono<Response<Flux<ByteBuffer>>> deleteWithResponseAsync(String resourceGroupName, String galleryName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (galleryName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String apiVersion = "2019-12-01";<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, galleryName, apiVersion, accept, context);<NEW_LINE>} | error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); |
81,448 | public void detectAPILeaks(ASTNode typeNode, TypeBinding type) {<NEW_LINE>if (environment().useModuleSystem) {<NEW_LINE>// NB: using an ASTVisitor yields more precise locations than a TypeBindingVisitor would<NEW_LINE>ASTVisitor visitor = new ASTVisitor() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean visit(SingleTypeReference typeReference, BlockScope scope) {<NEW_LINE>if (typeReference.resolvedType instanceof ReferenceBinding)<NEW_LINE>checkType((ReferenceBinding) typeReference.resolvedType, typeReference.sourceStart, typeReference.sourceEnd);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean visit(QualifiedTypeReference typeReference, BlockScope scope) {<NEW_LINE>if (typeReference.resolvedType instanceof ReferenceBinding)<NEW_LINE>checkType((ReferenceBinding) typeReference.resolvedType, typeReference.sourceStart, typeReference.sourceEnd);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean visit(ArrayTypeReference typeReference, BlockScope scope) {<NEW_LINE>TypeBinding leafComponentType = typeReference.resolvedType.leafComponentType();<NEW_LINE>if (leafComponentType instanceof ReferenceBinding)<NEW_LINE>checkType((ReferenceBinding) leafComponentType, typeReference.sourceStart, typeReference.originalSourceEnd);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE><NEW_LINE>private void checkType(ReferenceBinding referenceBinding, int sourceStart, int sourceEnd) {<NEW_LINE>if (!referenceBinding.isValidBinding())<NEW_LINE>return;<NEW_LINE>ModuleBinding otherModule = referenceBinding.module();<NEW_LINE>if (otherModule == otherModule.environment.javaBaseModule())<NEW_LINE>// always accessible<NEW_LINE>return;<NEW_LINE>if (!isFullyPublic(referenceBinding)) {<NEW_LINE>problemReporter().nonPublicTypeInAPI(referenceBinding, sourceStart, sourceEnd);<NEW_LINE>} else if (!referenceBinding.fPackage.isExported()) {<NEW_LINE>problemReporter().notExportedTypeInAPI(referenceBinding, sourceStart, sourceEnd);<NEW_LINE>} else if (isUnrelatedModule(referenceBinding.fPackage)) {<NEW_LINE>problemReporter().missingRequiresTransitiveForTypeInAPI(referenceBinding, sourceStart, sourceEnd);<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>private boolean isFullyPublic(ReferenceBinding referenceBinding) {<NEW_LINE>if (!referenceBinding.isPublic())<NEW_LINE>return false;<NEW_LINE>if (referenceBinding instanceof NestedTypeBinding)<NEW_LINE>return isFullyPublic((<MASK><NEW_LINE>return true;<NEW_LINE>}<NEW_LINE><NEW_LINE>private boolean isUnrelatedModule(PackageBinding fPackage) {<NEW_LINE>ModuleBinding otherModule = fPackage.enclosingModule;<NEW_LINE>ModuleBinding thisModule = module();<NEW_LINE>if (thisModule != otherModule) {<NEW_LINE>return !thisModule.isTransitivelyRequired(otherModule);<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>typeNode.traverse(visitor, this);<NEW_LINE>}<NEW_LINE>} | (NestedTypeBinding) referenceBinding).enclosingType); |
153,552 | public void init(final InstanceConfig config) {<NEW_LINE>Properties properties = config.getProps();<NEW_LINE>Properties nacosProperties = new Properties();<NEW_LINE>this.groupName = properties.getProperty("groupName", "DEFAULT_GROUP");<NEW_LINE>this.serviceName = properties.getProperty("serviceName", "shenyu-instances");<NEW_LINE>String serverAddr = config.getServerLists();<NEW_LINE>nacosProperties.put(PropertyKeyConst.SERVER_ADDR, serverAddr);<NEW_LINE>nacosProperties.put(PropertyKeyConst.NAMESPACE, properties.getProperty(NAMESPACE, ""));<NEW_LINE>nacosProperties.put(PropertyKeyConst.USERNAME, properties.getProperty<MASK><NEW_LINE>nacosProperties.put(PropertyKeyConst.PASSWORD, properties.getProperty(PropertyKeyConst.PASSWORD, ""));<NEW_LINE>nacosProperties.put(PropertyKeyConst.ACCESS_KEY, properties.getProperty(PropertyKeyConst.ACCESS_KEY, ""));<NEW_LINE>nacosProperties.put(PropertyKeyConst.SECRET_KEY, properties.getProperty(PropertyKeyConst.SECRET_KEY, ""));<NEW_LINE>try {<NEW_LINE>this.namingService = NamingFactory.createNamingService(nacosProperties);<NEW_LINE>} catch (NacosException e) {<NEW_LINE>throw new ShenyuException(e);<NEW_LINE>}<NEW_LINE>} | (PropertyKeyConst.USERNAME, "")); |
1,292,512 | private String guessPackageName(FileObject f) {<NEW_LINE>java.io.Reader r = null;<NEW_LINE>try {<NEW_LINE>// NOI18N<NEW_LINE>r = new BufferedReader(new InputStreamReader(f<MASK><NEW_LINE>boolean noPackage = false;<NEW_LINE>for (; ; ) {<NEW_LINE>String line = ((BufferedReader) r).readLine();<NEW_LINE>if (line == null) {<NEW_LINE>if (noPackage)<NEW_LINE>return "";<NEW_LINE>else<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>line = line.trim();<NEW_LINE>// try to find package<NEW_LINE>if (line.trim().startsWith("package")) {<NEW_LINE>// NOI18N<NEW_LINE>// NOI18N<NEW_LINE>int idx = line.indexOf(";");<NEW_LINE>if (idx >= 0)<NEW_LINE>// NOI18N<NEW_LINE>return line.substring("package".length(), idx).trim();<NEW_LINE>}<NEW_LINE>// an easy check if it is class<NEW_LINE>if (line.indexOf("class") != -1)<NEW_LINE>noPackage = true;<NEW_LINE>}<NEW_LINE>} catch (java.io.IOException ioe) {<NEW_LINE>Logger.getLogger("global").log(Level.INFO, null, ioe);<NEW_LINE>} finally {<NEW_LINE>try {<NEW_LINE>if (r != null)<NEW_LINE>r.close();<NEW_LINE>} catch (java.io.IOException ioe) {<NEW_LINE>// ignore this<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | .getInputStream(), "utf-8")); |
854,581 | final GetWirelessGatewayTaskResult executeGetWirelessGatewayTask(GetWirelessGatewayTaskRequest getWirelessGatewayTaskRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getWirelessGatewayTaskRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetWirelessGatewayTaskRequest> request = null;<NEW_LINE>Response<GetWirelessGatewayTaskResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetWirelessGatewayTaskRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getWirelessGatewayTaskRequest));<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, "IoT Wireless");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetWirelessGatewayTask");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetWirelessGatewayTaskResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetWirelessGatewayTaskResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | endClientExecution(awsRequestMetrics, request, response); |
933,371 | public static String actionURI(HttpServletRequest request) {<NEW_LINE>// Log.info(this, "URI = '"+request.getRequestURI());<NEW_LINE>// Log.info(this, "Context Path = '"+request.getContextPath()+"'");<NEW_LINE>// Log.info(this, "Servlet path = '"+request.getServletPath()+"'");<NEW_LINE>// ServletContext cxt = this.getServletContext();<NEW_LINE>// Log.info(this, "ServletContext path = '"+cxt.getContextPath()+"'");<NEW_LINE>String uri = request.getRequestURI();<NEW_LINE>ServletContext servletCxt = request.getServletContext();<NEW_LINE>if (servletCxt == null)<NEW_LINE>return request.getRequestURI();<NEW_LINE><MASK><NEW_LINE>if (contextPath == null)<NEW_LINE>return uri;<NEW_LINE>if (contextPath.isEmpty())<NEW_LINE>return uri;<NEW_LINE>String x = uri;<NEW_LINE>if (uri.startsWith(contextPath))<NEW_LINE>x = uri.substring(contextPath.length());<NEW_LINE>return x;<NEW_LINE>} | String contextPath = servletCxt.getContextPath(); |
1,335,014 | private File launchReport(MPrintFormat pf, HttpServletRequest request, GridTab m_curTab, MQuery m_query) {<NEW_LINE>int Record_ID = 0;<NEW_LINE>WebSessionCtx wsc = WebSessionCtx.get(request);<NEW_LINE>WWindowStatus <MASK><NEW_LINE>// Instance pInstance = new MPInstance (wsc.ctx, 0, 0);<NEW_LINE>File fileName = null;<NEW_LINE>if (m_query.getRestrictionCount() == 1 && m_query.getCode(0) instanceof Integer) {<NEW_LINE>Record_ID = ((Integer) m_query.getCode(0)).intValue();<NEW_LINE>}<NEW_LINE>PrintInfo info = new PrintInfo(pf.getName(), pf.getAD_Table_ID(), Record_ID);<NEW_LINE>info.setDescription(m_query.getInfo());<NEW_LINE>if (pf != null && pf.getJasperProcess_ID() > 0) {<NEW_LINE>// It's a report using the JasperReports engine<NEW_LINE>ProcessInfo pi = new ProcessInfo("", pf.getJasperProcess_ID());<NEW_LINE>Trx trx = Trx.get(Trx.createTrxName("WebPrc"), true);<NEW_LINE>// Execute Process<NEW_LINE>WProcessCtl.process(this, m_curTab.getAD_Window_ID(), pi, trx, request);<NEW_LINE>} else {<NEW_LINE>// It's a default report using the standard printing engine<NEW_LINE>ReportEngine re = new ReportEngine(wsc.ctx, pf, m_query, info);<NEW_LINE>if (re == null) {<NEW_LINE>log.info("Could not start ReportEngine");<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>File file = File.createTempFile("WProcess", ".pdf");<NEW_LINE>boolean ok = re.createPDF(file);<NEW_LINE>if (ok) {<NEW_LINE>fileName = file;<NEW_LINE>} else {<NEW_LINE>log.info("Could not create Report");<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.info(e.toString());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// doc.addPopupClose(wsc.ctx);<NEW_LINE>// if (m_popup.isVisible())<NEW_LINE>// m_popup.setVisible(false);<NEW_LINE>return fileName;<NEW_LINE>} | ws = WWindowStatus.get(request); |
146,413 | private Future<ZooKeeperAdmin> connect(ZKClientConfig clientConfig) {<NEW_LINE>Promise<ZooKeeperAdmin> connected = Promise.promise();<NEW_LINE>try {<NEW_LINE>ZooKeeperAdmin zkAdmin = zooAdminProvider.createZookeeperAdmin(this.zookeeperConnectionString, zkAdminSessionTimeoutMs, watchedEvent -> LOGGER.debugCr(reconciliation, "Received event {} from ZooKeeperAdmin client connected to {}", watchedEvent, zookeeperConnectionString), clientConfig);<NEW_LINE>Util.waitFor(reconciliation, vertx, String.format("ZooKeeperAdmin connection to %s", zookeeperConnectionString), "connected", 1_000, operationTimeoutMs, () -> zkAdmin.getState().isAlive() && zkAdmin.getState().isConnected()).onSuccess(nothing -> connected.complete(zkAdmin)).onFailure(cause -> {<NEW_LINE>String message = String.format("Failed to connect to Zookeeper %s. Connection was not ready in %d ms.", zookeeperConnectionString, operationTimeoutMs);<NEW_LINE><MASK><NEW_LINE>closeConnection(zkAdmin).onComplete(nothing -> connected.fail(new ZookeeperScalingException(message, cause)));<NEW_LINE>});<NEW_LINE>} catch (IOException e) {<NEW_LINE>LOGGER.warnCr(reconciliation, "Failed to connect to {} to scale Zookeeper", zookeeperConnectionString, e);<NEW_LINE>connected.fail(new ZookeeperScalingException("Failed to connect to Zookeeper " + zookeeperConnectionString, e));<NEW_LINE>}<NEW_LINE>return connected.future();<NEW_LINE>} | LOGGER.warnCr(reconciliation, message); |
456,773 | protected void executeImpl(Connection metaDbConnection, ExecutionContext executionContext) {<NEW_LINE>LOGGER.info(String.format("start write meta during cutOver for primary table: %s.%s", schemaName, logicalTableName));<NEW_LINE>updateSupportedCommands(true, false, metaDbConnection);<NEW_LINE>// allowing use hint to skip clean up stage<NEW_LINE>final String skipCutover = executionContext.getParamManager().getString(ConnectionParams.REPARTITION_SKIP_CUTOVER);<NEW_LINE>if (StringUtils.equalsIgnoreCase(skipCutover, Boolean.TRUE.toString())) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>RepartitionMetaChanger.cutOver(metaDbConnection, schemaName, <MASK><NEW_LINE>FailPoint.injectRandomExceptionFromHint(executionContext);<NEW_LINE>FailPoint.injectRandomSuspendFromHint(executionContext);<NEW_LINE>LOGGER.info(String.format("finish write meta during cutOver for primary table: %s.%s", schemaName, logicalTableName));<NEW_LINE>} | logicalTableName, targetTableName, single, broadcast); |
1,657,171 | public static Tuple2<DenseMatrix, DenseMatrix> calculateLambdaAndAlpha(DenseMatrix lambda, DenseMatrix alpha, DenseMatrix wordTopicStat, DenseMatrix logPhat, long nonEmptyDocsN, int iterNum, double tau0, double kappa, double eta, double subSampleRatio, int numTopic, boolean optimizeDocConcentration) {<NEW_LINE>DenseMatrix expELogBeta = LdaUtil.expDirichletExpectation(lambda).transpose();<NEW_LINE>// the weight given to lambda.<NEW_LINE>double weight = Math.pow(tau0 + iterNum, -kappa);<NEW_LINE>DenseMatrix batchResult = LdaUtil.elementWiseProduct(wordTopicStat, expELogBeta.transpose());<NEW_LINE>// update lambda.<NEW_LINE>lambda = lambda.scale(1 - weight).plus(batchResult.scale(1.0 / subSampleRatio).plus(eta).scale(weight));<NEW_LINE>if (optimizeDocConcentration) {<NEW_LINE>logPhat.scaleEqual(1.0 / nonEmptyDocsN);<NEW_LINE>DenseMatrix gradf = LdaUtil.dirichletExpectationVec(alpha).minus(logPhat).scale(-1.0 * nonEmptyDocsN);<NEW_LINE>double c = nonEmptyDocsN * LdaUtil.trigamma(alpha.sum());<NEW_LINE>DenseMatrix q = LdaUtil.trigamma(alpha).scale(-1.0 * nonEmptyDocsN);<NEW_LINE>DenseMatrix reciprocalQ = LdaUtil.elementWiseDivide(DenseMatrix.ones(numTopic, 1), q);<NEW_LINE>double b = LdaUtil.elementWiseDivide(gradf, q).sum() / (1.0 / c + reciprocalQ.sum());<NEW_LINE>DenseMatrix dAlpha = LdaUtil.elementWiseDivide(gradf.plus(-b), q).scale(-1.0);<NEW_LINE>DenseMatrix tmpAlpha = dAlpha.scale(weight).plus(alpha);<NEW_LINE>for (int i = 0; i < numTopic; i++) {<NEW_LINE>if (tmpAlpha.get(i, 0) <= 0) {<NEW_LINE>return new Tuple2<>(lambda, alpha);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new Tuple2<>(lambda, tmpAlpha);<NEW_LINE>} else {<NEW_LINE>return new <MASK><NEW_LINE>}<NEW_LINE>} | Tuple2<>(lambda, alpha); |
1,137,151 | public void processEvent(SystemEvent event) {<NEW_LINE>Map<String, Object> scope = null;<NEW_LINE>if (event instanceof PreDestroyViewMapEvent) {<NEW_LINE>UIViewRoot viewRoot = (UIViewRoot) ((PreDestroyViewMapEvent) event).getComponent();<NEW_LINE>scope = viewRoot.getViewMap(false);<NEW_LINE>if (scope == null) {<NEW_LINE>// view map does not exist --> nothing to destroy<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} else if (event instanceof PreDestroyCustomScopeEvent) {<NEW_LINE>ScopeContext scopeContext = ((PreDestroyCustomScopeEvent) event).getContext();<NEW_LINE>scope = scopeContext.getScope();<NEW_LINE>} else {<NEW_LINE>// wrong event<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!scope.isEmpty()) {<NEW_LINE>Set<String> keySet = scope.keySet();<NEW_LINE>String[] keys = keySet.toArray(new String[keySet.size()]);<NEW_LINE>for (String key : keys) {<NEW_LINE>Object <MASK><NEW_LINE>this.destroy(key, value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | value = scope.get(key); |
176,124 | private SqlAndParamsExtractor<ImpDataLine> createInsertIntoImportTableSql() {<NEW_LINE>final String tableName = importTableDescriptor.getTableName();<NEW_LINE>final String keyColumnName = importTableDescriptor.getKeyColumnName();<NEW_LINE>final StringBuilder sqlColumns = new StringBuilder();<NEW_LINE>final StringBuilder sqlValues = new StringBuilder();<NEW_LINE>final List<ParametersExtractor<ImpDataLine>> sqlParamsExtractors = new ArrayList<>();<NEW_LINE>sqlColumns.append(keyColumnName);<NEW_LINE>sqlValues.append(DB.TO_TABLESEQUENCE_NEXTVAL(tableName));<NEW_LINE>//<NEW_LINE>// Standard fields<NEW_LINE>sqlColumns.append(", AD_Client_ID");<NEW_LINE>sqlValues.append(", ").append(clientId.getRepoId());<NEW_LINE>//<NEW_LINE>sqlColumns.append(", AD_Org_ID");<NEW_LINE>sqlValues.append(", ").append(orgId.getRepoId());<NEW_LINE>//<NEW_LINE>sqlColumns.append(", Created,CreatedBy,Updated,UpdatedBy,IsActive");<NEW_LINE>sqlValues.append(", now(),").append(userId.getRepoId()).append(",now(),").append(userId.getRepoId()).append(",'Y'");<NEW_LINE>//<NEW_LINE>sqlColumns.append(", Processed, I_IsImported");<NEW_LINE>sqlValues.append(", 'N', 'N'");<NEW_LINE>//<NEW_LINE>// I_LineNo<NEW_LINE>if (importTableDescriptor.getImportLineNoColumnName() != null) {<NEW_LINE>sqlColumns.append(", ").append(importTableDescriptor.getImportLineNoColumnName());<NEW_LINE>sqlValues.append(", ?");<NEW_LINE>sqlParamsExtractors.add(dataLine -> ImmutableList.of(dataLine.getFileLineNo()));<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// I_LineContext<NEW_LINE>if (importTableDescriptor.getImportLineNoColumnName() != null) {<NEW_LINE>sqlColumns.append(", ").append(importTableDescriptor.getImportLineContentColumnName());<NEW_LINE>sqlValues.append(", ?");<NEW_LINE>sqlParamsExtractors.add(dataLine -> Collections.singletonList(dataLine.getLineString()));<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// C_DataImport_Run_ID<NEW_LINE>{<NEW_LINE>Check.assumeNotNull(dataImportRunId, "dataImportRunId is not null");<NEW_LINE>sqlColumns.append(", ").append(ImportTableDescriptor.COLUMNNAME_C_DataImport_Run_ID);<NEW_LINE>sqlValues.append(", ").append(dataImportRunId.getRepoId());<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// C_DataImport_ID<NEW_LINE>if (importTableDescriptor.getDataImportConfigIdColumnName() != null && dataImportConfigId != null) {<NEW_LINE>sqlColumns.append(", ").append(importTableDescriptor.getDataImportConfigIdColumnName());<NEW_LINE>sqlValues.append(", ").append(dataImportConfigId.getRepoId());<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// I_ErrorMsg<NEW_LINE>{<NEW_LINE>final int errorMaxLength = importTableDescriptor.getErrorMsgMaxLength();<NEW_LINE>sqlColumns.append(", ").append(ImportTableDescriptor.COLUMNNAME_I_ErrorMsg);<NEW_LINE>sqlValues.append(", ?");<NEW_LINE>sqlParamsExtractors.add(dataLine -> Collections.singletonList(<MASK><NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Values<NEW_LINE>{<NEW_LINE>for (final ImpFormatColumn column : columns) {<NEW_LINE>sqlColumns.append(", ").append(column.getColumnName());<NEW_LINE>sqlValues.append(", ?");<NEW_LINE>}<NEW_LINE>sqlParamsExtractors.add(dataLine -> dataLine.getJdbcValues(columns));<NEW_LINE>}<NEW_LINE>return SqlAndParamsExtractor.<ImpDataLine>builder().sql("INSERT INTO " + tableName + "(" + sqlColumns + ") VALUES (" + sqlValues + ")").parametersExtractors(sqlParamsExtractors).build();<NEW_LINE>} | dataLine.getErrorMessageAsStringOrNull(errorMaxLength))); |
265,496 | private MultiplexedRequest buildSequential() throws RestLiEncodingException {<NEW_LINE>Map<Integer, Callback<RestResponse>> callbacks = new HashMap<>(_requestsWithCallbacks.size());<NEW_LINE>// Dependent requests - requests which are dependent on the current request (executed after the current request)<NEW_LINE>IndividualRequestMap dependentRequests = new IndividualRequestMap();<NEW_LINE>// We start with the last request in the list and proceed backwards because sequential ordering is built using reverse dependencies<NEW_LINE>for (int i = _requestsWithCallbacks.size() - 1; i >= 0; i--) {<NEW_LINE>RequestWithCallback<?> requestWithCallback = _requestsWithCallbacks.get(i);<NEW_LINE>IndividualRequest individualRequest = toIndividualRequest(requestWithCallback.getRequest(), dependentRequests);<NEW_LINE>dependentRequests = new IndividualRequestMap();<NEW_LINE>dependentRequests.put(Integer.toString(i), individualRequest);<NEW_LINE>callbacks.put(i, wrapCallback(requestWithCallback));<NEW_LINE>}<NEW_LINE>return <MASK><NEW_LINE>} | toMultiplexedRequest(dependentRequests, callbacks, _requestOptions); |
428,254 | public static void openURL(String url) {<NEW_LINE>try {<NEW_LINE>// Since Java6 this is a much easier method to open the browser<NEW_LINE>if (Desktop.isDesktopSupported()) {<NEW_LINE>Desktop desktop = Desktop.getDesktop();<NEW_LINE>desktop.browse(new URI(url));<NEW_LINE>} else // Only if desktop is not supported we try the old main specific code<NEW_LINE>{<NEW_LINE>if (SystemInfo.OS == Os.MAC) {<NEW_LINE>Class<?> <MASK><NEW_LINE>Method openURL = fileMgr.getDeclaredMethod("openURL", new Class[] { String.class });<NEW_LINE>openURL.invoke(null, new Object[] { url });<NEW_LINE>} else if (SystemInfo.OS == Os.WINDOWS) {<NEW_LINE>Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + url);<NEW_LINE>} else {<NEW_LINE>// assume Unix or Linux<NEW_LINE>String[] browsers = { "firefox", "opera", "konqueror", "epiphany", "mozilla", "netscape" };<NEW_LINE>String browser = null;<NEW_LINE>for (int count = 0; count < browsers.length && browser == null; count++) {<NEW_LINE>if (Runtime.getRuntime().exec(new String[] { "which", browsers[count] }).waitFor() == 0) {<NEW_LINE>browser = browsers[count];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (browser == null) {<NEW_LINE>throw new Exception("Could not find web browser");<NEW_LINE>} else {<NEW_LINE>Runtime.getRuntime().exec(new String[] { browser, url });<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.error("Error at opening the URL.", e);<NEW_LINE>}<NEW_LINE>} | fileMgr = Class.forName("com.apple.eio.FileManager"); |
1,402,322 | private ChangeEventType doPoll() {<NEW_LINE>if (Files.exists(path)) {<NEW_LINE>ChangeEventType response;<NEW_LINE>if (exists) {<NEW_LINE>// existed and exists now, let's see if modified<NEW_LINE>Instant instant = Instant.now();<NEW_LINE>try {<NEW_LINE>instant = Files.getLastModifiedTime(path).toInstant();<NEW_LINE>} catch (IOException e) {<NEW_LINE>LOGGER.log(Level.WARNING, "Failed to get last modified for " + <MASK><NEW_LINE>}<NEW_LINE>if (instant.isAfter(this.lastChange)) {<NEW_LINE>this.lastChange = instant;<NEW_LINE>response = ChangeEventType.CHANGED;<NEW_LINE>updater.accept(path);<NEW_LINE>} else {<NEW_LINE>response = ChangeEventType.UNCHANGED;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>response = ChangeEventType.CREATED;<NEW_LINE>updater.accept(path);<NEW_LINE>}<NEW_LINE>exists = true;<NEW_LINE>return response;<NEW_LINE>} else {<NEW_LINE>ChangeEventType response;<NEW_LINE>if (exists) {<NEW_LINE>response = ChangeEventType.DELETED;<NEW_LINE>cleaner.accept(path);<NEW_LINE>} else {<NEW_LINE>response = ChangeEventType.UNCHANGED;<NEW_LINE>}<NEW_LINE>exists = false;<NEW_LINE>return response;<NEW_LINE>}<NEW_LINE>} | path.toAbsolutePath(), e); |
775,976 | public static void inspectMapData(String label, byte[] data, int mode) {<NEW_LINE>if (data == null)<NEW_LINE>return;<NEW_LINE>StringBuilder buffer = new StringBuilder();<NEW_LINE>buffer.append("\n>-----------------------------------------------------------------------------<\n");<NEW_LINE>buffer.append(new SimpleDateFormat("[HH:mm:ss SSS]").format(new Date()));<NEW_LINE>buffer.append(label);<NEW_LINE>buffer.append("\nsize: ").append(data.length).append('\n');<NEW_LINE>int i = 0;<NEW_LINE>for (; i < data.length; i++) {<NEW_LINE>int di = data[i] & 0xFF;<NEW_LINE>if (di != 0) {<NEW_LINE>String hex = Integer.toString(di, 16).toUpperCase();<NEW_LINE>if (hex.length() < 2) {<NEW_LINE>buffer.append('0');<NEW_LINE>}<NEW_LINE>buffer.append(hex);<NEW_LINE>} else {<NEW_LINE>buffer.append(" ");<NEW_LINE>}<NEW_LINE>buffer.append(' ');<NEW_LINE>if ((i + 1) % mode == 0) {<NEW_LINE>buffer.append('\n');<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int redex = mode - i % mode;<NEW_LINE>for (byte k = 0; k < redex && redex < mode; k++) {<NEW_LINE>buffer.append(" ");<NEW_LINE>buffer.append(' ');<NEW_LINE>}<NEW_LINE>int count = i % mode;<NEW_LINE>int start = i - count;<NEW_LINE>if (start < i) {<NEW_LINE>buffer.append(" ");<NEW_LINE>}<NEW_LINE>for (int k = start; k < i; k++) {<NEW_LINE>buffer.append(<MASK><NEW_LINE>}<NEW_LINE>if (redex < mode) {<NEW_LINE>buffer.append('\n');<NEW_LINE>}<NEW_LINE>buffer.append("^-----------------------------------------------------------------------------^");<NEW_LINE>System.out.println(buffer);<NEW_LINE>} | toChar(data[k])); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.