idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
776,042 | public static String createColumnDefinition(TableInfo tableInfo, Field field) {<NEW_LINE>StringBuilder definition = new StringBuilder();<NEW_LINE>Class<?<MASK><NEW_LINE>final String name = tableInfo.getColumnName(field);<NEW_LINE>final TypeSerializer typeSerializer = Cache.getParserForType(field.getType());<NEW_LINE>final Column column = field.getAnnotation(Column.class);<NEW_LINE>if (typeSerializer != null) {<NEW_LINE>type = typeSerializer.getSerializedType();<NEW_LINE>}<NEW_LINE>if (TYPE_MAP.containsKey(type)) {<NEW_LINE>definition.append(name);<NEW_LINE>definition.append(" ");<NEW_LINE>definition.append(TYPE_MAP.get(type).toString());<NEW_LINE>} else if (ReflectionUtils.isModel(type)) {<NEW_LINE>definition.append(name);<NEW_LINE>definition.append(" ");<NEW_LINE>definition.append(SQLiteType.INTEGER.toString());<NEW_LINE>} else if (ReflectionUtils.isSubclassOf(type, Enum.class)) {<NEW_LINE>definition.append(name);<NEW_LINE>definition.append(" ");<NEW_LINE>definition.append(SQLiteType.TEXT.toString());<NEW_LINE>}<NEW_LINE>if (!TextUtils.isEmpty(definition)) {<NEW_LINE>if (name.equals(tableInfo.getIdName())) {<NEW_LINE>definition.append(" PRIMARY KEY AUTOINCREMENT");<NEW_LINE>} else if (column != null) {<NEW_LINE>if (column.length() > -1) {<NEW_LINE>definition.append("(");<NEW_LINE>definition.append(column.length());<NEW_LINE>definition.append(")");<NEW_LINE>}<NEW_LINE>if (column.notNull()) {<NEW_LINE>definition.append(" NOT NULL ON CONFLICT ");<NEW_LINE>definition.append(column.onNullConflict().toString());<NEW_LINE>}<NEW_LINE>if (column.unique()) {<NEW_LINE>definition.append(" UNIQUE ON CONFLICT ");<NEW_LINE>definition.append(column.onUniqueConflict().toString());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (FOREIGN_KEYS_SUPPORTED && ReflectionUtils.isModel(type)) {<NEW_LINE>definition.append(" REFERENCES ");<NEW_LINE>definition.append(Cache.getTableInfo((Class<? extends Model>) type).getTableName());<NEW_LINE>definition.append("(" + tableInfo.getIdName() + ")");<NEW_LINE>definition.append(" ON DELETE ");<NEW_LINE>definition.append(column.onDelete().toString().replace("_", " "));<NEW_LINE>definition.append(" ON UPDATE ");<NEW_LINE>definition.append(column.onUpdate().toString().replace("_", " "));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>Log.e("No type mapping for: " + type.toString());<NEW_LINE>}<NEW_LINE>return definition.toString();<NEW_LINE>} | > type = field.getType(); |
346,575 | private ArgumentBuilder buildArgs(StringToStringMap values, Interface modelItem) {<NEW_LINE>ArgumentBuilder builder = new ArgumentBuilder(values);<NEW_LINE>values.put(XSBTARGET, Tools.ensureDir(values.get(XSBTARGET), ""));<NEW_LINE>values.put(SRCTARGET, Tools.ensureDir(values.get(SRCTARGET), ""));<NEW_LINE>builder.startScript("scomp", ".cmd", "");<NEW_LINE>builder.addString(XSBTARGET, "-d");<NEW_LINE>builder.addString(SRCTARGET, "-src");<NEW_LINE>builder.addString(JARFILE, "-out");<NEW_LINE>builder.addBoolean(SRCONLY, "-srconly");<NEW_LINE>builder.addBoolean(DOWNLOADS, "-dl");<NEW_LINE>builder.addBoolean(NOUPA, "-noupa");<NEW_LINE>builder.addBoolean(NOPVR, "-nopvr");<NEW_LINE>builder.addBoolean(NOANN, "-noann");<NEW_LINE>builder.addBoolean(NOVDOC, "-novdoc");<NEW_LINE>builder.addBoolean(DEBUG, "-debug");<NEW_LINE>builder.addString(JAVASOURCE, "-javasource");<NEW_LINE>builder.addString(ALLOWMDEF, "-allowmdef");<NEW_LINE>builder.addString(CATALOG, "-catalog");<NEW_LINE>builder.addBoolean(VERBOSE, "-verbose");<NEW_LINE>String javac = ToolsSupport.getToolLocator().getJavacLocation(false);<NEW_LINE>if (StringUtils.hasContent(javac)) {<NEW_LINE>builder.addArgs("-compiler", <MASK><NEW_LINE>}<NEW_LINE>addToolArgs(values, builder);<NEW_LINE>builder.addString(XSDCONFIG, null);<NEW_LINE>builder.addArgs(getWsdlUrl(values, modelItem));<NEW_LINE>return builder;<NEW_LINE>} | javac + File.separatorChar + "javac"); |
867,346 | private EditorEx createEditor(Project project, IdeDocumentHistoryImpl.PlaceInfo placeInfo) {<NEW_LINE>RangeMarker positionOffset = placeInfo.getCaretPosition();<NEW_LINE>if (positionOffset == null || !positionOffset.isValid()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>assert positionOffset.getStartOffset() == positionOffset.getEndOffset();<NEW_LINE>Document fileDocument = positionOffset.getDocument();<NEW_LINE>int lineNumber = fileDocument.getLineNumber(positionOffset.getStartOffset());<NEW_LINE>TextRange actualTextRange = getTrimmedRange(fileDocument, lineNumber);<NEW_LINE>CharSequence documentText = fileDocument.getText(actualTextRange);<NEW_LINE>if (actualTextRange.isEmpty()) {<NEW_LINE>documentText = RecentLocationsAction.EMPTY_FILE_TEXT;<NEW_LINE>}<NEW_LINE>EditorFactory editorFactory = EditorFactory.getInstance();<NEW_LINE>Document editorDocument = editorFactory.createDocument(documentText);<NEW_LINE>EditorEx editor = (EditorEx) editorFactory.createEditor(editorDocument, project);<NEW_LINE>EditorGutterComponentEx gutterComponentEx = editor.getGutterComponentEx();<NEW_LINE>int linesShift = fileDocument.getLineNumber(actualTextRange.getStartOffset());<NEW_LINE>gutterComponentEx.setLineNumberConvertor(index -> index + linesShift);<NEW_LINE>gutterComponentEx.setPaintBackground(false);<NEW_LINE>JScrollPane scrollPane = editor.getScrollPane();<NEW_LINE>scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);<NEW_LINE><MASK><NEW_LINE>fillEditorSettings(editor.getSettings());<NEW_LINE>setHighlighting(project, editor, fileDocument, placeInfo, actualTextRange);<NEW_LINE>return editor;<NEW_LINE>} | scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER); |
764,701 | public Set<? extends TCReferable> update(TCReferable definition) {<NEW_LINE>if (definition instanceof TCDefReferable && ((TCDefReferable) definition).getTypechecked() == null) {<NEW_LINE>return Collections.emptySet();<NEW_LINE>}<NEW_LINE>Set<TCReferable> updated = new HashSet<>();<NEW_LINE>Stack<TCReferable> stack = new Stack<>();<NEW_LINE>stack.push(definition);<NEW_LINE>while (!stack.isEmpty()) {<NEW_LINE>TCReferable toUpdate = stack.pop();<NEW_LINE>if (!updated.add(toUpdate)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Set<TCReferable> dependencies;<NEW_LINE>if (toUpdate instanceof MetaReferable) {<NEW_LINE>MetaDefinition metaDef = ((MetaReferable) toUpdate).getDefinition();<NEW_LINE>if (metaDef instanceof DefinableMetaDefinition) {<NEW_LINE>dependencies = new HashSet<>();<NEW_LINE>((DefinableMetaDefinition) metaDef).accept(new CollectDefCallsVisitor(dependencies, true), null);<NEW_LINE>} else {<NEW_LINE>dependencies = null;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>dependencies = myDependencies.remove(toUpdate);<NEW_LINE>}<NEW_LINE>if (dependencies != null) {<NEW_LINE>for (TCReferable dependency : dependencies) {<NEW_LINE>Set<TCReferable> definitions = myReverseDependencies.get(dependency);<NEW_LINE>if (definitions != null) {<NEW_LINE>definitions.remove(definition);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Set<TCReferable> reverseDependencies = myReverseDependencies.remove(toUpdate);<NEW_LINE>if (reverseDependencies != null) {<NEW_LINE>stack.addAll(reverseDependencies);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Set<TCReferable> <MASK><NEW_LINE>for (TCReferable updatedDef : updated) {<NEW_LINE>if (!(updatedDef instanceof TCDefReferable)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Definition def = ((TCDefReferable) updatedDef).getTypechecked();<NEW_LINE>((TCDefReferable) updatedDef).dropAndCancelTypechecking();<NEW_LINE>if (def instanceof ClassDefinition) {<NEW_LINE>for (ClassField field : ((ClassDefinition) def).getPersonalFields()) {<NEW_LINE>field.getReferable().dropAndCancelTypechecking();<NEW_LINE>additional.add(field.getReferable());<NEW_LINE>}<NEW_LINE>} else if (def instanceof DataDefinition) {<NEW_LINE>for (Constructor constructor : ((DataDefinition) def).getConstructors()) {<NEW_LINE>constructor.getReferable().dropAndCancelTypechecking();<NEW_LINE>additional.add(constructor.getReferable());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>updated.addAll(additional);<NEW_LINE>return updated;<NEW_LINE>} | additional = new HashSet<>(); |
970,367 | public void toObjectAsyncTypeReferenceDefaultJsonSerializerGeneric() throws InterruptedException {<NEW_LINE>// BEGIN: com.azure.core.util.BinaryData.toObjectAsync#TypeReference-generic<NEW_LINE>final Person person1 = new Person().setName("John");<NEW_LINE>final Person person2 = new Person().setName("Jack");<NEW_LINE>List<Person> personList = new ArrayList<>();<NEW_LINE>personList.add(person1);<NEW_LINE>personList.add(person2);<NEW_LINE>BinaryData binaryData = BinaryData.fromObject(personList);<NEW_LINE>Disposable subscriber = binaryData.toObjectAsync(new TypeReference<List<Person>>() {<NEW_LINE>}).subscribe(persons -> persons.forEach(person -> System.out.println(<MASK><NEW_LINE>// So that your program wait for above subscribe to complete.<NEW_LINE>TimeUnit.SECONDS.sleep(5);<NEW_LINE>subscriber.dispose();<NEW_LINE>// END: com.azure.core.util.BinaryData.toObjectAsync#TypeReference-generic<NEW_LINE>} | person.getName()))); |
71,951 | public void configureBootstraps(NettyRequestSender requestSender) {<NEW_LINE>final AsyncHttpClientHandler httpHandler = new HttpHandler(config, this, requestSender);<NEW_LINE>wsHandler = new WebSocketHandler(config, this, requestSender);<NEW_LINE>final LoggingHandler loggingHandler = new LoggingHandler(LogLevel.TRACE);<NEW_LINE>httpBootstrap.handler(new ChannelInitializer<Channel>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void initChannel(Channel ch) {<NEW_LINE>ChannelPipeline pipeline = ch.pipeline().addLast(HTTP_CLIENT_CODEC, newHttpClientCodec()).addLast(INFLATER_HANDLER, newHttpContentDecompressor()).addLast(CHUNKED_WRITER_HANDLER, new ChunkedWriteHandler()).addLast(AHC_HTTP_HANDLER, httpHandler);<NEW_LINE>if (LOGGER.isTraceEnabled()) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (config.getHttpAdditionalChannelInitializer() != null)<NEW_LINE>config.getHttpAdditionalChannelInitializer().accept(ch);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>wsBootstrap.handler(new ChannelInitializer<Channel>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void initChannel(Channel ch) {<NEW_LINE>ChannelPipeline pipeline = ch.pipeline().addLast(HTTP_CLIENT_CODEC, newHttpClientCodec()).addLast(AHC_WS_HANDLER, wsHandler);<NEW_LINE>if (config.isEnableWebSocketCompression()) {<NEW_LINE>pipeline.addBefore(AHC_WS_HANDLER, WS_COMPRESSOR_HANDLER, WebSocketClientCompressionHandler.INSTANCE);<NEW_LINE>}<NEW_LINE>if (LOGGER.isDebugEnabled()) {<NEW_LINE>pipeline.addFirst(LOGGING_HANDLER, loggingHandler);<NEW_LINE>}<NEW_LINE>if (config.getWsAdditionalChannelInitializer() != null)<NEW_LINE>config.getWsAdditionalChannelInitializer().accept(ch);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | pipeline.addFirst(LOGGING_HANDLER, loggingHandler); |
675,315 | public static // Note that if the matrix contains large values and of a large size, one may get overflow<NEW_LINE>double determinant(double[][] matrix) {<NEW_LINE>double result = 0.0;<NEW_LINE>if (matrix.length == 1)<NEW_LINE>return determinant(matrix[0]);<NEW_LINE>if (matrix.length == 1 && matrix[0].length == 1)<NEW_LINE>return matrix[0][0];<NEW_LINE>if (matrix.length == 2) {<NEW_LINE>result = matrix[0][0] * matrix[1][1] - matrix[0][1] * matrix[1][0];<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>for (int i = 0; i < matrix[0].length; i++) {<NEW_LINE>double[][] temp = new double[matrix.length - 1][matrix[0].length - 1];<NEW_LINE>for (int j = 1; j < matrix.length; j++) {<NEW_LINE>for (int k = 0; k < matrix[0].length; k++) {<NEW_LINE>if (k < i)<NEW_LINE>temp[j - 1][k] = matrix[j][k];<NEW_LINE>else if (k > i)<NEW_LINE>temp[j - 1][k - 1] <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>result += matrix[0][i] * Math.pow(-1, (double) i) * determinant(temp);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | = matrix[j][k]; |
1,692,859 | final ListLocalDisksResult executeListLocalDisks(ListLocalDisksRequest listLocalDisksRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listLocalDisksRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListLocalDisksRequest> request = null;<NEW_LINE>Response<ListLocalDisksResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListLocalDisksRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listLocalDisksRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Storage Gateway");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListLocalDisks");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListLocalDisksResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListLocalDisksResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden()); |
26,643 | private boolean partialDirRefresh(@Nonnull NewVirtualFileSystem fs, @Nonnull PersistentFS persistence, @Nonnull HashingStrategy<String> strategy, @Nonnull VirtualDirectoryImpl dir) {<NEW_LINE>Pair<List<VirtualFile>, List<String>> snapshot = ReadAction.compute(() -> {<NEW_LINE>checkCancelled(dir);<NEW_LINE>return pair(dir.getCachedChildren(), dir.getSuspiciousNames());<NEW_LINE>});<NEW_LINE>List<VirtualFile> cached = snapshot.getFirst();<NEW_LINE>List<String> wanted = snapshot.getSecond();<NEW_LINE>Interner<String> actualNames = fs.isCaseSensitive() || cached.isEmpty() ? null : Interner.createHashInterner(strategy);<NEW_LINE>if (actualNames != null) {<NEW_LINE>actualNames.internAll(VfsUtil.filterNames(fs.list(dir)));<NEW_LINE>}<NEW_LINE>if (LOG.isTraceEnabled())<NEW_LINE>LOG.trace("cached=" + cached + " actual=" + actualNames + " suspicious=" + wanted);<NEW_LINE>List<Pair<VirtualFile, FileAttributes>> existingMap = new ArrayList<>(cached.size());<NEW_LINE>for (VirtualFile child : cached) {<NEW_LINE>checkCancelled(dir);<NEW_LINE>existingMap.add(pair(child, fs.getAttributes(child)));<NEW_LINE>}<NEW_LINE>List<ChildInfo> newKids = new ArrayList<>(wanted.size());<NEW_LINE>for (String name : wanted) {<NEW_LINE>if (name.isEmpty())<NEW_LINE>continue;<NEW_LINE>checkCancelled(dir);<NEW_LINE>ChildInfo record = <MASK><NEW_LINE>if (record != null) {<NEW_LINE>newKids.add(record);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (isDirectoryChanged(dir, cached, wanted)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>for (Pair<VirtualFile, FileAttributes> pair : existingMap) {<NEW_LINE>NewVirtualFile child = (NewVirtualFile) pair.first;<NEW_LINE>checkCancelled(child);<NEW_LINE>FileAttributes childAttributes = pair.second;<NEW_LINE>if (childAttributes != null) {<NEW_LINE>checkAndScheduleChildRefresh(fs, persistence, dir, child, childAttributes);<NEW_LINE>checkAndScheduleFileNameChange(actualNames, child);<NEW_LINE>} else {<NEW_LINE>myHelper.scheduleDeletion(child);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (ChildInfo record : newKids) {<NEW_LINE>myHelper.scheduleCreation(dir, record.getName().toString(), record.getFileAttributes(), record.getSymLinkTarget(), () -> checkCancelled(dir));<NEW_LINE>}<NEW_LINE>return !isDirectoryChanged(dir, cached, wanted);<NEW_LINE>} | childRecord(fs, dir, name); |
869,252 | private void step() throws IOException {<NEW_LINE>// Handle incoming data.<NEW_LINE>byte[] buffer;<NEW_LINE>synchronized (mReadBufferLock) {<NEW_LINE>buffer = mReadBuffer.array();<NEW_LINE>}<NEW_LINE>int len = mSerialPort.read(buffer, mReadTimeout);<NEW_LINE>if (len > 0) {<NEW_LINE>if (DEBUG) {<NEW_LINE>Log.d(TAG, "Read data len=" + len);<NEW_LINE>}<NEW_LINE>final Listener listener = getListener();<NEW_LINE>if (listener != null) {<NEW_LINE>final byte[] data = new byte[len];<NEW_LINE>System.arraycopy(buffer, <MASK><NEW_LINE>listener.onNewData(data);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Handle outgoing data.<NEW_LINE>buffer = null;<NEW_LINE>synchronized (mWriteBufferLock) {<NEW_LINE>len = mWriteBuffer.position();<NEW_LINE>if (len > 0) {<NEW_LINE>buffer = new byte[len];<NEW_LINE>mWriteBuffer.rewind();<NEW_LINE>mWriteBuffer.get(buffer, 0, len);<NEW_LINE>mWriteBuffer.clear();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (buffer != null) {<NEW_LINE>if (DEBUG) {<NEW_LINE>Log.d(TAG, "Writing data len=" + len);<NEW_LINE>}<NEW_LINE>mSerialPort.write(buffer, mWriteTimeout);<NEW_LINE>}<NEW_LINE>} | 0, data, 0, len); |
199,346 | private static // parses the row to a trade<NEW_LINE>FxNdfTrade parseRow(CsvRow row, TradeInfo info) {<NEW_LINE>CurrencyAmount settlementNotional;<NEW_LINE>Currency settlementCurrency;<NEW_LINE>Currency nonDeliverableCurrency;<NEW_LINE>Optional<String> leg1NotionalOpt = row.findValue(LEG_1_NOTIONAL_FIELD);<NEW_LINE>Optional<String> <MASK><NEW_LINE>if (leg1NotionalOpt.isPresent() && leg2NotionalOpt.isPresent()) {<NEW_LINE>throw new IllegalArgumentException("Notional found for both legs; only one leg can contain notional amount to determine settlement leg");<NEW_LINE>} else if (leg1NotionalOpt.isPresent()) {<NEW_LINE>settlementNotional = CsvLoaderUtils.parseCurrencyAmountWithDirection(row, LEG_1_CURRENCY_FIELD, LEG_1_NOTIONAL_FIELD, LEG_1_DIRECTION_FIELD);<NEW_LINE>settlementCurrency = row.getField(LEG_1_CURRENCY_FIELD, LoaderUtils::parseCurrency);<NEW_LINE>nonDeliverableCurrency = row.getField(LEG_2_CURRENCY_FIELD, LoaderUtils::parseCurrency);<NEW_LINE>} else if (row.findValue(LEG_2_NOTIONAL_FIELD).isPresent()) {<NEW_LINE>settlementNotional = CsvLoaderUtils.parseCurrencyAmountWithDirection(row, LEG_2_CURRENCY_FIELD, LEG_2_NOTIONAL_FIELD, LEG_2_DIRECTION_FIELD);<NEW_LINE>settlementCurrency = row.getField(LEG_2_CURRENCY_FIELD, LoaderUtils::parseCurrency);<NEW_LINE>nonDeliverableCurrency = row.getField(LEG_1_CURRENCY_FIELD, LoaderUtils::parseCurrency);<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("Notional could not be found to determine settlement leg");<NEW_LINE>}<NEW_LINE>PayReceive leg1Direction = row.getValue(LEG_1_DIRECTION_FIELD, LoaderUtils::parsePayReceive);<NEW_LINE>PayReceive leg2Direction = row.getValue(LEG_2_DIRECTION_FIELD, LoaderUtils::parsePayReceive);<NEW_LINE>if (leg1Direction.equals(leg2Direction)) {<NEW_LINE>throw new IllegalArgumentException(Messages.format("FxNdf legs must not have the same direction: {}, {}", leg1Direction, leg2Direction));<NEW_LINE>}<NEW_LINE>CurrencyPair currencyPair = CurrencyPair.of(settlementCurrency, nonDeliverableCurrency);<NEW_LINE>LocalDate paymentDate = row.getField(PAYMENT_DATE_FIELD, LoaderUtils::parseDate);<NEW_LINE>FxRate agreedFxRate = FxRate.of(currencyPair, row.getField(FX_RATE_FIELD, LoaderUtils::parseDouble));<NEW_LINE>FxIndex index = parseFxIndex(row, currencyPair);<NEW_LINE>FxNdf fxNdf = FxNdf.builder().settlementCurrencyNotional(settlementNotional).agreedFxRate(agreedFxRate).index(index).paymentDate(paymentDate).build();<NEW_LINE>return FxNdfTrade.of(info, fxNdf);<NEW_LINE>} | leg2NotionalOpt = row.findValue(LEG_2_NOTIONAL_FIELD); |
88,050 | protected void handleTransportDisconnect(DiscoveryNode node) {<NEW_LINE>synchronized (masterNodeMutex) {<NEW_LINE>if (!node.equals(this.masterNode)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (connectOnNetworkDisconnect) {<NEW_LINE>try {<NEW_LINE>transportService.connectToNode(node);<NEW_LINE>// if all is well, make sure we restart the pinger<NEW_LINE>if (masterPinger != null) {<NEW_LINE>masterPinger.stop();<NEW_LINE>}<NEW_LINE>this.masterPinger = new MasterPinger();<NEW_LINE>// we use schedule with a 0 time value to run the pinger on the pool as it will run on later<NEW_LINE>threadPool.schedule(masterPinger, TimeValue.timeValueMillis(0), ThreadPool.Names.SAME);<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.trace("[master] [{}] transport disconnected (with verified connect)", masterNode);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>logger.trace("[master] [{}] transport disconnected", node);<NEW_LINE>notifyMasterFailure(node, null, "transport disconnected");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | notifyMasterFailure(masterNode, null, "transport disconnected (with verified connect)"); |
44,357 | private Value finish() {<NEW_LINE>if (targetObject != null) {<NEW_LINE>return targetObject;<NEW_LINE>}<NEW_LINE>StringBuilder message = null;<NEW_LINE>for (int i = 0; i < constructorArgs.length; i++) {<NEW_LINE>if (constructorArgs[i] != null)<NEW_LINE>continue;<NEW_LINE>ConstructorArgInfo arg = constructorArgInfos.get(i);<NEW_LINE>if (false == arg.required)<NEW_LINE>continue;<NEW_LINE>if (message == null) {<NEW_LINE>message = new StringBuilder("Required [").append(arg.field);<NEW_LINE>} else {<NEW_LINE>message.append(", ").append(arg.field);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (message != null) {<NEW_LINE>// There were non-optional constructor arguments missing.<NEW_LINE>throw new IllegalArgumentException(message.append<MASK><NEW_LINE>}<NEW_LINE>if (constructorArgInfos.isEmpty()) {<NEW_LINE>throw new ParseException("[" + objectParser.getName() + "] must configure at least one constructor " + "argument. If it doesn't have any it should use ObjectParser instead of ConstructingObjectParser. This is a bug " + "in the parser declaration.");<NEW_LINE>}<NEW_LINE>// All missing constructor arguments were optional. Just build the target and return it.<NEW_LINE>buildTarget();<NEW_LINE>return targetObject;<NEW_LINE>} | (']').toString()); |
1,538,185 | protected void recheckSettings() {<NEW_LINE>if (level == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>BlockPos <MASK><NEW_LINE>solarCheck = new AdvancedSolarCheck(level, topPos);<NEW_LINE>float totalPeak = solarCheck.getPeakMultiplier();<NEW_LINE>for (int i = 0; i < solarChecks.length; i++) {<NEW_LINE>if (i < 3) {<NEW_LINE>solarChecks[i] = new AdvancedSolarCheck(level, topPos.offset(-1, 0, i - 1));<NEW_LINE>} else if (i == 3) {<NEW_LINE>solarChecks[i] = new AdvancedSolarCheck(level, topPos.offset(0, 0, -1));<NEW_LINE>} else if (i == 4) {<NEW_LINE>solarChecks[i] = new AdvancedSolarCheck(level, topPos.offset(0, 0, 1));<NEW_LINE>} else {<NEW_LINE>solarChecks[i] = new AdvancedSolarCheck(level, topPos.offset(1, 0, i - 6));<NEW_LINE>}<NEW_LINE>totalPeak += solarChecks[i].getPeakMultiplier();<NEW_LINE>}<NEW_LINE>peakOutput = getConfiguredMax().multiply(totalPeak / 9);<NEW_LINE>} | topPos = worldPosition.above(2); |
778,057 | public void createPartControl(Composite parent) {<NEW_LINE>Server server = ServerManager.getInstance().getServer(serverId);<NEW_LINE>ActiveDbInfo activeDBList = ActiveDbInfo.getInstance();<NEW_LINE>if (server != null) {<NEW_LINE>this.setPartName("CUBRID ServerInfo" + "[" + server.getName() + "]");<NEW_LINE>activeDBList.addServerInfo(serverId);<NEW_LINE>} else {<NEW_LINE>this.setPartName("CUBRID ServerInfo");<NEW_LINE>}<NEW_LINE>Composite tableComposite = new Composite(parent, SWT.NONE);<NEW_LINE>tableColumnLayout = new TableColumnLayout();<NEW_LINE>tableComposite.setLayout(tableColumnLayout);<NEW_LINE>tableViewer = new TableViewer(tableComposite, SWT.MULTI | SWT.FULL_SELECTION | SWT.BORDER);<NEW_LINE>tableViewer.setComparator(new TableLabelSorter(tableViewer));<NEW_LINE>tableViewer.setUseHashlookup(true);<NEW_LINE>tableViewer.getTable().setLinesVisible(true);<NEW_LINE>tableViewer.getTable().setHeaderVisible(true);<NEW_LINE>createColumns();<NEW_LINE>tableViewer<MASK><NEW_LINE>tableViewer.setLabelProvider(new ITableLabelProvider() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void removeListener(ILabelProviderListener arg0) {<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean isLabelProperty(Object arg0, String arg1) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void dispose() {<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void addListener(ILabelProviderListener arg0) {<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String getColumnText(Object arg0, int arg1) {<NEW_LINE>ServerInfo info = (ServerInfo) arg0;<NEW_LINE>switch(arg1) {<NEW_LINE>case 0:<NEW_LINE>return info.dbName;<NEW_LINE>case 1:<NEW_LINE>return info.ipAddress;<NEW_LINE>case 2:<NEW_LINE>return info.cpuUsed + "%";<NEW_LINE>case 3:<NEW_LINE>return info.activeSession;<NEW_LINE>case 4:<NEW_LINE>return info.lockWaitSession;<NEW_LINE>}<NEW_LINE>return "";<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Image getColumnImage(Object arg0, int arg1) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>createTableContextMenu();<NEW_LINE>thread = new RefreshThread(this, REFRESH_INTERVAL);<NEW_LINE>thread.start();<NEW_LINE>} | .setContentProvider(new ArrayContentProvider()); |
911,062 | public Object convert(Class type, Object value) {<NEW_LINE>Object result;<NEW_LINE>Object factory = objectFactory(destObjClass, beanContainer);<NEW_LINE>Class<?> factoryClass = factory.getClass();<NEW_LINE>Class<?> destClass = value.getClass();<NEW_LINE>Class<?> valueClass = value.getClass();<NEW_LINE>String methodName = "create" + destObjClass.substring(destObjClass.lastIndexOf(".") + 1) + StringUtils.capitalize(destFieldName);<NEW_LINE>Method method = null;<NEW_LINE>try {<NEW_LINE>method = ReflectionUtils.findAMethod(factoryClass, methodName, beanContainer);<NEW_LINE>Class<?>[] parameterTypes = method.getParameterTypes();<NEW_LINE>for (Class<?> parameterClass : parameterTypes) {<NEW_LINE>if (!valueClass.equals(parameterClass)) {<NEW_LINE>destClass = parameterClass;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Class<?>[] paramTypes = { destClass };<NEW_LINE>method = ReflectionUtils.getMethod(factoryClass, methodName, paramTypes);<NEW_LINE>} catch (NoSuchMethodException e) {<NEW_LINE>MappingUtils.throwMappingException(e);<NEW_LINE>}<NEW_LINE>Object param = value;<NEW_LINE>Converter converter;<NEW_LINE>if (java.util.Date.class.isAssignableFrom(valueClass) && !destClass.equals(XMLGregorianCalendar.class)) {<NEW_LINE>converter = new DateConverter(dateFormat);<NEW_LINE>param = <MASK><NEW_LINE>} else if (java.util.Calendar.class.isAssignableFrom(valueClass) && !destClass.equals(XMLGregorianCalendar.class)) {<NEW_LINE>converter = new CalendarConverter(dateFormat);<NEW_LINE>param = converter.convert(destClass, param);<NEW_LINE>} else if (XMLGregorianCalendar.class.isAssignableFrom(valueClass) || XMLGregorianCalendar.class.isAssignableFrom(destClass)) {<NEW_LINE>converter = new XMLGregorianCalendarConverter(dateFormat);<NEW_LINE>param = converter.convert(destClass, param);<NEW_LINE>}<NEW_LINE>Object[] paramValues = { param };<NEW_LINE>result = ReflectionUtils.invoke(method, factory, paramValues);<NEW_LINE>return result;<NEW_LINE>} | converter.convert(destClass, param); |
1,731,153 | public void testBeanSubmitsManagedTaskThatInvokesTxNever() throws Exception {<NEW_LINE>Future<?> future = submitterBean.submit(new Callable<Object>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Object call() throws Exception {<NEW_LINE>Object beanTxKey = bean.runAsNever();<NEW_LINE>if (beanTxKey != null)<NEW_LINE>throw new Exception("TX_NEVER should not run in a transaction: " + beanTxKey);<NEW_LINE>UserTransaction tran = (UserTransaction) new InitialContext().lookup("java:comp/UserTransaction");<NEW_LINE>tran.begin();<NEW_LINE>try {<NEW_LINE>bean.runAsNever();<NEW_LINE>throw new Exception("Should not be able to invoke TX_NEVER method when there is a transaction on the thread");<NEW_LINE>} catch (/* Transactional */<NEW_LINE>Exception x) {<NEW_LINE>if (x.getMessage() == null && !x.getMessage().contains("TX_NEVER"))<NEW_LINE>throw x;<NEW_LINE>} finally {<NEW_LINE>tran.commit();<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>try {<NEW_LINE>future.<MASK><NEW_LINE>} finally {<NEW_LINE>future.cancel(true);<NEW_LINE>}<NEW_LINE>} | get(TIMEOUT, TimeUnit.MILLISECONDS); |
1,054,599 | private static Component.Builder makeTransparencyEnabledCardClip(ComponentContext c, int backgroundColor, @Nullable DynamicValue<Integer> backgroundColorDv, int clippingColor, float cornerRadius, boolean disableClipTopLeft, boolean disableClipTopRight, boolean disableClipBottomLeft, boolean disableClipBottomRight, @Nullable String cardBackgroundTransitionKey) {<NEW_LINE>Component.Builder transparencyEnabledCardClipBuilder = TransparencyEnabledCardClip.create(c).cardBackgroundColor(backgroundColor).cardBackgroundColorDv(backgroundColorDv).clippingColor(clippingColor).cornerRadiusPx(cornerRadius).disableClipBottomLeft(disableClipBottomLeft).disableClipBottomRight(disableClipBottomRight).disableClipTopLeft(disableClipTopLeft).disableClipTopRight(disableClipTopRight).positionType(ABSOLUTE).positionPx(ALL, 0).transitionKey(cardBackgroundTransitionKey).transitionKeyType(Transition.TransitionKeyType.GLOBAL);<NEW_LINE>if ((disableClipBottomLeft || disableClipBottomRight || disableClipTopLeft || disableClipTopRight) && clippingColor == Color.TRANSPARENT) {<NEW_LINE>// For any of the above enclosing conditions, the TransparencyEnabledDrawable implementation<NEW_LINE>// relies on PorterDuffXfermode which only works on view layer type software<NEW_LINE>transparencyEnabledCardClipBuilder.<MASK><NEW_LINE>}<NEW_LINE>return transparencyEnabledCardClipBuilder;<NEW_LINE>} | layerType(LayerType.LAYER_TYPE_SOFTWARE, null); |
1,211,792 | public Object apply(final ActionContext ctx, final Object caller, Object[] sources) throws FrameworkException {<NEW_LINE>final SecurityContext securityContext = SecurityContext.getSuperUserInstance();<NEW_LINE>try {<NEW_LINE>if (sources == null) {<NEW_LINE>throw new IllegalArgumentException();<NEW_LINE>}<NEW_LINE>final ConfigurationProvider config = StructrApp.getConfiguration();<NEW_LINE>final App app = StructrApp.getInstance(securityContext);<NEW_LINE>final Query query = app.nodeQuery();<NEW_LINE>// the type to query for<NEW_LINE>Class type = null;<NEW_LINE>if (sources.length >= 1 && sources[0] != null) {<NEW_LINE>final String typeString = sources[0].toString();<NEW_LINE>type = config.getNodeEntityClass(typeString);<NEW_LINE>if (type != null) {<NEW_LINE>query.andTypes(type);<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>return ERROR_MESSAGE_PRIVILEGEDFIND_TYPE_NOT_FOUND + typeString;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// exit gracefully instead of crashing..<NEW_LINE>if (type == null) {<NEW_LINE>logger.warn("Error in find_privileged(): no type specified. Parameters: {}", getParametersAsString(sources));<NEW_LINE>return ERROR_MESSAGE_PRIVILEGEDFIND_NO_TYPE_SPECIFIED;<NEW_LINE>}<NEW_LINE>// apply sorting and pagination by surrounding sort() and slice() expressions<NEW_LINE>applyQueryParameters(securityContext, query);<NEW_LINE>return handleQuerySources(securityContext, type, query, sources, true, usage(ctx.isJavaScriptContext()));<NEW_LINE>} catch (final IllegalArgumentException e) {<NEW_LINE>logParameterError(caller, sources, ctx.isJavaScriptContext());<NEW_LINE>return usage(ctx.isJavaScriptContext());<NEW_LINE>} finally {<NEW_LINE>resetQueryParameters(securityContext);<NEW_LINE>}<NEW_LINE>} | logger.warn("Error in find_privileged(): type '{}' not found.", typeString); |
1,170,675 | private MockValue call(Jooby router, String method, String path, Context ctx, Consumer<MockResponse> consumer) {<NEW_LINE>MockContext findContext = ctx instanceof MockContext ? (MockContext) ctx : newContext();<NEW_LINE>findContext.setMethod(method.toUpperCase());<NEW_LINE>findContext.setRequestPath(path);<NEW_LINE>findContext.setRouter(router);<NEW_LINE>findContext.setConsumer(consumer);<NEW_LINE>findContext.setMockRouter(this);<NEW_LINE>Router.Match match = router.match(findContext);<NEW_LINE>Route route = match.route();<NEW_LINE>boolean isCoroutine = route.attribute("coroutine") == Boolean.TRUE;<NEW_LINE>if (isCoroutine) {<NEW_LINE>router.setWorker(Optional.ofNullable(getWorker()).orElseGet(MockRouter::singleThreadWorker));<NEW_LINE>}<NEW_LINE>findContext.<MASK><NEW_LINE>findContext.setRoute(route);<NEW_LINE>Object value;<NEW_LINE>try {<NEW_LINE>Route.Handler handler = fullExecution ? route.getPipeline() : route.getHandler();<NEW_LINE>if (route.getMethod().equals(Router.WS)) {<NEW_LINE>WebSocket.Initializer initializer = (WebSocket.Initializer) route.getHandle();<NEW_LINE>MockWebSocketConfigurer configurer = new MockWebSocketConfigurer(ctx, initializer);<NEW_LINE>return new SingleMockValue(configurer);<NEW_LINE>} else {<NEW_LINE>value = handler.apply(ctx);<NEW_LINE>if (ctx instanceof MockContext) {<NEW_LINE>MockResponse response = ((MockContext) ctx).getResponse();<NEW_LINE>Object responseValue;<NEW_LINE>if (isCoroutine) {<NEW_LINE>response.getLatch().await();<NEW_LINE>responseValue = response.value();<NEW_LINE>} else {<NEW_LINE>if (value != null && !(value instanceof Context)) {<NEW_LINE>response.setResult(value);<NEW_LINE>}<NEW_LINE>responseValue = Optional.ofNullable(response.value()).orElse(value);<NEW_LINE>}<NEW_LINE>if (response.getContentLength() <= 0) {<NEW_LINE>response.setContentLength(contentLength(responseValue));<NEW_LINE>}<NEW_LINE>consumer.accept(response);<NEW_LINE>return new SingleMockValue(responseValue);<NEW_LINE>}<NEW_LINE>return new SingleMockValue(value);<NEW_LINE>}<NEW_LINE>} catch (Exception x) {<NEW_LINE>throw SneakyThrows.propagate(x);<NEW_LINE>}<NEW_LINE>} | setPathMap(match.pathMap()); |
1,488,781 | public com.amazonaws.services.clouddirectory.model.NotNodeException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.clouddirectory.model.NotNodeException notNodeException = new com.amazonaws.services.clouddirectory.model.NotNodeException(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 notNodeException;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
662,166 | protected static void _addConnectors(PyObject dict) throws PyException {<NEW_LINE>PyObject connector = Py.None;<NEW_LINE>Properties props = new Properties();<NEW_LINE>props.put("connect", "com.ziclix.python.sql.connect.Connect");<NEW_LINE>props.put("lookup", "com.ziclix.python.sql.connect.Lookup");<NEW_LINE>props.put("connectx", "com.ziclix.python.sql.connect.Connectx");<NEW_LINE>Enumeration<?> names = props.propertyNames();<NEW_LINE>while (names.hasMoreElements()) {<NEW_LINE>String name = ((String) names.<MASK><NEW_LINE>String className = props.getProperty(name).trim();<NEW_LINE>try {<NEW_LINE>connector = (PyObject) Class.forName(className).getDeclaredConstructor().newInstance();<NEW_LINE>dict.__setitem__(name, connector);<NEW_LINE>Py.writeComment("zxJDBC", "loaded connector [" + className + "] as [" + name + "]");<NEW_LINE>} catch (Throwable t) {<NEW_LINE>Py.writeComment("zxJDBC", "failed to load connector [" + name + "] using class [" + className + "]");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | nextElement()).trim(); |
934,708 | public ResponseData<String> send(TransmissionRequest<?> request) {<NEW_LINE>try {<NEW_LINE>logger.info("[HttpTransmission.send] this is http transmission and the service type is: {}", request.getServiceType());<NEW_LINE>if (request.getTransType() != TransType.HTTP && request.getTransType() != TransType.HTTPS) {<NEW_LINE>throw new WeIdBaseException("the transmission type error.");<NEW_LINE>}<NEW_LINE>TransmissionlRequestWarp<?> requestWarp = super.authTransmission(request);<NEW_LINE>Map<String, String> params = new HashMap<String, String>();<NEW_LINE>params.put(REQUEST_DATA, requestWarp.getEncodeData());<NEW_LINE>params.put(REQUEST_CHANNEL_ID, requestWarp.getWeIdAuthObj().getChannelId());<NEW_LINE>String result = null;<NEW_LINE>if (request.getTransType() == TransType.HTTP) {<NEW_LINE>result = HttpClient.<MASK><NEW_LINE>} else {<NEW_LINE>result = HttpClient.doPost("", params, true);<NEW_LINE>}<NEW_LINE>return new ResponseData<String>(result, ErrorCode.SUCCESS);<NEW_LINE>} catch (WeIdBaseException e) {<NEW_LINE>logger.error("[HttpTransmission.send] send http fail.", e);<NEW_LINE>return new ResponseData<String>(StringUtils.EMPTY, e.getErrorCode());<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.error("[HttpTransmission.send] send http due to unknown error.", e);<NEW_LINE>return new ResponseData<String>(StringUtils.EMPTY, ErrorCode.UNKNOW_ERROR);<NEW_LINE>}<NEW_LINE>} | doPost("", params, false); |
1,564,182 | private boolean isProcessQueueItem(final PrintArchiveParameters printArchiveParameters) {<NEW_LINE>if (printArchiveParameters.isEnforceEnqueueToPrintQueue()) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>final de.metas.printing.model.I_AD_Archive archive = printArchiveParameters.getArchive();<NEW_LINE>// If we are explicitly asked to create a print job, then do it<NEW_LINE>if (archive.isDirectProcessQueueItem()) {<NEW_LINE>logger.debug("IsProcessQueueItem - AD_Archive.IsDirectProcessQueueItem=true; -> return true");<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (archive.getC_Doc_Outbound_Config_ID() > 0) {<NEW_LINE>final I_C_Doc_Outbound_Config config = InterfaceWrapperHelper.create(archive.getC_Doc_Outbound_Config(), I_C_Doc_Outbound_Config.class);<NEW_LINE>if (config.isDirectProcessQueueItem()) {<NEW_LINE>logger.debug(<MASK><NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Backward compatibility: If this is a generic archive we are always creating a print job directly.<NEW_LINE>// This is because old code rely on this logic (at that time there was no IsCreatePrintJob flag).<NEW_LINE>if (isGenericArchive(archive)) {<NEW_LINE>logger.debug("IsProcessQueueItem - AD_Archive is a generic archive without record reference; -> return true");<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>logger.debug("IsProcessQueueItem - none of the conditions applied -> return false");<NEW_LINE>return false;<NEW_LINE>} | "IsProcessQueueItem - AD_Archive has C_Doc_Outbound_Config_ID={} which has IsDirectProcessQueueItem=true; -> return true", archive.getC_Doc_Outbound_Config_ID()); |
1,616,071 | private static boolean isInstanceOf(FileObject f, Class clazz, boolean exactMatch) {<NEW_LINE>try {<NEW_LINE>DataObject d = DataObject.find(f);<NEW_LINE>InstanceCookie ic = d.getLookup().lookup(InstanceCookie.class);<NEW_LINE>if (ic != null) {<NEW_LINE>if (ic instanceof InstanceCookie.Of) {<NEW_LINE>if (!exactMatch) {<NEW_LINE>return ((InstanceCookie.Of) ic).instanceOf(clazz);<NEW_LINE>} else {<NEW_LINE>if (!((InstanceCookie.Of) ic).instanceOf(clazz)) {<NEW_LINE>return false;<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>Class instanceClass = ic.instanceClass();<NEW_LINE>if (!exactMatch) {<NEW_LINE>if (clazz.isAssignableFrom(instanceClass)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (clazz == instanceClass) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>// ignore<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | return ic.instanceClass() == clazz; |
36,484 | public HttpResponse testBodyWithFileSchemaForHttpResponse(FileSchemaTestClass body, Map<String, Object> params) throws IOException {<NEW_LINE>// verify the required parameter 'body' is set<NEW_LINE>if (body == null) {<NEW_LINE>throw new IllegalArgumentException("Missing the required parameter 'body' when calling testBodyWithFileSchema");<NEW_LINE>}<NEW_LINE>UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake/body-with-file-schema");<NEW_LINE>// Copy the params argument if present, to allow passing in immutable maps<NEW_LINE>Map<String, Object> allParams = params == null ? new HashMap<String, Object>() : new HashMap<String, Object>(params);<NEW_LINE>for (Map.Entry<String, Object> entry : allParams.entrySet()) {<NEW_LINE>String key = entry.getKey();<NEW_LINE>Object value = entry.getValue();<NEW_LINE>if (key != null && value != null) {<NEW_LINE>if (value instanceof Collection) {<NEW_LINE>uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());<NEW_LINE>} else if (value instanceof Object[]) {<NEW_LINE>uriBuilder = uriBuilder.queryParam(key<MASK><NEW_LINE>} else {<NEW_LINE>uriBuilder = uriBuilder.queryParam(key, value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String localVarUrl = uriBuilder.build().toString();<NEW_LINE>GenericUrl genericUrl = new GenericUrl(localVarUrl);<NEW_LINE>HttpContent content = apiClient.new JacksonJsonHttpContent(body);<NEW_LINE>return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.PUT, genericUrl, content).execute();<NEW_LINE>} | , (Object[]) value); |
543,176 | public void parse(byte[] vmsdFileContent) throws IOException {<NEW_LINE>BufferedReader in = null;<NEW_LINE>try {<NEW_LINE>in = new BufferedReader(new InputStreamReader(new ByteArrayInputStream(vmsdFileContent), "UTF-8"));<NEW_LINE>String line;<NEW_LINE>while ((line = in.readLine()) != null) {<NEW_LINE>// TODO, remember to remove this log, temporarily added for debugging purpose<NEW_LINE>s_logger.info("Parse snapshot file content: " + line);<NEW_LINE>String[] tokens = line.split("=");<NEW_LINE>if (tokens.length == 2) {<NEW_LINE>String name = tokens[0].trim();<NEW_LINE>String value = tokens[1].trim();<NEW_LINE>if (value.charAt(0) == '\"')<NEW_LINE>value = value.substring(1, value.length() - 1);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>if (in != null)<NEW_LINE>in.close();<NEW_LINE>}<NEW_LINE>} | _properties.put(name, value); |
526,210 | public void run(RegressionEnvironment env) {<NEW_LINE>String stmtTextSet = "@name('set') on SupportBean set var1OND = intPrimitive, var2OND = var1OND + 1, var3OND = var1OND + var2OND";<NEW_LINE>env.compileDeploy(stmtTextSet).addListener("set");<NEW_LINE>String[] fieldsVar = new String[] { "var1OND", "var2OND", "var3OND" };<NEW_LINE>env.assertPropsPerRowIterator("set", fieldsVar, new Object[][] { { 12, 2, null } });<NEW_LINE>sendSupportBean(env, "S1", 3);<NEW_LINE>env.assertPropsNew("set", fieldsVar, new Object[] { 3, 4, 7 });<NEW_LINE>env.assertPropsPerRowIterator("set", fieldsVar, new Object[][] { { <MASK><NEW_LINE>env.milestone(0);<NEW_LINE>sendSupportBean(env, "S1", -1);<NEW_LINE>env.assertPropsNew("set", fieldsVar, new Object[] { -1, 0, -1 });<NEW_LINE>env.assertPropsPerRowIterator("set", fieldsVar, new Object[][] { { -1, 0, -1 } });<NEW_LINE>sendSupportBean(env, "S1", 90);<NEW_LINE>env.assertPropsNew("set", fieldsVar, new Object[] { 90, 91, 181 });<NEW_LINE>env.assertPropsPerRowIterator("set", fieldsVar, new Object[][] { { 90, 91, 181 } });<NEW_LINE>env.undeployAll();<NEW_LINE>} | 3, 4, 7 } }); |
23,242 | static void writeAar(Path aar, final MergedAndroidData data, Path manifest, Path rtxt, Path classes, List<Path> proguardSpecs) throws IOException {<NEW_LINE>try (final ZipOutputStream zipOut = new ZipOutputStream(new BufferedOutputStream(Files.newOutputStream(aar)))) {<NEW_LINE><MASK><NEW_LINE>manifestEntry.setTime(DEFAULT_TIMESTAMP);<NEW_LINE>zipOut.putNextEntry(manifestEntry);<NEW_LINE>zipOut.write(Files.readAllBytes(manifest));<NEW_LINE>zipOut.closeEntry();<NEW_LINE>ZipEntry classJar = new ZipEntry("classes.jar");<NEW_LINE>classJar.setTime(DEFAULT_TIMESTAMP);<NEW_LINE>zipOut.putNextEntry(classJar);<NEW_LINE>zipOut.write(Files.readAllBytes(classes));<NEW_LINE>zipOut.closeEntry();<NEW_LINE>ZipDirectoryWriter resWriter = new ZipDirectoryWriter(zipOut, data.getResourceDir(), "res");<NEW_LINE>Files.walkFileTree(data.getResourceDir(), resWriter);<NEW_LINE>resWriter.writeEntries();<NEW_LINE>ZipEntry r = new ZipEntry("R.txt");<NEW_LINE>r.setTime(DEFAULT_TIMESTAMP);<NEW_LINE>zipOut.putNextEntry(r);<NEW_LINE>zipOut.write(Files.readAllBytes(rtxt));<NEW_LINE>zipOut.closeEntry();<NEW_LINE>if (!proguardSpecs.isEmpty()) {<NEW_LINE>ZipEntry proguardTxt = new ZipEntry("proguard.txt");<NEW_LINE>proguardTxt.setTime(DEFAULT_TIMESTAMP);<NEW_LINE>zipOut.putNextEntry(proguardTxt);<NEW_LINE>for (Path proguardSpec : proguardSpecs) {<NEW_LINE>zipOut.write(Files.readAllBytes(proguardSpec));<NEW_LINE>zipOut.write("\r\n".getBytes(UTF_8));<NEW_LINE>}<NEW_LINE>zipOut.closeEntry();<NEW_LINE>}<NEW_LINE>if (Files.exists(data.getAssetDir()) && data.getAssetDir().toFile().list().length > 0) {<NEW_LINE>ZipDirectoryWriter assetWriter = new ZipDirectoryWriter(zipOut, data.getAssetDir(), "assets");<NEW_LINE>Files.walkFileTree(data.getAssetDir(), assetWriter);<NEW_LINE>assetWriter.writeEntries();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>aar.toFile().setLastModified(DEFAULT_TIMESTAMP);<NEW_LINE>} | ZipEntry manifestEntry = new ZipEntry("AndroidManifest.xml"); |
1,673,983 | private static // Remove when QuadPatterns roll through from ARQ.<NEW_LINE>void formatQuads(IndentedLineBuffer out, QuadPattern quads) {<NEW_LINE>SerializationContext sCxt = SSE.sCxt(SSE.getPrefixMapWrite());<NEW_LINE>boolean first = true;<NEW_LINE>for (Quad qp : quads) {<NEW_LINE>if (!first) {<NEW_LINE>if (!MultiLinesForPatterns)<NEW_LINE>out.print(" ");<NEW_LINE>} else<NEW_LINE>first = false;<NEW_LINE>out.print("(");<NEW_LINE>if (qp.getGraph() == null)<NEW_LINE>out.print("_");<NEW_LINE>else<NEW_LINE>WriterNode.output(out, qp.getGraph(), sCxt);<NEW_LINE>out.print(" ");<NEW_LINE>WriterNode.output(out, <MASK><NEW_LINE>out.print(" ");<NEW_LINE>WriterNode.output(out, qp.getPredicate(), sCxt);<NEW_LINE>out.print(" ");<NEW_LINE>WriterNode.output(out, qp.getObject(), sCxt);<NEW_LINE>out.print(")");<NEW_LINE>if (MultiLinesForPatterns)<NEW_LINE>out.println();<NEW_LINE>}<NEW_LINE>} | qp.getSubject(), sCxt); |
948,756 | protected void initChannel(Channel ch) {<NEW_LINE>ChannelPipeline pipeline = ch.pipeline();<NEW_LINE>pipeline.addLast(new LoggingHandler());<NEW_LINE>pipeline.addLast("http-client-codec", new HttpClientCodec());<NEW_LINE>if (gzipEnabled) {<NEW_LINE>pipeline.addLast(encoderEventLoopGroup, <MASK><NEW_LINE>}<NEW_LINE>pipeline.addLast("http-object-aggregator", new HttpObjectAggregator(httpChunkSize));<NEW_LINE>pipeline.addLast("write-timeout-handler", new WriteTimeoutHandler(writeTimeoutSeconds));<NEW_LINE>pipeline.addLast("mantis-event-aggregator", new MantisEventAggregator(registry, Clock.systemUTC(), gzipEnabled, flushIntervalMs, flushIntervalBytes));<NEW_LINE>pipeline.addLast("idle-channel-handler", new IdleStateHandler(0, idleTimeoutSeconds, 0));<NEW_LINE>pipeline.addLast("event-channel-handler", new HttpEventChannelHandler(registry));<NEW_LINE>LOG.debug("initializing channel with pipeline: {}", pipeline.toMap());<NEW_LINE>} | "gzip-encoder", new GzipEncoder(registry)); |
981,908 | private double calculateExprValue(int id, BitSet types, ParameterContext paramContext) {<NEW_LINE>String value = values[id];<NEW_LINE>Number cacheValue = cacheValues[id];<NEW_LINE>if (cacheValue != null) {<NEW_LINE>return cacheValue.doubleValue();<NEW_LINE>}<NEW_LINE>Object o = null;<NEW_LINE>if (value instanceof String && value.toString().startsWith("$")) {<NEW_LINE>BitSet mask = tagRuleMask.get(value.toString().substring(1));<NEW_LINE>if (mask != null && mask.intersects(types)) {<NEW_LINE>BitSet findBit = new <MASK><NEW_LINE>findBit.or(mask);<NEW_LINE>findBit.and(types);<NEW_LINE>int v = findBit.nextSetBit(0);<NEW_LINE>o = parseValueFromTag(v, valueType);<NEW_LINE>}<NEW_LINE>} else if (value instanceof String && value.equals(":incline")) {<NEW_LINE>return paramContext.incline;<NEW_LINE>} else if (value instanceof String && value.toString().startsWith(":")) {<NEW_LINE>String p = ((String) value).substring(1);<NEW_LINE>if (paramContext != null && paramContext.vars.containsKey(p)) {<NEW_LINE>o = parseValue(paramContext.vars.get(p), valueType);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (o instanceof Number) {<NEW_LINE>return ((Number) o).doubleValue();<NEW_LINE>}<NEW_LINE>return Double.NaN;<NEW_LINE>} | BitSet(mask.length()); |
1,742,164 | public void readFunctionSection() throws IOException {<NEW_LINE>if (log.isLoggable(Level.FINE))<NEW_LINE>log.fine("readFunctionSection");<NEW_LINE>int nFunctions = in.read4BE();<NEW_LINE>anonymousFuns = new AnonFun[nFunctions];<NEW_LINE>if (log.isLoggable(Level.FINE))<NEW_LINE>log.fine("Number of function descrs: " + nFunctions);<NEW_LINE>EAtom mod = moduleName();<NEW_LINE>for (int i = 0; i < nFunctions; i++) {<NEW_LINE>int fun_atom_nr = in.read4BE();<NEW_LINE>int arity = in.read4BE();<NEW_LINE>int label = in.read4BE();<NEW_LINE>int index = in.read4BE();<NEW_LINE>int free_vars = in.read4BE();<NEW_LINE>int old_uniq = in.read4BE();<NEW_LINE>EAtom fun = atom(fun_atom_nr);<NEW_LINE>anonymousFuns[i] = new AnonFun(mod, fun, arity, label, old_uniq, <MASK><NEW_LINE>if (log.isLoggable(Level.FINE) && atoms != null) {<NEW_LINE>log.fine("- #" + (i + 1) + ": " + fun + "/" + arity + " @ " + label);<NEW_LINE>log.fine("--> occur:" + index + " free:" + free_vars + " $ " + old_uniq);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | i, module_md5, index, free_vars); |
104,048 | public static ErrorMessage sendErrorMessage(ChannelHandlerContext ctx, Throwable cause) throws Exception {<NEW_LINE>String message = cause.getMessage();<NEW_LINE>long statusCode = StatusCodes.Bad_UnexpectedError;<NEW_LINE>if (cause instanceof UaException) {<NEW_LINE>UaException ex = (UaException) cause;<NEW_LINE>message = ex.getMessage();<NEW_LINE>statusCode = ex.getStatusCode().getValue();<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>if (innerCause instanceof UaException) {<NEW_LINE>UaException ex = (UaException) innerCause;<NEW_LINE>message = ex.getMessage();<NEW_LINE>statusCode = ex.getStatusCode().getValue();<NEW_LINE>} else if (innerCause instanceof UaRuntimeException) {<NEW_LINE>UaRuntimeException ex = (UaRuntimeException) innerCause;<NEW_LINE>message = ex.getMessage();<NEW_LINE>statusCode = ex.getStatusCode().getValue();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ErrorMessage error = new ErrorMessage(statusCode, message);<NEW_LINE>ByteBuf messageBuffer = TcpMessageEncoder.encode(error);<NEW_LINE>ctx.writeAndFlush(messageBuffer).addListener(future -> ctx.close());<NEW_LINE>return error;<NEW_LINE>} | Throwable innerCause = cause.getCause(); |
634,622 | public final double calcDistance(PointList pointList) {<NEW_LINE>double prevLat = Double.NaN;<NEW_LINE>double prevLon = Double.NaN;<NEW_LINE>double prevEle = Double.NaN;<NEW_LINE>double dist = 0;<NEW_LINE>for (int i = 0; i < pointList.size(); i++) {<NEW_LINE>if (i > 0) {<NEW_LINE>if (pointList.is3D())<NEW_LINE>dist += calcDist3D(prevLat, prevLon, prevEle, pointList.getLat(i), pointList.getLon(i), pointList.getEle(i));<NEW_LINE>else<NEW_LINE>dist += calcDist(prevLat, prevLon, pointList.getLat(i)<MASK><NEW_LINE>}<NEW_LINE>prevLat = pointList.getLat(i);<NEW_LINE>prevLon = pointList.getLon(i);<NEW_LINE>if (pointList.is3D())<NEW_LINE>prevEle = pointList.getEle(i);<NEW_LINE>}<NEW_LINE>return dist;<NEW_LINE>} | , pointList.getLon(i)); |
434,387 | private void drawColorWheel() {<NEW_LINE>colorWheelCanvas.drawColor(0, PorterDuff.Mode.CLEAR);<NEW_LINE>currentColorCanvas.drawColor(0, PorterDuff.Mode.CLEAR);<NEW_LINE>if (renderer == null)<NEW_LINE>return;<NEW_LINE>float half = colorWheelCanvas.getWidth() / 2f;<NEW_LINE>float strokeWidth = STROKE_RATIO <MASK><NEW_LINE>float maxRadius = half - strokeWidth - half / density;<NEW_LINE>float cSize = maxRadius / (density - 1) / 2;<NEW_LINE>ColorWheelRenderOption colorWheelRenderOption = renderer.getRenderOption();<NEW_LINE>colorWheelRenderOption.density = this.density;<NEW_LINE>colorWheelRenderOption.maxRadius = maxRadius;<NEW_LINE>colorWheelRenderOption.cSize = cSize;<NEW_LINE>colorWheelRenderOption.strokeWidth = strokeWidth;<NEW_LINE>colorWheelRenderOption.alpha = alpha;<NEW_LINE>colorWheelRenderOption.lightness = lightness;<NEW_LINE>colorWheelRenderOption.targetCanvas = colorWheelCanvas;<NEW_LINE>renderer.initWith(colorWheelRenderOption);<NEW_LINE>renderer.draw();<NEW_LINE>} | * (1f + ColorWheelRenderer.GAP_PERCENTAGE); |
290,886 | public void deployResource(Object resource, String applicationName, String moduleName) throws Exception {<NEW_LINE>ContextService contextServiceRes = (ContextService) resource;<NEW_LINE>if (contextServiceRes == null) {<NEW_LINE>_logger.log(Level.WARNING, LogFacade.DEPLOY_ERROR_NULL_CONFIG, "ContextService");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String jndiName = contextServiceRes.getJndiName();<NEW_LINE><MASK><NEW_LINE>if (_logger.isLoggable(Level.FINE)) {<NEW_LINE>_logger.log(Level.FINE, "ContextServiceDeployer.deployResource() : jndi-name [" + jndiName + "], " + " context-info [" + contextInfo + "]");<NEW_LINE>}<NEW_LINE>ResourceInfo resourceInfo = new ResourceInfo(contextServiceRes.getJndiName(), applicationName, moduleName);<NEW_LINE>ContextServiceConfig config = new ContextServiceConfig(contextServiceRes);<NEW_LINE>javax.naming.Reference ref = new javax.naming.Reference(javax.enterprise.concurrent.ContextService.class.getName(), "org.glassfish.concurrent.runtime.deployer.ConcurrentObjectFactory", null);<NEW_LINE>RefAddr addr = new SerializableObjectRefAddr(ContextServiceConfig.class.getName(), config);<NEW_LINE>ref.add(addr);<NEW_LINE>RefAddr resAddr = new SerializableObjectRefAddr(ResourceInfo.class.getName(), resourceInfo);<NEW_LINE>ref.add(resAddr);<NEW_LINE>try {<NEW_LINE>// Publish the object ref<NEW_LINE>namingService.publishObject(resourceInfo, ref, true);<NEW_LINE>} catch (NamingException ex) {<NEW_LINE>LogHelper.log(_logger, Level.SEVERE, LogFacade.UNABLE_TO_BIND_OBJECT, ex, "ContextService", jndiName);<NEW_LINE>}<NEW_LINE>} | String contextInfo = contextServiceRes.getContextInfo(); |
1,324,443 | private void popTabMenu() {<NEW_LINE>try {<NEW_LINE>add(createMenuItem("Set Type", new PopTabAction(PopTabAction.SET_TYPE)));<NEW_LINE>createMenuSeperator();<NEW_LINE>add(createMenuItem("Move Tab", new PopTabAction(PopTabAction.MOVE_TAB)));<NEW_LINE>add(createMenuItem("Duplicate", new PopTabAction(PopTabAction.DUPLICATE)));<NEW_LINE>add(createMenuItem("Open", new PopTabAction(PopTabAction.OPEN)));<NEW_LINE>add(createMenuItem("Open left", new PopTabAction(PopTabAction.OPENL)));<NEW_LINE>createMenuSeperator();<NEW_LINE>add(createMenuItem("Save", new PopTabAction(PopTabAction.SAVE)));<NEW_LINE>add(createMenuItem("SaveAs", new PopTabAction(PopTabAction.SAVE_AS)));<NEW_LINE>createMenuSeperator();<NEW_LINE>add(createMenuItem("Run", new PopTabAction(PopTabAction.RUN)));<NEW_LINE>add(createMenuItem("Run Slowly", new PopTabAction(PopTabAction.RUN_SLOW)));<NEW_LINE>createMenuSeperator();<NEW_LINE>add(createMenuItem("Reset", new <MASK><NEW_LINE>} catch (NoSuchMethodException ex) {<NEW_LINE>validMenu = false;<NEW_LINE>}<NEW_LINE>} | PopTabAction(PopTabAction.RESET))); |
1,005,995 | public okhttp3.Call deleteAPISpecificOperationPolicyByPolicyIdCall(String apiId, String operationPolicyId, final ApiCallback _callback) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/apis/{apiId}/operation-policies/{operationPolicyId}".replaceAll("\\{" + "apiId" + "\\}", localVarApiClient.escapeString(apiId.toString())).replaceAll("\\{" + "operationPolicyId" + "\\}", localVarApiClient.escapeString(operationPolicyId.toString()));<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, String> localVarCookieParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = { "application/json" };<NEW_LINE>final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>if (localVarAccept != null) {<NEW_LINE>localVarHeaderParams.put("Accept", localVarAccept);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>String[] localVarAuthNames = new String[] { "OAuth2Security" };<NEW_LINE>return localVarApiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);<NEW_LINE>} | final String[] localVarContentTypes = {}; |
352,144 | // [END maps_current_place_on_options_item_selected]<NEW_LINE>// [START maps_current_place_on_map_ready]<NEW_LINE>@Override<NEW_LINE>public void onMapReady(GoogleMap map) {<NEW_LINE>this.map = map;<NEW_LINE>// [START_EXCLUDE]<NEW_LINE>// [START map_current_place_set_info_window_adapter]<NEW_LINE>// Use a custom info window adapter to handle multiple lines of text in the<NEW_LINE>// info window contents.<NEW_LINE>this.map.setInfoWindowAdapter(new GoogleMap.InfoWindowAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public // Return null here, so that getInfoContents() is called next.<NEW_LINE>View getInfoWindow(Marker arg0) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public View getInfoContents(Marker marker) {<NEW_LINE>// Inflate the layouts for the info window, title and snippet.<NEW_LINE>View infoWindow = getLayoutInflater().inflate(R.layout.custom_info_contents, (FrameLayout) findViewById(R<MASK><NEW_LINE>TextView title = infoWindow.findViewById(R.id.title);<NEW_LINE>title.setText(marker.getTitle());<NEW_LINE>TextView snippet = infoWindow.findViewById(R.id.snippet);<NEW_LINE>snippet.setText(marker.getSnippet());<NEW_LINE>return infoWindow;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>// [END map_current_place_set_info_window_adapter]<NEW_LINE>// Prompt the user for permission.<NEW_LINE>getLocationPermission();<NEW_LINE>// [END_EXCLUDE]<NEW_LINE>// Turn on the My Location layer and the related control on the map.<NEW_LINE>updateLocationUI();<NEW_LINE>// Get the current location of the device and set the position of the map.<NEW_LINE>getDeviceLocation();<NEW_LINE>} | .id.map), false); |
1,413,885 | public void completed(AbstractBuild r) {<NEW_LINE>if (skipOnMatrixChildren(r)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String key = BuildKey.format(r);<NEW_LINE>AbstractProject<?, ?> project = r.getProject();<NEW_LINE>AbstractBuild<?, ?> previousBuild = project.getLastBuild();<NEW_LINE>if (null != previousBuild) {<NEW_LINE>do {<NEW_LINE>previousBuild = previousBuild.getPreviousCompletedBuild();<NEW_LINE>} while ((null != previousBuild && previousBuild.getResult() == Result.ABORTED) || (null != previousBuild && previousBuild.getNumber() == r.getNumber()));<NEW_LINE>if (null != previousBuild) {<NEW_LINE>log.info(key, "found #%d as previous completed, non-aborted build", previousBuild.getNumber());<NEW_LINE>} else {<NEW_LINE>log.debug(key, "did not find previous completed, non-aborted build");<NEW_LINE>}<NEW_LINE>NotificationConditions conditions = NotificationConditions.create(notifier, log);<NEW_LINE>if (conditions.test(new Context(r, previousBuild))) {<NEW_LINE>String message = getBuildStatusMessage(r, notifier.getIncludeTestSummary(), notifier.getIncludeFailedTests(<MASK><NEW_LINE>if (notifier.getCommitInfoChoice().showAnything()) {<NEW_LINE>message = message + "\n" + getCommitList(r);<NEW_LINE>}<NEW_LINE>slackFactory.apply(r).publish(message, getBuildColor(r));<NEW_LINE>if (notifier.getUploadFiles()) {<NEW_LINE>slackFactory.apply(r).upload(r.getWorkspace(), notifier.getArtifactIncludes(), log.getTaskListener());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ), notifier.getIncludeCustomMessage()); |
1,028,094 | void submitPin(@NonNull String pin, @NonNull TokenData tokenData, @NonNull Callback<PinResultData> callback) {<NEW_LINE>executor.execute(() -> {<NEW_LINE>try {<NEW_LINE>Stopwatch stopwatch = new Stopwatch("PinSubmission");<NEW_LINE>KbsPinData kbsData = KbsRepository.restoreMasterKey(pin, tokenData.getEnclave(), tokenData.getBasicAuth(), tokenData.getTokenResponse());<NEW_LINE>PinState.onSignalPinRestore(ApplicationDependencies.getApplication(), Objects.requireNonNull(kbsData), pin);<NEW_LINE>stopwatch.split("MasterKey");<NEW_LINE>ApplicationDependencies.getJobManager().runSynchronously(new StorageAccountRestoreJob(), StorageAccountRestoreJob.LIFESPAN);<NEW_LINE>stopwatch.split("AccountRestore");<NEW_LINE>ApplicationDependencies.getJobManager().runSynchronously(new StorageSyncJob(), TimeUnit.SECONDS.toMillis(10));<NEW_LINE>stopwatch.split("ContactRestore");<NEW_LINE>stopwatch.stop(TAG);<NEW_LINE>callback.onComplete(new PinResultData<MASK><NEW_LINE>} catch (IOException e) {<NEW_LINE>callback.onComplete(new PinResultData(PinResult.NETWORK_ERROR, tokenData));<NEW_LINE>} catch (KeyBackupSystemNoDataException e) {<NEW_LINE>callback.onComplete(new PinResultData(PinResult.LOCKED, tokenData));<NEW_LINE>} catch (KeyBackupSystemWrongPinException e) {<NEW_LINE>callback.onComplete(new PinResultData(PinResult.INCORRECT, TokenData.withResponse(tokenData, e.getTokenResponse())));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | (PinResult.SUCCESS, tokenData)); |
1,577,565 | // called when a column is moved in the default-values table (by user)<NEW_LINE>private void moveColumn(int fromIndex, int toIndex) {<NEW_LINE><MASK><NEW_LINE>updateSettingsTable();<NEW_LINE>int selCol;<NEW_LINE>if (defSelectedRow >= 0) {<NEW_LINE>if (defSelectedColumn == fromIndex)<NEW_LINE>selCol = toIndex;<NEW_LINE>else if (defSelectedColumn == toIndex)<NEW_LINE>selCol = fromIndex;<NEW_LINE>else<NEW_LINE>selCol = defSelectedColumn;<NEW_LINE>} else<NEW_LINE>selCol = -1;<NEW_LINE>if (selCol >= 0) {<NEW_LINE>defaultValuesTable.setRowSelectionInterval(defSelectedRow, defSelectedRow);<NEW_LINE>defaultValuesTable.setColumnSelectionInterval(selCol, selCol);<NEW_LINE>} else {<NEW_LINE>defaultValuesTable.clearSelection();<NEW_LINE>defaultValuesTable.getParent().requestFocus();<NEW_LINE>}<NEW_LINE>if (defaultValuesTable.getTableHeader().getDraggedColumn() != null)<NEW_LINE>defaultValuesTable.getTableHeader().setDraggedColumn(defaultValuesTable.getColumnModel().getColumn(toIndex));<NEW_LINE>} | model.moveColumn(fromIndex, toIndex); |
671,520 | public HttpRouteAction unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>HttpRouteAction httpRouteAction = new HttpRouteAction();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("weightedTargets", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>httpRouteAction.setWeightedTargets(new ListUnmarshaller<WeightedTarget>(WeightedTargetJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return httpRouteAction;<NEW_LINE>} | JsonToken token = context.getCurrentToken(); |
582,329 | public static void toJSON(OutputWriter jsonWriter, StageInstanceModel stageInstanceModel) {<NEW_LINE>jsonWriter.add("name", stageInstanceModel.getName());<NEW_LINE>jsonWriter.add("counter", stageInstanceModel.getCounter());<NEW_LINE>jsonWriter.add("approval_type", stageInstanceModel.getApprovalType());<NEW_LINE>jsonWriter.add("approved_by", stageInstanceModel.getApprovedBy());<NEW_LINE>if (stageInstanceModel.getResult() != null) {<NEW_LINE>jsonWriter.add("result", stageInstanceModel.getResult().toString());<NEW_LINE>if (stageInstanceModel.getResult() == StageResult.Cancelled) {<NEW_LINE>jsonWriter.add("cancelled_by", stageInstanceModel.getCancelledBy() == null ? "GoCD" : stageInstanceModel.getCancelledBy());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (stageInstanceModel.getRerunOfCounter() == null) {<NEW_LINE>jsonWriter.add("rerun_of_counter", (String) null);<NEW_LINE>} else {<NEW_LINE>jsonWriter.add(<MASK><NEW_LINE>}<NEW_LINE>if (stageInstanceModel.getIdentifier() != null) {<NEW_LINE>jsonWriter.add("pipeline_name", stageInstanceModel.getPipelineName());<NEW_LINE>jsonWriter.add("pipeline_counter", stageInstanceModel.getPipelineCounter());<NEW_LINE>}<NEW_LINE>jsonWriter.addChildList("jobs", jobsWriter -> stageInstanceModel.getBuildHistory().forEach(jobHistoryItem -> jobsWriter.addChild(jobInstanceWriter -> JobHistoryItemRepresenter.toJSON(jobInstanceWriter, jobHistoryItem))));<NEW_LINE>} | "rerun_of_counter", stageInstanceModel.getRerunOfCounter()); |
724,505 | public void export(long activityId, Writer writer) throws IOException {<NEW_LINE>ActivityEntity ae = new ActivityEntity();<NEW_LINE>ae.readByPrimaryKey(mDB, activityId);<NEW_LINE>long startTime = ae.getStartTime();<NEW_LINE>double distance = ae.getDistance();<NEW_LINE>long duration = ae.getTime();<NEW_LINE>String comment = ae.getComment();<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>w.beginObject();<NEW_LINE>Sport s = Sport.valueOf(ae.getSport());<NEW_LINE>if (!RunKeeperSynchronizer.sport2runkeeperMap.containsKey(s)) {<NEW_LINE>s = Sport.OTHER;<NEW_LINE>}<NEW_LINE>w.name("type").value(RunKeeperSynchronizer.sport2runkeeperMap.get(s));<NEW_LINE>w.name("equipment").value("None");<NEW_LINE>w.name("start_time").value(formatTime(startTime * 1000));<NEW_LINE>w.name("total_distance").value(distance);<NEW_LINE>w.name("duration").value(duration);<NEW_LINE>if (comment != null && comment.length() > 0) {<NEW_LINE>w.name("notes").value(comment);<NEW_LINE>}<NEW_LINE>// it seems that upload fails if writting an empty array...<NEW_LINE>if (ae.getMaxHr() != null) {<NEW_LINE>w.name("heart_rate");<NEW_LINE>w.beginArray();<NEW_LINE>exportHeartRate(activityId, w);<NEW_LINE>w.endArray();<NEW_LINE>}<NEW_LINE>exportPath("path", activityId, w);<NEW_LINE>w.name("post_to_facebook").value(false);<NEW_LINE>w.name("post_to_twitter").value(false);<NEW_LINE>w.endObject();<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>} | JsonWriter w = new JsonWriter(writer); |
9,956 | public void error(DbLoadContext context) {<NEW_LINE>boolean dumpThisEvent = context.getPipeline().getParameters().isDumpEvent() || context.getPipeline().getParameters().isDryRun();<NEW_LINE>if (dump && dumpThisEvent && logger.isInfoEnabled()) {<NEW_LINE>synchronized (LogLoadInterceptor.class) {<NEW_LINE>try {<NEW_LINE>MDC.put(OtterConstants.splitPipelineLoadLogFileKey, String.valueOf(context.getIdentity<MASK><NEW_LINE>logger.info(dumpContextInfo("error", context));<NEW_LINE>logger.info("* process Data *" + SEP);<NEW_LINE>logEventDatas(context.getProcessedDatas());<NEW_LINE>logger.info("-----------------" + SEP);<NEW_LINE>logger.info("* failed Data *" + SEP);<NEW_LINE>logEventDatas(context.getFailedDatas());<NEW_LINE>logger.info("****************************************************" + SEP);<NEW_LINE>} finally {<NEW_LINE>MDC.remove(OtterConstants.splitPipelineLoadLogFileKey);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ().getPipelineId())); |
1,755,879 | private void applyUserChangesInTrx0(@NonNull ShipmentScheduleUserChangeRequestsList userChanges) {<NEW_LINE>final Set<ShipmentScheduleId<MASK><NEW_LINE>final Map<ShipmentScheduleId, I_M_ShipmentSchedule> recordsById = shipmentSchedulePA.getByIds(shipmentScheduleIds);<NEW_LINE>for (final ShipmentScheduleId shipmentScheduleId : shipmentScheduleIds) {<NEW_LINE>try (final MDCCloseable shipmentScheduleMDC = TableRecordMDC.putTableRecordReference(I_M_ShipmentSchedule.Table_Name, shipmentScheduleId)) {<NEW_LINE>final ShipmentScheduleUserChangeRequest userChange = userChanges.getByShipmentScheduleId(shipmentScheduleId);<NEW_LINE>final I_M_ShipmentSchedule record = recordsById.get(shipmentScheduleId);<NEW_LINE>if (record == null) {<NEW_LINE>// shall not happen<NEW_LINE>logger.warn("No record found for {}. Skip applying user changes: {}", shipmentScheduleId, userChange);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (record.isProcessed()) {<NEW_LINE>// shall not happen<NEW_LINE>logger.warn("Record already processed {}. Skip applying user changes: {}", shipmentScheduleId, userChange);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>updateRecord(record, userChange);<NEW_LINE>shipmentSchedulePA.save(record);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | > shipmentScheduleIds = userChanges.getShipmentScheduleIds(); |
1,085,884 | private // region helpers<NEW_LINE>void startGeofencing() {<NEW_LINE>Context context = getContext();<NEW_LINE>if (context == null) {<NEW_LINE><MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!LocationHelpers.isAnyProviderAvailable(context)) {<NEW_LINE>Log.w(TAG, "There is no location provider available.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>mRegions = new HashMap<>();<NEW_LINE>mGeofencingList = new ArrayList<>();<NEW_LINE>// Create geofences from task options.<NEW_LINE>Map<String, Object> options = mTask.getOptions();<NEW_LINE>List<HashMap<String, Object>> regions = (ArrayList<HashMap<String, Object>>) options.get("regions");<NEW_LINE>for (Map<String, Object> region : regions) {<NEW_LINE>Geofence geofence = geofenceFromRegion(region);<NEW_LINE>String regionIdentifier = geofence.getRequestId();<NEW_LINE>// Make a bundle for the region to remember its attributes. Only request ID is public in Geofence object.<NEW_LINE>mRegions.put(regionIdentifier, bundleFromRegion(regionIdentifier, region));<NEW_LINE>// Add geofence to the list of observed regions.<NEW_LINE>mGeofencingList.add(geofence);<NEW_LINE>}<NEW_LINE>// Prepare pending intent, geofencing request and client.<NEW_LINE>mPendingIntent = preparePendingIntent();<NEW_LINE>mGeofencingRequest = prepareGeofencingRequest(mGeofencingList);<NEW_LINE>mGeofencingClient = LocationServices.getGeofencingClient(getContext());<NEW_LINE>try {<NEW_LINE>mGeofencingClient.addGeofences(mGeofencingRequest, mPendingIntent);<NEW_LINE>} catch (SecurityException e) {<NEW_LINE>Log.w(TAG, "Geofencing request has been rejected.", e);<NEW_LINE>}<NEW_LINE>} | Log.w(TAG, "The context has been abandoned."); |
857,738 | private List<DevServiceDescriptionBuildItem> buildServiceDescriptions(DockerStatusBuildItem dockerStatusBuildItem, List<DevServicesResultBuildItem> devServicesResults, Optional<DevServicesLauncherConfigResultBuildItem> devServicesLauncherConfig) {<NEW_LINE>// Fetch container infos<NEW_LINE>Set<String> containerIds = devServicesResults.stream().map(DevServicesResultBuildItem::getContainerId).filter(Objects::nonNull).collect(Collectors.toSet());<NEW_LINE>Map<String, Container> containerInfos = fetchContainerInfos(dockerStatusBuildItem, containerIds);<NEW_LINE>// Build descriptions<NEW_LINE>Set<String> <MASK><NEW_LINE>List<DevServiceDescriptionBuildItem> descriptions = new ArrayList<>();<NEW_LINE>for (DevServicesResultBuildItem buildItem : devServicesResults) {<NEW_LINE>configKeysFromDevServices.addAll(buildItem.getConfig().keySet());<NEW_LINE>descriptions.add(toDevServiceDescription(buildItem, containerInfos.get(buildItem.getContainerId())));<NEW_LINE>}<NEW_LINE>// Sort descriptions by name<NEW_LINE>descriptions.sort(Comparator.comparing(DevServiceDescriptionBuildItem::getName));<NEW_LINE>// Add description from other dev service configs as last<NEW_LINE>if (devServicesLauncherConfig.isPresent()) {<NEW_LINE>Map<String, String> config = new HashMap<>(devServicesLauncherConfig.get().getConfig());<NEW_LINE>for (String key : configKeysFromDevServices) {<NEW_LINE>config.remove(key);<NEW_LINE>}<NEW_LINE>if (!config.isEmpty()) {<NEW_LINE>descriptions.add(new DevServiceDescriptionBuildItem("Other Dev Services", null, config));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return descriptions;<NEW_LINE>} | configKeysFromDevServices = new HashSet<>(); |
1,726,640 | protected void updatePageComplete() {<NEW_LINE>setPageComplete(false);<NEW_LINE>String resultsInfo = new String();<NEW_LINE>String newSource = modelFileField.getText();<NEW_LINE>if (newSource == null || newSource.isEmpty()) {<NEW_LINE>parsedModelFile.reset();<NEW_LINE>} else {<NEW_LINE>parsedModelFile.setSourceName(newSource);<NEW_LINE>if (!parsedModelFile.exists()) {<NEW_LINE>resultsInfo += "Model file " + newSource + " does not exist";<NEW_LINE>} else if (parsedModelFile.getModelName() == null) {<NEW_LINE>resultsInfo += "Model file " + newSource + " does not have a model name defined";<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String newTarget = targetDirField.getText();<NEW_LINE>if (newTarget != null && !newTarget.isEmpty()) {<NEW_LINE>IResource container = ResourcesPlugin.getWorkspace().getRoot().<MASK><NEW_LINE>if (container == null || (container.getType() & (IResource.PROJECT | IResource.FOLDER)) == 0) {<NEW_LINE>if (!resultsInfo.isEmpty()) {<NEW_LINE>// resultsInfo += Character.LINE_SEPARATOR;<NEW_LINE>resultsInfo += "\n";<NEW_LINE>}<NEW_LINE>resultsInfo += "Target folder " + newTarget + " does not exist";<NEW_LINE>} else if (!container.isAccessible()) {<NEW_LINE>if (!resultsInfo.isEmpty()) {<NEW_LINE>// resultsInfo += Character.LINE_SEPARATOR;<NEW_LINE>resultsInfo += "\n";<NEW_LINE>}<NEW_LINE>resultsInfo += "Target folder " + newTarget + " is not writeable";<NEW_LINE>}<NEW_LINE>this.targetDir = newTarget;<NEW_LINE>}<NEW_LINE>setMessage(null);<NEW_LINE>if (!resultsInfo.isEmpty()) {<NEW_LINE>setMessage(resultsInfo, INFORMATION);<NEW_LINE>}<NEW_LINE>setPageComplete(true);<NEW_LINE>} | findMember(new Path(newTarget)); |
5,720 | // private void removeWsdlFolderContents(){<NEW_LINE>// FileObject wsdlFolder = getJAXWSClientSupport().getLocalWsdlFolderForClient(getName(), false);<NEW_LINE>// if(wsdlFolder != null){<NEW_LINE>// FileLock lock = null;<NEW_LINE>//<NEW_LINE>// FileObject[] files = wsdlFolder.getChildren();<NEW_LINE>// for(int i = 0; i < files.length; i++){<NEW_LINE>// try{<NEW_LINE>// FileObject file = files[i];<NEW_LINE>// lock = file.lock();<NEW_LINE>// file.delete(lock);<NEW_LINE>// }catch(IOException e){<NEW_LINE>// ErrorManager.getDefault().notify(e);<NEW_LINE>// }<NEW_LINE>// finally{<NEW_LINE>// if(lock != null){<NEW_LINE>// lock.releaseLock();<NEW_LINE>// lock = null;<NEW_LINE>// }<NEW_LINE>// }<NEW_LINE>// }<NEW_LINE>// }<NEW_LINE>// }<NEW_LINE>@Override<NEW_LINE>public void configureHandler() {<NEW_LINE>Project <MASK><NEW_LINE>ArrayList<String> handlerClasses = new ArrayList<String>();<NEW_LINE>BindingsModel bindingsModel = getBindingsModel();<NEW_LINE>if (bindingsModel != null) {<NEW_LINE>// if there is an existing bindings file, load it<NEW_LINE>GlobalBindings gb = bindingsModel.getGlobalBindings();<NEW_LINE>if (gb != null) {<NEW_LINE>DefinitionsBindings db = gb.getDefinitionsBindings();<NEW_LINE>if (db != null) {<NEW_LINE>BindingsHandlerChains handlerChains = db.getHandlerChains();<NEW_LINE>// there is only one handler chain<NEW_LINE>BindingsHandlerChain handlerChain = handlerChains.getHandlerChains().iterator().next();<NEW_LINE>Collection<BindingsHandler> handlers = handlerChain.getHandlers();<NEW_LINE>for (BindingsHandler handler : handlers) {<NEW_LINE>BindingsHandlerClass handlerClass = handler.getHandlerClass();<NEW_LINE>handlerClasses.add(handlerClass.getClassName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final MessageHandlerPanel panel = new MessageHandlerPanel(project, handlerClasses, true, client.getServiceName());<NEW_LINE>String title = NbBundle.getMessage(JaxWsNode.class, "TTL_MessageHandlerPanel");<NEW_LINE>DialogDescriptor dialogDesc = new DialogDescriptor(panel, title);<NEW_LINE>dialogDesc.setButtonListener(new ClientHandlerButtonListener(panel, bindingsModel, client, this));<NEW_LINE>DialogDisplayer.getDefault().notify(dialogDesc);<NEW_LINE>} | project = FileOwnerQuery.getOwner(wsdlFileObject); |
1,504,889 | protected String doIt() throws Exception {<NEW_LINE>final I_M_Product product = productDAO.getById(getRecord_ID());<NEW_LINE>final IQueryBL queryBL = Services.get(IQueryBL.class);<NEW_LINE>final IQueryFilter<I_M_Product> productFilter = queryBL.createCompositeQueryFilter(I_M_Product.class).addOnlyActiveRecordsFilter().addCompareFilter(I_M_Product.COLUMNNAME_M_Product_ID, CompareQueryFilter.Operator.EQUAL, product.getM_Product_ID());<NEW_LINE>if (product.isDiscontinued()) {<NEW_LINE>final ZoneId zoneId = orgDAO.getTimeZone(OrgId.ofRepoId(product.getAD_Org_ID()));<NEW_LINE>final Optional<LocalDate> discontinuedFrom = Optional.ofNullable(product.getDiscontinuedFrom()).map(discontinuedFromTimestamp -> TimeUtil<MASK><NEW_LINE>if (!discontinuedFrom.isPresent() || discontinuedFrom.get().compareTo(p_dateFrom) <= 0) {<NEW_LINE>priceListDAO.updateProductPricesIsActive(productFilter, p_dateFrom, false);<NEW_LINE>} else {<NEW_LINE>priceListDAO.updateProductPricesIsActive(productFilter, p_dateFrom, true);<NEW_LINE>priceListDAO.updateProductPricesIsActive(productFilter, discontinuedFrom.get(), false);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>priceListDAO.updateProductPricesIsActive(productFilter, p_dateFrom, true);<NEW_LINE>}<NEW_LINE>return MSG_OK;<NEW_LINE>} | .asLocalDate(discontinuedFromTimestamp, zoneId)); |
1,727,959 | final CreateMediaCapturePipelineResult executeCreateMediaCapturePipeline(CreateMediaCapturePipelineRequest createMediaCapturePipelineRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createMediaCapturePipelineRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateMediaCapturePipelineRequest> request = null;<NEW_LINE>Response<CreateMediaCapturePipelineResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateMediaCapturePipelineRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createMediaCapturePipelineRequest));<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, "Chime");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateMediaCapturePipeline");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateMediaCapturePipelineResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateMediaCapturePipelineResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.endEvent(Field.RequestMarshallTime); |
129,454 | private Map<String, List<BlackboardArtifact>> buildMap() throws TskCoreException, SQLException {<NEW_LINE>Map<String, List<BlackboardArtifact>> <MASK><NEW_LINE>List<BlackboardArtifact> contactList = Case.getCurrentCase().getSleuthkitCase().getBlackboardArtifacts(BlackboardArtifact.ARTIFACT_TYPE.TSK_CONTACT);<NEW_LINE>for (BlackboardArtifact contactArtifact : contactList) {<NEW_LINE>List<BlackboardAttribute> contactAttributes = contactArtifact.getAttributes();<NEW_LINE>for (BlackboardAttribute attribute : contactAttributes) {<NEW_LINE>String typeName = attribute.getAttributeType().getTypeName();<NEW_LINE>if (typeName.startsWith("TSK_EMAIL") || typeName.startsWith("TSK_PHONE") || typeName.startsWith("TSK_NAME") || typeName.startsWith("TSK_ID")) {<NEW_LINE>String accountID = attribute.getValueString();<NEW_LINE>List<BlackboardArtifact> artifactList = acctMap.get(accountID);<NEW_LINE>if (artifactList == null) {<NEW_LINE>artifactList = new ArrayList<>();<NEW_LINE>acctMap.put(accountID, artifactList);<NEW_LINE>}<NEW_LINE>if (!artifactList.contains(contactArtifact)) {<NEW_LINE>artifactList.add(contactArtifact);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return acctMap;<NEW_LINE>} | acctMap = new HashMap<>(); |
881,509 | private static MySQLBinlogSource parseMySQLBinlogSource(BinlogSourceListResponse response) {<NEW_LINE>MySQLBinlogSource binlogSource = new MySQLBinlogSource();<NEW_LINE>binlogSource.setSourceName(response.getSourceName());<NEW_LINE>binlogSource.setHostname(response.getHostname());<NEW_LINE>binlogSource.setDataFormat(DataFormat.NONE);<NEW_LINE>binlogSource.setPort(response.getPort());<NEW_LINE>binlogSource.setState(State.parseByStatus(response.getStatus()));<NEW_LINE>DefaultAuthentication defaultAuthentication = new DefaultAuthentication(response.getUser(), response.getPassword());<NEW_LINE>binlogSource.setAuthentication(defaultAuthentication);<NEW_LINE>binlogSource.setIncludeSchema(response.getIncludeSchema());<NEW_LINE>binlogSource.setServerTimezone(response.getServerTimezone());<NEW_LINE>binlogSource.setMonitoredDdl(response.getMonitoredDdl());<NEW_LINE>binlogSource.setTimestampFormatStandard(response.getTimestampFormatStandard());<NEW_LINE>binlogSource.<MASK><NEW_LINE>if (StringUtils.isNotBlank(response.getDatabaseWhiteList())) {<NEW_LINE>binlogSource.setDbNames(Arrays.asList(response.getDatabaseWhiteList().split(",")));<NEW_LINE>}<NEW_LINE>if (StringUtils.isNotBlank(response.getTableWhiteList())) {<NEW_LINE>binlogSource.setTableNames(Arrays.asList(response.getTableWhiteList().split(",")));<NEW_LINE>}<NEW_LINE>return binlogSource;<NEW_LINE>} | setAllMigration(response.isAllMigration()); |
367,288 | public static boolean sendForgotPassword(User user, String newPassword, String hostId) throws DotDataException, DotSecurityException {<NEW_LINE>HostAPI hostAPI = APILocator.getHostAPI();<NEW_LINE>// build a decent default context<NEW_LINE>Context context = VelocityUtil.getBasicContext();<NEW_LINE><MASK><NEW_LINE>context.put("UtilMethods", new UtilMethods());<NEW_LINE>context.put("language", Long.toString(APILocator.getLanguageAPI().getDefaultLanguage().getId()));<NEW_LINE>context.put("password", newPassword);<NEW_LINE>Host host = hostAPI.find(hostId, user, true);<NEW_LINE>context.put("host", host);<NEW_LINE>StringWriter writer = new StringWriter();<NEW_LINE>String idInode = APILocator.getIdentifierAPI().find(host, Config.getStringProperty("PATH_FORGOT_PASSWORD_EMAIL")).getInode();<NEW_LINE>String languageStr = "_" + APILocator.getLanguageAPI().getDefaultLanguage().getId();<NEW_LINE>try {<NEW_LINE>String message = "";<NEW_LINE>try {<NEW_LINE>Template t = UtilMethods.getVelocityTemplate(PageMode.LIVE.name() + File.separator + idInode + languageStr + "." + VelocityType.HTMLPAGE.fileExtension);<NEW_LINE>t.merge(context, writer);<NEW_LINE>Logger.debug(EmailFactory.class, "writer:" + writer.getBuffer());<NEW_LINE>message = writer.toString().trim();<NEW_LINE>} catch (ResourceNotFoundException ex) {<NEW_LINE>message = "<center><b>And error has ocurred loading de message's page<b></center>";<NEW_LINE>}<NEW_LINE>Mailer m = new Mailer();<NEW_LINE>m.setToEmail(user.getEmailAddress());<NEW_LINE>m.setSubject("Your " + host.getHostname() + " Password");<NEW_LINE>m.setHTMLBody(message);<NEW_LINE>m.setFromEmail(Config.getStringProperty("EMAIL_SYSTEM_ADDRESS"));<NEW_LINE>return m.sendMessage();<NEW_LINE>} catch (Exception e) {<NEW_LINE>Logger.warn(EmailFactory.class, e.toString(), e);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} | context.put("user", user); |
793,658 | public static DescribeVmMigrationPlanResponse unmarshall(DescribeVmMigrationPlanResponse describeVmMigrationPlanResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeVmMigrationPlanResponse.setRequestId(_ctx.stringValue("DescribeVmMigrationPlanResponse.RequestId"));<NEW_LINE>describeVmMigrationPlanResponse.setSuccess(_ctx.booleanValue("DescribeVmMigrationPlanResponse.Success"));<NEW_LINE>describeVmMigrationPlanResponse.setCode(_ctx.stringValue("DescribeVmMigrationPlanResponse.Code"));<NEW_LINE>describeVmMigrationPlanResponse.setMessage(_ctx.stringValue("DescribeVmMigrationPlanResponse.Message"));<NEW_LINE>describeVmMigrationPlanResponse.setTotalCount(_ctx.longValue("DescribeVmMigrationPlanResponse.TotalCount"));<NEW_LINE>describeVmMigrationPlanResponse.setPageNumber(_ctx.integerValue("DescribeVmMigrationPlanResponse.PageNumber"));<NEW_LINE>describeVmMigrationPlanResponse.setPageSize(_ctx.integerValue("DescribeVmMigrationPlanResponse.PageSize"));<NEW_LINE>List<Migration> migrations = new ArrayList<Migration>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeVmMigrationPlanResponse.Migrations.Length"); i++) {<NEW_LINE>Migration migration = new Migration();<NEW_LINE>migration.setVmId(_ctx.stringValue("DescribeVmMigrationPlanResponse.Migrations[" + i + "].VmId"));<NEW_LINE>migration.setBackupPlanId(_ctx.stringValue("DescribeVmMigrationPlanResponse.Migrations[" + i + "].BackupPlanId"));<NEW_LINE>migration.setServerType(_ctx.stringValue("DescribeVmMigrationPlanResponse.Migrations[" + i + "].ServerType"));<NEW_LINE>migration.setVmName(_ctx.stringValue("DescribeVmMigrationPlanResponse.Migrations[" + i + "].VmName"));<NEW_LINE>migration.setExtra(_ctx.stringValue("DescribeVmMigrationPlanResponse.Migrations[" + i + "].Extra"));<NEW_LINE>migration.setHypervisorId(_ctx.stringValue("DescribeVmMigrationPlanResponse.Migrations[" + i + "].HypervisorId"));<NEW_LINE>migration.setServerId(_ctx.stringValue("DescribeVmMigrationPlanResponse.Migrations[" + i + "].ServerId"));<NEW_LINE>migration.setVmSnapshotId(_ctx.stringValue("DescribeVmMigrationPlanResponse.Migrations[" + i + "].VmSnapshotId"));<NEW_LINE>migration.setVSwitchId(_ctx.stringValue("DescribeVmMigrationPlanResponse.Migrations[" + i + "].VSwitchId"));<NEW_LINE>migration.setInstanceType(_ctx.stringValue("DescribeVmMigrationPlanResponse.Migrations[" + i + "].InstanceType"));<NEW_LINE>migration.setPrivateIpAddress(_ctx.stringValue("DescribeVmMigrationPlanResponse.Migrations[" + i + "].PrivateIpAddress"));<NEW_LINE>migration.setDiskCategory(_ctx.stringValue("DescribeVmMigrationPlanResponse.Migrations[" + i + "].DiskCategory"));<NEW_LINE>migration.setSecurityGroup(_ctx.stringValue("DescribeVmMigrationPlanResponse.Migrations[" + i + "].SecurityGroup"));<NEW_LINE>migration.setAllocationPublicIp(_ctx.booleanValue("DescribeVmMigrationPlanResponse.Migrations[" + i + "].AllocationPublicIp"));<NEW_LINE>migration.setCreateImage(_ctx.booleanValue("DescribeVmMigrationPlanResponse.Migrations[" + i + "].CreateImage"));<NEW_LINE>migration.setBootAfterMigration(_ctx.booleanValue("DescribeVmMigrationPlanResponse.Migrations[" + i + "].BootAfterMigration"));<NEW_LINE>migration.setRestoreId(_ctx.stringValue("DescribeVmMigrationPlanResponse.Migrations[" + i + "].RestoreId"));<NEW_LINE>migration.setProgress(_ctx.integerValue("DescribeVmMigrationPlanResponse.Migrations[" + i + "].Progress"));<NEW_LINE>migration.setEcsInstanceId(_ctx.stringValue("DescribeVmMigrationPlanResponse.Migrations[" + i + "].EcsInstanceId"));<NEW_LINE>migration.setErrorMessage(_ctx.stringValue("DescribeVmMigrationPlanResponse.Migrations[" + i + "].ErrorMessage"));<NEW_LINE>migration.setImageId(_ctx.stringValue("DescribeVmMigrationPlanResponse.Migrations[" + i + "].ImageId"));<NEW_LINE>migration.setCreatedTime(_ctx.longValue("DescribeVmMigrationPlanResponse.Migrations[" + i + "].CreatedTime"));<NEW_LINE>migration.setUpdatedTime(_ctx.longValue("DescribeVmMigrationPlanResponse.Migrations[" + i + "].UpdatedTime"));<NEW_LINE>migration.setVmInfo(_ctx.stringValue("DescribeVmMigrationPlanResponse.Migrations[" + i + "].VmInfo"));<NEW_LINE>migration.setForceSilentSnapshot(_ctx.booleanValue("DescribeVmMigrationPlanResponse.Migrations[" + i + "].ForceSilentSnapshot"));<NEW_LINE>migration.setIncrementalSyncState(_ctx.stringValue("DescribeVmMigrationPlanResponse.Migrations[" + i + "].IncrementalSyncState"));<NEW_LINE>migration.setGarbageImageIds(_ctx.stringValue("DescribeVmMigrationPlanResponse.Migrations[" + i + "].GarbageImageIds"));<NEW_LINE>migration.setTestRestore(_ctx.booleanValue("DescribeVmMigrationPlanResponse.Migrations[" + i + "].TestRestore"));<NEW_LINE>migration.setClientId(_ctx.stringValue<MASK><NEW_LINE>migration.setClientName(_ctx.stringValue("DescribeVmMigrationPlanResponse.Migrations[" + i + "].ClientName"));<NEW_LINE>migrations.add(migration);<NEW_LINE>}<NEW_LINE>describeVmMigrationPlanResponse.setMigrations(migrations);<NEW_LINE>return describeVmMigrationPlanResponse;<NEW_LINE>} | ("DescribeVmMigrationPlanResponse.Migrations[" + i + "].ClientId")); |
892,370 | protected void select_instances() {<NEW_LINE>List<Object> selected_packages = list.getSelectedValuesList();<NEW_LINE>if (selected_packages.size() <= 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>app.freerouting.board.RoutingBoard routing_board = board_frame<MASK><NEW_LINE>java.util.Set<app.freerouting.board.Item> board_instances = new java.util.TreeSet<app.freerouting.board.Item>();<NEW_LINE>java.util.Collection<app.freerouting.board.Item> board_items = routing_board.get_items();<NEW_LINE>for (app.freerouting.board.Item curr_item : board_items) {<NEW_LINE>if (curr_item.get_component_no() > 0) {<NEW_LINE>app.freerouting.board.Component curr_component = routing_board.components.get(curr_item.get_component_no());<NEW_LINE>Package curr_package = curr_component.get_package();<NEW_LINE>boolean package_matches = false;<NEW_LINE>for (int i = 0; i < selected_packages.size(); ++i) {<NEW_LINE>if (curr_package == selected_packages.get(i)) {<NEW_LINE>package_matches = true;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (package_matches) {<NEW_LINE>board_instances.add(curr_item);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>board_frame.board_panel.board_handling.select_items(board_instances);<NEW_LINE>board_frame.board_panel.board_handling.zoom_selection();<NEW_LINE>} | .board_panel.board_handling.get_routing_board(); |
660,350 | void updateAgentsSafely(Collection<AgentBean> updateBeans, Map<String, String> errorMessages) {<NEW_LINE>LOG.debug("Update agent beans with the following: {}", updateBeans);<NEW_LINE>for (AgentBean bean : updateBeans) {<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>if (errorNo != null && errorNo != 0) {<NEW_LINE>String errorMessage = errorMessages.get(bean.getEnv_id());<NEW_LINE>if (errorMessage == null) {<NEW_LINE>errorMessage = "";<NEW_LINE>}<NEW_LINE>AgentErrorBean agentErrorBean = agentErrorDAO.get(bean.getHost_name(), bean.getEnv_id());<NEW_LINE>if (agentErrorBean == null) {<NEW_LINE>agentErrorBean = new AgentErrorBean();<NEW_LINE>agentErrorBean.setHost_id(bean.getHost_id());<NEW_LINE>agentErrorBean.setHost_name(bean.getHost_name());<NEW_LINE>agentErrorBean.setEnv_id(bean.getEnv_id());<NEW_LINE>agentErrorBean.setError_msg(errorMessage);<NEW_LINE>agentErrorDAO.insert(agentErrorBean);<NEW_LINE>} else {<NEW_LINE>if (!agentErrorBean.getError_msg().equals(errorMessage)) {<NEW_LINE>agentErrorBean.setError_msg(errorMessage);<NEW_LINE>agentErrorDAO.update(bean.getHost_name(), bean.getEnv_id(), agentErrorBean);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>agentDAO.insertOrUpdate(bean);<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.error("Failed to update agent {}.", bean, e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | Integer errorNo = bean.getLast_err_no(); |
1,644,328 | protected Control createContents(Composite parent) {<NEW_LINE>Composite main = new Composite(parent, SWT.NONE);<NEW_LINE>main.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));<NEW_LINE>GridLayout layout = new GridLayout(2, false);<NEW_LINE>layout.marginHeight = 0;<NEW_LINE>layout.marginWidth = 0;<NEW_LINE>main.setLayout(layout);<NEW_LINE>Label label = new Label(main, SWT.LEFT);<NEW_LINE><MASK><NEW_LINE>fSitesCombo = new Combo(main, SWT.DROP_DOWN | SWT.READ_ONLY);<NEW_LINE>// adds the sites that have the selected resource as the source<NEW_LINE>ISiteConnection[] sites = SiteConnectionUtils.findSitesForSource(fResource);<NEW_LINE>for (ISiteConnection site : sites) {<NEW_LINE>fSitesCombo.add(site.getDestination().getName());<NEW_LINE>}<NEW_LINE>fSitesCombo.select(0);<NEW_LINE>String connection = ResourceSynchronizationUtils.getLastSyncConnection(fResource);<NEW_LINE>if (connection != null && !connection.equals("")) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>fSitesCombo.setText(connection);<NEW_LINE>}<NEW_LINE>fUseAsDefaultButton = new Button(main, SWT.CHECK);<NEW_LINE>fUseAsDefaultButton.setText(Messages.SynchronizationPropertyPage_useConnectionsAsDefault);<NEW_LINE>fUseAsDefaultButton.setSelection(ResourceSynchronizationUtils.isRememberDecision(fResource));<NEW_LINE>GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, false);<NEW_LINE>gridData.horizontalSpan = 2;<NEW_LINE>fUseAsDefaultButton.setLayoutData(gridData);<NEW_LINE>return main;<NEW_LINE>} | label.setText(Messages.SynchronizationPropertyPage_lastSyncConnection); |
750,007 | public static DescribeDomainPathDataResponse unmarshall(DescribeDomainPathDataResponse describeDomainPathDataResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeDomainPathDataResponse.setDomainName(_ctx.stringValue("DescribeDomainPathDataResponse.DomainName"));<NEW_LINE>describeDomainPathDataResponse.setStartTime(_ctx.stringValue("DescribeDomainPathDataResponse.StartTime"));<NEW_LINE>describeDomainPathDataResponse.setEndTime(_ctx.stringValue("DescribeDomainPathDataResponse.EndTime"));<NEW_LINE>describeDomainPathDataResponse.setPageSize(_ctx.integerValue("DescribeDomainPathDataResponse.PageSize"));<NEW_LINE>describeDomainPathDataResponse.setPageNumber(_ctx.integerValue("DescribeDomainPathDataResponse.PageNumber"));<NEW_LINE>describeDomainPathDataResponse.setDataInterval(_ctx.stringValue("DescribeDomainPathDataResponse.DataInterval"));<NEW_LINE>describeDomainPathDataResponse.setTotalCount(_ctx.integerValue("DescribeDomainPathDataResponse.TotalCount"));<NEW_LINE>List<UsageData> pathDataPerInterval = new ArrayList<UsageData>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeDomainPathDataResponse.PathDataPerInterval.Length"); i++) {<NEW_LINE>UsageData usageData = new UsageData();<NEW_LINE>usageData.setTraffic(_ctx.integerValue("DescribeDomainPathDataResponse.PathDataPerInterval[" + i + "].Traffic"));<NEW_LINE>usageData.setAcc(_ctx.integerValue("DescribeDomainPathDataResponse.PathDataPerInterval[" + i + "].Acc"));<NEW_LINE>usageData.setPath(_ctx.stringValue("DescribeDomainPathDataResponse.PathDataPerInterval[" + i + "].Path"));<NEW_LINE>usageData.setTime(_ctx.stringValue<MASK><NEW_LINE>pathDataPerInterval.add(usageData);<NEW_LINE>}<NEW_LINE>describeDomainPathDataResponse.setPathDataPerInterval(pathDataPerInterval);<NEW_LINE>return describeDomainPathDataResponse;<NEW_LINE>} | ("DescribeDomainPathDataResponse.PathDataPerInterval[" + i + "].Time")); |
815,524 | protected void onBindView(BaseViewHolder holder, int position) {<NEW_LINE>TimelineModel model = getItem(position);<NEW_LINE>if (model.getType() == TimelineModel.HEADER) {<NEW_LINE>((IssueDetailsViewHolder) holder).bind(model);<NEW_LINE>} else if (model.getType() == TimelineModel.EVENT) {<NEW_LINE>((IssueTimelineViewHolder) holder).bind(model);<NEW_LINE>} else if (model.getType() == TimelineModel.COMMENT) {<NEW_LINE>((TimelineCommentsViewHolder) holder).bind(model);<NEW_LINE>} else if (model.getType() == TimelineModel.GROUP) {<NEW_LINE>((GroupedReviewsViewHolder) holder).bind(model);<NEW_LINE>} else if (model.getType() == TimelineModel.REVIEW) {<NEW_LINE>((ReviewsViewHolder) holder).bind(model);<NEW_LINE>} else if (model.getType() == TimelineModel.COMMIT_COMMENTS) {<NEW_LINE>((CommitThreadViewHolder<MASK><NEW_LINE>} else if (model.getType() == TimelineModel.STATUS && model.getStatus() != null) {<NEW_LINE>((PullStatusViewHolder) holder).bind(model.getStatus());<NEW_LINE>}<NEW_LINE>if (model.getType() != TimelineModel.COMMENT) {<NEW_LINE>StaggeredGridLayoutManager.LayoutParams layoutParams = (StaggeredGridLayoutManager.LayoutParams) holder.itemView.getLayoutParams();<NEW_LINE>layoutParams.setFullSpan(true);<NEW_LINE>}<NEW_LINE>} | ) holder).bind(model); |
381,444 | public boolean intersects(long minimum, long supremum) {<NEW_LINE>rangeSanityCheck(minimum, supremum);<NEW_LINE>if (supremum <= minimum) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>int minKey = (int) (minimum >>> 16);<NEW_LINE>int supKey = (int) (supremum >>> 16);<NEW_LINE>int length = highLowContainer.size;<NEW_LINE>char[] keys = highLowContainer.keys;<NEW_LINE>int offset = lowbitsAsInteger(minimum);<NEW_LINE>int limit = lowbitsAsInteger(supremum);<NEW_LINE>int index = Util.unsignedBinarySearch(keys, 0, length, (char) minKey);<NEW_LINE>int pos = index >= 0 ? index : -index - 1;<NEW_LINE>if (pos < length && supKey == (keys[pos])) {<NEW_LINE>if (supKey > minKey) {<NEW_LINE>offset = 0;<NEW_LINE>}<NEW_LINE>return highLowContainer.getContainerAtIndex(pos).intersects(offset, limit);<NEW_LINE>}<NEW_LINE>while (pos < length && supKey > (keys[pos])) {<NEW_LINE>Container container = highLowContainer.getContainerAtIndex(pos);<NEW_LINE>if (container.intersects(offset, 1 << 16)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>offset = 0;<NEW_LINE>++pos;<NEW_LINE>}<NEW_LINE>return pos < length && supKey == keys[pos] && highLowContainer.getContainerAtIndex(pos<MASK><NEW_LINE>} | ).intersects(offset, limit); |
779,910 | private static ModelNode spiProvider(JsonNode providerNode, PathAddress providerAddr) {<NEW_LINE>ModelNode op = Util.createAddOperation(providerAddr);<NEW_LINE>ModelNode properties = new ModelNode();<NEW_LINE>Iterator<String<MASK><NEW_LINE>while (propNames.hasNext()) {<NEW_LINE>String propName = propNames.next();<NEW_LINE>if ("enabled".equals(propName)) {<NEW_LINE>op.get(ProviderResourceDefinition.ENABLED.getName()).set(providerNode.get(propName).asBoolean());<NEW_LINE>} else {<NEW_LINE>if (providerNode.get(propName).isArray()) {<NEW_LINE>properties.get(propName).set(makeArrayText(providerNode.get(propName)));<NEW_LINE>} else {<NEW_LINE>properties.get(propName).set(providerNode.get(propName).asText());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (properties.isDefined() && !properties.asPropertyList().isEmpty()) {<NEW_LINE>op.get("properties").set(properties);<NEW_LINE>}<NEW_LINE>if (!op.hasDefined(ProviderResourceDefinition.ENABLED.getName())) {<NEW_LINE>op.get(ProviderResourceDefinition.ENABLED.getName()).set(ProviderResourceDefinition.ENABLED.getDefaultValue());<NEW_LINE>}<NEW_LINE>return op;<NEW_LINE>} | > propNames = providerNode.fieldNames(); |
1,088,081 | public void exitEvalEqualsExpression(EsperEPL2GrammarParser.EvalEqualsExpressionContext ctx) {<NEW_LINE>if (ctx.getChildCount() < 2) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ExprNode exprNode;<NEW_LINE>boolean isNot = ctx.ne != null || ctx.isnot != null || ctx.sqlne != null;<NEW_LINE>if (ctx.a == null) {<NEW_LINE>boolean isIs = ctx.is != null || ctx.isnot != null;<NEW_LINE>exprNode = new ExprEqualsNodeImpl(isNot, isIs);<NEW_LINE>} else {<NEW_LINE>boolean isAll = ctx.a.getType() == EsperEPL2GrammarLexer.ALL;<NEW_LINE>List<EsperEPL2GrammarParser.SubSelectGroupExpressionContext<MASK><NEW_LINE>if (subselect != null && !subselect.isEmpty()) {<NEW_LINE>StatementSpecRaw currentSpec = astStatementSpecMap.remove(ctx.subSelectGroupExpression().get(0).subQueryExpr());<NEW_LINE>exprNode = new ExprSubselectAllSomeAnyNode(currentSpec, isNot, isAll, null);<NEW_LINE>} else {<NEW_LINE>exprNode = new ExprEqualsAllAnyNode(isNot, isAll);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ASTExprHelper.exprCollectAddSubNodesAddParentNode(exprNode, ctx, astExprNodeMap);<NEW_LINE>} | > subselect = ctx.subSelectGroupExpression(); |
1,052,888 | private void limit(int inputRecordCount) {<NEW_LINE>int endRecordIndex;<NEW_LINE>if (numberOfRecords == Integer.MIN_VALUE) {<NEW_LINE>endRecordIndex = inputRecordCount;<NEW_LINE>} else {<NEW_LINE>endRecordIndex = Math.min(inputRecordCount, recordStartOffset + numberOfRecords);<NEW_LINE>numberOfRecords -= Math.max(0, endRecordIndex - recordStartOffset);<NEW_LINE>}<NEW_LINE>int svIndex = 0;<NEW_LINE>for (int i = recordStartOffset; i < endRecordIndex; svIndex++, i++) {<NEW_LINE>if (incomingSv != null) {<NEW_LINE>outgoingSv.setIndex(svIndex, incomingSv.getIndex(i));<NEW_LINE>} else {<NEW_LINE>outgoingSv.setIndex<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>outgoingSv.setRecordCount(svIndex);<NEW_LINE>outgoingSv.setBatchActualRecordCount(inputRecordCount);<NEW_LINE>// Actual number of values in the container; not the number in<NEW_LINE>// the SV. Set record count, not value count. Value count is<NEW_LINE>// carried over from input vectors.<NEW_LINE>container.setRecordCount(inputRecordCount);<NEW_LINE>// Update the start offset<NEW_LINE>recordStartOffset = 0;<NEW_LINE>} | (svIndex, (char) i); |
1,375,764 | private void loadNode799() throws IOException, SAXException {<NEW_LINE>PropertyTypeNode node = new PropertyTypeNode(this.context, Identifiers.Server_Namespaces_OPCUANamespaceUri_IsNamespaceSubset, new QualifiedName(0, "IsNamespaceSubset"), new LocalizedText("en", "IsNamespaceSubset"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), new DataValue(Variant.NULL_VALUE), Identifiers.Boolean, -1, new UInteger[] {}, UByte.valueOf(1), UByte.valueOf(1), 0.0, false);<NEW_LINE>node.addReference(new Reference(Identifiers.Server_Namespaces_OPCUANamespaceUri_IsNamespaceSubset, Identifiers.HasTypeDefinition, Identifiers.PropertyType.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.Server_Namespaces_OPCUANamespaceUri_IsNamespaceSubset, Identifiers.HasProperty, Identifiers.Server_Namespaces_OPCUANamespaceUri.expanded(), false));<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>sb.append("<Boolean xmlns=\"http://opcfoundation.org/UA/2008/02/Types.xsd\">false</Boolean>");<NEW_LINE><MASK><NEW_LINE>OpcUaXmlStreamDecoder decoder = new OpcUaXmlStreamDecoder(context.getServer().getSerializationContext()).setInput(new StringReader(xml));<NEW_LINE>Object o = decoder.readVariantValue();<NEW_LINE>DataValue value = new DataValue(new Variant(o));<NEW_LINE>node.setValue(value);<NEW_LINE>this.nodeManager.addNode(node);<NEW_LINE>} | String xml = sb.toString(); |
1,032,325 | public void marshall(ComponentVersion componentVersion, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (componentVersion == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(componentVersion.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(componentVersion.getVersion(), VERSION_BINDING);<NEW_LINE>protocolMarshaller.marshall(componentVersion.getDescription(), DESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(componentVersion.getPlatform(), PLATFORM_BINDING);<NEW_LINE>protocolMarshaller.marshall(componentVersion.getSupportedOsVersions(), SUPPORTEDOSVERSIONS_BINDING);<NEW_LINE>protocolMarshaller.marshall(componentVersion.getType(), TYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(componentVersion.getOwner(), OWNER_BINDING);<NEW_LINE>protocolMarshaller.marshall(componentVersion.getDateCreated(), DATECREATED_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | componentVersion.getArn(), ARN_BINDING); |
911,472 | public emu.grasscutter.net.proto.FriendBriefOuterClass.FriendBrief buildPartial() {<NEW_LINE>emu.grasscutter.net.proto.FriendBriefOuterClass.FriendBrief result = new emu.grasscutter.net.proto.FriendBriefOuterClass.FriendBrief(this);<NEW_LINE>int from_bitField0_ = bitField0_;<NEW_LINE>result.uid_ = uid_;<NEW_LINE>result.nickname_ = nickname_;<NEW_LINE>result.level_ = level_;<NEW_LINE>result.worldLevel_ = worldLevel_;<NEW_LINE>result.signature_ = signature_;<NEW_LINE>result.onlineState_ = onlineState_;<NEW_LINE>result.param_ = param_;<NEW_LINE>result.isMpModeAvailable_ = isMpModeAvailable_;<NEW_LINE>result.onlineId_ = onlineId_;<NEW_LINE>result.lastActiveTime_ = lastActiveTime_;<NEW_LINE>result.nameCardId_ = nameCardId_;<NEW_LINE>result.mpPlayerNum_ = mpPlayerNum_;<NEW_LINE>result.isChatNoDisturb_ = isChatNoDisturb_;<NEW_LINE>result.chatSequence_ = chatSequence_;<NEW_LINE>result.remarkName_ = remarkName_;<NEW_LINE>if (showAvatarInfoListBuilder_ == null) {<NEW_LINE>if (((bitField0_ & 0x00000001) != 0)) {<NEW_LINE>showAvatarInfoList_ = java.util.Collections.unmodifiableList(showAvatarInfoList_);<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000001);<NEW_LINE>}<NEW_LINE>result.showAvatarInfoList_ = showAvatarInfoList_;<NEW_LINE>} else {<NEW_LINE>result<MASK><NEW_LINE>}<NEW_LINE>result.friendEnterHomeOption_ = friendEnterHomeOption_;<NEW_LINE>if (avatarBuilder_ == null) {<NEW_LINE>result.avatar_ = avatar_;<NEW_LINE>} else {<NEW_LINE>result.avatar_ = avatarBuilder_.build();<NEW_LINE>}<NEW_LINE>result.unk1_ = unk1_;<NEW_LINE>result.unk2_ = unk2_;<NEW_LINE>onBuilt();<NEW_LINE>return result;<NEW_LINE>} | .showAvatarInfoList_ = showAvatarInfoListBuilder_.build(); |
497,015 | public void hierarchyChanged(PathObjectHierarchyEvent event) {<NEW_LINE>if (hierarchy == null) {<NEW_LINE>listCounts<MASK><NEW_LINE>return;<NEW_LINE>} else if (!Platform.isFxApplicationThread()) {<NEW_LINE>Platform.runLater(() -> hierarchyChanged(event));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Collection<PathObject> newList = hierarchy.getPointObjects(PathAnnotationObject.class);<NEW_LINE>// We want to avoid shuffling the list if possible we adding points<NEW_LINE>var items = listCounts.getItems();<NEW_LINE>if (items.size() == newList.size() && (newList.equals(items) || newList.containsAll(items))) {<NEW_LINE>// if (event != null && event.getEventType() == HierarchyEventType.CHANGE_CLASSIFICATION || event.getEventType() == HierarchyEventType.CHANGE_MEASUREMENTS || (event.getStructureChangeBase() != null && event.getStructureChangeBase().isPoint()) || PathObjectTools.containsPointObject(event.getChangedObjects()))<NEW_LINE>listCounts.refresh();<NEW_LINE>} else {<NEW_LINE>// Update the items if we need to<NEW_LINE>listCounts.getItems().setAll(newList);<NEW_LINE>}<NEW_LINE>// We want to retain selection status<NEW_LINE>selectedPathObjectChanged(hierarchy.getSelectionModel().getSelectedObject(), null, hierarchy.getSelectionModel().getSelectedObjects());<NEW_LINE>} | .getItems().clear(); |
1,313,230 | private Trie split(TrieKeySlice commonPath) {<NEW_LINE>int commonPathLength = commonPath.length();<NEW_LINE>TrieKeySlice newChildSharedPath = sharedPath.slice(commonPathLength + 1, sharedPath.length());<NEW_LINE>Trie newChildTrie = new Trie(this.store, newChildSharedPath, this.value, this.left, this.right, this.valueLength, this.valueHash, this.childrenSize);<NEW_LINE>NodeReference newChildReference = new NodeReference(<MASK><NEW_LINE>// this bit will be implicit and not present in a shared path<NEW_LINE>byte pos = sharedPath.get(commonPathLength);<NEW_LINE>VarInt childrenSize = new VarInt(newChildReference.referenceSize());<NEW_LINE>NodeReference newLeft;<NEW_LINE>NodeReference newRight;<NEW_LINE>if (pos == 0) {<NEW_LINE>newLeft = newChildReference;<NEW_LINE>newRight = NodeReference.empty();<NEW_LINE>} else {<NEW_LINE>newLeft = NodeReference.empty();<NEW_LINE>newRight = newChildReference;<NEW_LINE>}<NEW_LINE>return new Trie(this.store, commonPath, null, newLeft, newRight, Uint24.ZERO, null, childrenSize);<NEW_LINE>} | this.store, newChildTrie, null); |
1,291,877 | private void cmd_zoomAcross() {<NEW_LINE>final int record_ID = m_curTab.getRecord_ID();<NEW_LINE>if (record_ID <= 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Query<NEW_LINE>MQuery query = new MQuery();<NEW_LINE>// Current row<NEW_LINE>String link = m_curTab.getKeyColumnName();<NEW_LINE>// Link for detail records<NEW_LINE>if (link.length() == 0) {<NEW_LINE>link = m_curTab.getLinkColumnName();<NEW_LINE>}<NEW_LINE>if (link.length() != 0) {<NEW_LINE>if (link.endsWith("_ID")) {<NEW_LINE>query.addRestriction(link, Operator.EQUAL, Env.getContextAsInt(m_ctx, m_curWindowNo, link));<NEW_LINE>} else {<NEW_LINE>query.addRestriction(link, Operator.EQUAL, Env.getContext(m_ctx, m_curWindowNo, link));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>new AZoomAcross(aZoomAcross.getButton(), m_curTab.getTableName(), <MASK><NEW_LINE>} | m_curTab.getAdWindowId(), query); |
1,473,463 | public void testCreateSharedDurableConsumerWithMsgSelector_2Subscribers(HttpServletRequest request, HttpServletResponse response) throws Exception {<NEW_LINE>JMSContext jmsContextReceiver = jmsTCFBindings.createContext();<NEW_LINE>JMSConsumer jmsConsumer1 = jmsContextReceiver.createSharedDurableConsumer(jmsTopic1, "DURATEST1", "Company = 'IBM'");<NEW_LINE>JMSProducer jmsProducer = jmsContextReceiver.createProducer();<NEW_LINE>TextMessage <MASK><NEW_LINE>msgOut.setStringProperty("Company", "IBM");<NEW_LINE>jmsProducer.send(jmsTopic1, msgOut);<NEW_LINE>TextMessage msgIn = (TextMessage) jmsConsumer1.receive(30000);<NEW_LINE>JMSConsumer jmsConsumer2 = jmsContextReceiver.createSharedDurableConsumer(jmsTopic1, "DURATEST1", "Company = 'IBM'");<NEW_LINE>CompositeData[] obn = listSubscriptions("WebSphere:feature=wasJmsServer,type=Topic,name=NewTopic1");<NEW_LINE>boolean testFailed = false;<NEW_LINE>if (obn.length != 1) {<NEW_LINE>testFailed = true;<NEW_LINE>}<NEW_LINE>jmsConsumer1.close();<NEW_LINE>jmsConsumer2.close();<NEW_LINE>jmsContextReceiver.unsubscribe("DURATEST1");<NEW_LINE>jmsContextReceiver.close();<NEW_LINE>if (testFailed) {<NEW_LINE>throw new Exception("testCreateSharedDurableConsumerWithMsgSelector_2Subscribers failed [ " + obn.length + " ] [ " + obn + " ]");<NEW_LINE>}<NEW_LINE>} | msgOut = jmsContextReceiver.createTextMessage("This is a test message"); |
1,111,920 | private int shiftIndentInside(final TextRange elementRange, final int shift) {<NEW_LINE>final StringBuilder buffer = new StringBuilder();<NEW_LINE>StringBuilder afterWhiteSpace = new StringBuilder();<NEW_LINE>int whiteSpaceLength = 0;<NEW_LINE>boolean insideWhiteSpace = true;<NEW_LINE>int line = 0;<NEW_LINE>for (int i = elementRange.getStartOffset(); i < elementRange.getEndOffset(); i++) {<NEW_LINE>final char c = myDocument.<MASK><NEW_LINE>switch(c) {<NEW_LINE>case '\n':<NEW_LINE>if (line > 0) {<NEW_LINE>createWhiteSpace(whiteSpaceLength + shift, buffer);<NEW_LINE>}<NEW_LINE>buffer.append(afterWhiteSpace.toString());<NEW_LINE>insideWhiteSpace = true;<NEW_LINE>whiteSpaceLength = 0;<NEW_LINE>afterWhiteSpace = new StringBuilder();<NEW_LINE>buffer.append(c);<NEW_LINE>line++;<NEW_LINE>break;<NEW_LINE>case ' ':<NEW_LINE>if (insideWhiteSpace) {<NEW_LINE>whiteSpaceLength += 1;<NEW_LINE>} else {<NEW_LINE>afterWhiteSpace.append(c);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case '\t':<NEW_LINE>if (insideWhiteSpace) {<NEW_LINE>whiteSpaceLength += getIndentOptions().TAB_SIZE;<NEW_LINE>} else {<NEW_LINE>afterWhiteSpace.append(c);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>insideWhiteSpace = false;<NEW_LINE>afterWhiteSpace.append(c);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (line > 0) {<NEW_LINE>createWhiteSpace(whiteSpaceLength + shift, buffer);<NEW_LINE>}<NEW_LINE>buffer.append(afterWhiteSpace.toString());<NEW_LINE>myDocument.replaceString(elementRange.getStartOffset(), elementRange.getEndOffset(), buffer.toString());<NEW_LINE>return buffer.length();<NEW_LINE>} | getCharsSequence().charAt(i); |
1,435,736 | protected Map<String, String> parse(String text) {<NEW_LINE>Map<String, String> map = new HashMap<>();<NEW_LINE>String[] lines = StringUtil.splitNewline(text);<NEW_LINE>int line = 0;<NEW_LINE>for (String lineStr : lines) {<NEW_LINE>line++;<NEW_LINE>// Skip initial header<NEW_LINE>if (lineStr.startsWith("v1\t"))<NEW_LINE>continue;<NEW_LINE>String[] args = lineStr.trim().split("\t");<NEW_LINE>String type = args[0];<NEW_LINE>try {<NEW_LINE>switch(type) {<NEW_LINE>case "CLASS":<NEW_LINE>String obfClass = args[1];<NEW_LINE>String renamedClass = args[2];<NEW_LINE><MASK><NEW_LINE>break;<NEW_LINE>case "FIELD":<NEW_LINE>{<NEW_LINE>String obfOwner = args[1];<NEW_LINE>String obfName = args[3];<NEW_LINE>String renamed = args[4];<NEW_LINE>map.put(obfOwner + "." + obfName, renamed);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case "METHOD":<NEW_LINE>{<NEW_LINE>String obfOwner = args[1];<NEW_LINE>String obfDesc = args[2];<NEW_LINE>String obfName = args[3];<NEW_LINE>String renamed = args[4];<NEW_LINE>map.put(obfOwner + "." + obfName + obfDesc, renamed);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>default:<NEW_LINE>trace("Unknown Tiny-V1 mappings line type: \"{}\" @line {}", type, line);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} catch (IndexOutOfBoundsException ex) {<NEW_LINE>throw new IllegalArgumentException(FAIL + "failed parsing line " + line, ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return map;<NEW_LINE>} | map.put(obfClass, renamedClass); |
710,006 | protected void updateHessian(Tuple3<Double, Double, Vector> labelVector, DenseVector coefVector, DenseMatrix updateHessian) {<NEW_LINE>Vector vec = labelVector.f2;<NEW_LINE>double eta = getEta(labelVector, coefVector);<NEW_LINE>double deriv = this.unaryLossFunc.secondDerivative(eta, labelVector.f1) * labelVector.f0;<NEW_LINE>if (vec instanceof DenseVector) {<NEW_LINE>int nCols = updateHessian.numCols();<NEW_LINE>int nRows = updateHessian.numRows();<NEW_LINE>double[] data = updateHessian.getData();<NEW_LINE>double[] vecData = ((DenseVector) vec).getData();<NEW_LINE>int pos = 0;<NEW_LINE>for (int j = 0; j < nCols; j++) {<NEW_LINE>for (int i = 0; i < nRows; i++) {<NEW_LINE>data[pos++] += vecData[i] * vecData[j] * deriv;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (vec instanceof SparseVector) {<NEW_LINE>double[] data = updateHessian.getData();<NEW_LINE>int nRows = updateHessian.numRows();<NEW_LINE>int[] indices = ((<MASK><NEW_LINE>double[] values = ((SparseVector) vec).getValues();<NEW_LINE>for (int i = 0; i < values.length; i++) {<NEW_LINE>for (int j = 0; j < values.length; j++) {<NEW_LINE>data[indices[i] + indices[j] * nRows] += values[i] * values[j] * deriv;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new UnsupportedOperationException("not support sparse Hessian matrix computing.");<NEW_LINE>}<NEW_LINE>} | SparseVector) vec).getIndices(); |
1,685,404 | public void learnFernNoise(boolean positive, ImageRectangle r) {<NEW_LINE>float rectWidth = r.getWidth();<NEW_LINE>float rectHeight = r.getHeight();<NEW_LINE>float c_x = r.x0 + (rectWidth - 1) / 2.0f;<NEW_LINE>float c_y = r.y0 + (rectHeight - 1) / 2.0f;<NEW_LINE>for (int i = 0; i < ferns.length; i++) {<NEW_LINE>// first learn it with no noise<NEW_LINE>int value = computeFernValue(c_x, c_y, rectWidth<MASK><NEW_LINE>TldFernFeature f = managers[i].lookupFern(value);<NEW_LINE>increment(f, positive);<NEW_LINE>for (int j = 0; j < numLearnRandom; j++) {<NEW_LINE>value = computeFernValueRand(c_x, c_y, rectWidth, rectHeight, ferns[i]);<NEW_LINE>f = managers[i].lookupFern(value);<NEW_LINE>increment(f, positive);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | , rectHeight, ferns[i]); |
231,261 | public void createFolder(@NotNull String title) {<NEW_LINE>logDebug("createFolder");<NEW_LINE>if (!isOnline(this)) {<NEW_LINE>showSnackbar(getString(R.string.error_server_connection_problem));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (isFinishing()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>long parentHandle = -1;<NEW_LINE>cDriveExplorer = getCloudExplorerFragment();<NEW_LINE>iSharesExplorer = getIncomingExplorerFragment();<NEW_LINE>if (isCloudVisible()) {<NEW_LINE>parentHandle = cDriveExplorer.getParentHandle();<NEW_LINE>} else if (isIncomingVisible()) {<NEW_LINE>parentHandle = iSharesExplorer.getParentHandle();<NEW_LINE>}<NEW_LINE>MegaNode parentNode = megaApi.getNodeByHandle(parentHandle);<NEW_LINE>if (parentNode != null) {<NEW_LINE>logDebug("parentNode != null: " + parentNode.getName());<NEW_LINE>boolean exists = false;<NEW_LINE>ArrayList<MegaNode> <MASK><NEW_LINE>for (int i = 0; i < nL.size(); i++) {<NEW_LINE>if (title.compareTo(nL.get(i).getName()) == 0) {<NEW_LINE>exists = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!exists) {<NEW_LINE>statusDialog = null;<NEW_LINE>try {<NEW_LINE>statusDialog = MegaProgressDialogUtil.createProgressDialog(this, getString(R.string.context_creating_folder));<NEW_LINE>statusDialog.show();<NEW_LINE>} catch (Exception e) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>megaApi.createFolder(title, parentNode, new CreateFolderListener(this));<NEW_LINE>} else {<NEW_LINE>showSnackbar(getString(R.string.context_folder_already_exists));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>logWarning("parentNode == null: " + parentHandle);<NEW_LINE>parentNode = megaApi.getRootNode();<NEW_LINE>if (parentNode != null) {<NEW_LINE>logDebug("megaApi.getRootNode() != null");<NEW_LINE>boolean exists = false;<NEW_LINE>ArrayList<MegaNode> nL = megaApi.getChildren(parentNode);<NEW_LINE>for (int i = 0; i < nL.size(); i++) {<NEW_LINE>if (title.compareTo(nL.get(i).getName()) == 0) {<NEW_LINE>exists = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!exists) {<NEW_LINE>statusDialog = null;<NEW_LINE>try {<NEW_LINE>statusDialog = MegaProgressDialogUtil.createProgressDialog(this, getString(R.string.context_creating_folder));<NEW_LINE>statusDialog.show();<NEW_LINE>} catch (Exception e) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>megaApi.createFolder(title, parentNode, new CreateFolderListener(this));<NEW_LINE>} else {<NEW_LINE>showSnackbar(getString(R.string.context_folder_already_exists));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | nL = megaApi.getChildren(parentNode); |
626,431 | public List<GenTaskBySqlBuilder> updateAndGetTasks(int projectId) throws SQLException {<NEW_LINE>FreeSelectSqlBuilder<List<GenTaskBySqlBuilder>> builder = new FreeSelectSqlBuilder<>(dbCategory);<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>sb.append("SELECT id, project_id, db_name,table_name,class_name,method_name,sql_style,crud_type,fields,where_condition,sql_content,`generated`,version,update_user_no,update_time,comment,scalarType,pagination,orderby,approved,approveMsg,hints ");<NEW_LINE>sb.append("FROM task_auto WHERE project_id=? AND `generated`=FALSE");<NEW_LINE>builder.setTemplate(sb.toString());<NEW_LINE>StatementParameters parameters = new StatementParameters();<NEW_LINE>int i = 1;<NEW_LINE>parameters.set(i++, "project_id", Types.INTEGER, projectId);<NEW_LINE>builder.mapWith(genTaskBySqlBuilderRowMapper);<NEW_LINE>DalHints hints = DalHints.createIfAbsent(null).allowPartial();<NEW_LINE>List<GenTaskBySqlBuilder> list = queryDao.query(builder, parameters, hints);<NEW_LINE>List<GenTaskBySqlBuilder> <MASK><NEW_LINE>if (list == null || list.size() == 0)<NEW_LINE>return result;<NEW_LINE>processList(list);<NEW_LINE>for (GenTaskBySqlBuilder entity : list) {<NEW_LINE>entity.setGenerated(true);<NEW_LINE>if (updateTask(entity) > 0) {<NEW_LINE>result.add(entity);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | result = new ArrayList<>(); |
1,819,727 | public static ListRdsDBInstancesResponse unmarshall(ListRdsDBInstancesResponse listRdsDBInstancesResponse, UnmarshallerContext _ctx) {<NEW_LINE>listRdsDBInstancesResponse.setRequestId(_ctx.stringValue("ListRdsDBInstancesResponse.RequestId"));<NEW_LINE>listRdsDBInstancesResponse.setTotalCount(_ctx.integerValue("ListRdsDBInstancesResponse.TotalCount"));<NEW_LINE>listRdsDBInstancesResponse.setSuccess(_ctx.stringValue("ListRdsDBInstancesResponse.Success"));<NEW_LINE>List<DBInstance> rdsInstances = new ArrayList<DBInstance>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListRdsDBInstancesResponse.RdsInstances.Length"); i++) {<NEW_LINE>DBInstance dBInstance = new DBInstance();<NEW_LINE>dBInstance.setDBInstanceId(_ctx.stringValue("ListRdsDBInstancesResponse.RdsInstances[" + i + "].DBInstanceId"));<NEW_LINE>dBInstance.setDBInstanceDescription(_ctx.stringValue("ListRdsDBInstancesResponse.RdsInstances[" + i + "].DBInstanceDescription"));<NEW_LINE>dBInstance.setRegionId(_ctx.stringValue("ListRdsDBInstancesResponse.RdsInstances[" + i + "].RegionId"));<NEW_LINE>dBInstance.setDBInstanceType(_ctx.stringValue("ListRdsDBInstancesResponse.RdsInstances[" + i + "].DBInstanceType"));<NEW_LINE>dBInstance.setDBInstanceStatus(_ctx.stringValue("ListRdsDBInstancesResponse.RdsInstances[" + i + "].DBInstanceStatus"));<NEW_LINE>dBInstance.setEngine(_ctx.stringValue("ListRdsDBInstancesResponse.RdsInstances[" + i + "].Engine"));<NEW_LINE>dBInstance.setEngineVersion(_ctx.stringValue("ListRdsDBInstancesResponse.RdsInstances[" + i + "].EngineVersion"));<NEW_LINE>dBInstance.setDBInstanceNetType(_ctx.stringValue("ListRdsDBInstancesResponse.RdsInstances[" + i + "].DBInstanceNetType"));<NEW_LINE>dBInstance.setLockMode(_ctx.stringValue("ListRdsDBInstancesResponse.RdsInstances[" + i + "].LockMode"));<NEW_LINE>dBInstance.setInstanceNetworkType(_ctx.stringValue("ListRdsDBInstancesResponse.RdsInstances[" + i + "].InstanceNetworkType"));<NEW_LINE>dBInstance.setVpcCloudInstanceId(_ctx.stringValue("ListRdsDBInstancesResponse.RdsInstances[" + i + "].VpcCloudInstanceId"));<NEW_LINE>dBInstance.setVpcId(_ctx.stringValue("ListRdsDBInstancesResponse.RdsInstances[" + i + "].VpcId"));<NEW_LINE>dBInstance.setVSwitchId(_ctx.stringValue<MASK><NEW_LINE>dBInstance.setZoneId(_ctx.stringValue("ListRdsDBInstancesResponse.RdsInstances[" + i + "].ZoneId"));<NEW_LINE>dBInstance.setMutriORsignle(_ctx.booleanValue("ListRdsDBInstancesResponse.RdsInstances[" + i + "].MutriORsignle"));<NEW_LINE>dBInstance.setResourceGroupId(_ctx.stringValue("ListRdsDBInstancesResponse.RdsInstances[" + i + "].ResourceGroupId"));<NEW_LINE>rdsInstances.add(dBInstance);<NEW_LINE>}<NEW_LINE>listRdsDBInstancesResponse.setRdsInstances(rdsInstances);<NEW_LINE>return listRdsDBInstancesResponse;<NEW_LINE>} | ("ListRdsDBInstancesResponse.RdsInstances[" + i + "].VSwitchId")); |
14,941 | public static BlockPos readBlockPos(NBTBase base) {<NEW_LINE>if (base == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>switch(base.getId()) {<NEW_LINE>case Constants.NBT.TAG_INT_ARRAY:<NEW_LINE>{<NEW_LINE>int[] array = ((NBTTagIntArray) base).getIntArray();<NEW_LINE>if (array.length == 3) {<NEW_LINE>return new BlockPos(array[0], array[1], array[2]);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>case Constants.NBT.TAG_COMPOUND:<NEW_LINE>{<NEW_LINE>NBTTagCompound nbt = (NBTTagCompound) base;<NEW_LINE>BlockPos pos = null;<NEW_LINE>if (nbt.hasKey("i")) {<NEW_LINE>int i = nbt.getInteger("i");<NEW_LINE>int <MASK><NEW_LINE>int k = nbt.getInteger("k");<NEW_LINE>pos = new BlockPos(i, j, k);<NEW_LINE>} else if (nbt.hasKey("x")) {<NEW_LINE>int x = nbt.getInteger("x");<NEW_LINE>int y = nbt.getInteger("y");<NEW_LINE>int z = nbt.getInteger("z");<NEW_LINE>pos = new BlockPos(x, y, z);<NEW_LINE>} else if (nbt.hasKey("pos")) {<NEW_LINE>return readBlockPos(nbt.getTag("pos"));<NEW_LINE>} else {<NEW_LINE>BCLog.logger.warn("Attempted to read a block positions from a compound tag without the correct sub-tags! (" + base + ")", new Throwable());<NEW_LINE>}<NEW_LINE>return pos;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>BCLog.logger.warn("Attempted to read a block position from an invalid tag! (" + base + ")", new Throwable());<NEW_LINE>return null;<NEW_LINE>} | j = nbt.getInteger("j"); |
1,090,514 | public void doReportStat(SofaTracerSpan sofaTracerSpan) {<NEW_LINE>// tags<NEW_LINE>Map<String, String> tagsWithStr = sofaTracerSpan.getTagsWithStr();<NEW_LINE>StatMapKey statKey = new StatMapKey();<NEW_LINE>String appName = tagsWithStr.get(CommonSpanTags.LOCAL_APP);<NEW_LINE>// service name<NEW_LINE>String serviceName = tagsWithStr.get(CommonSpanTags.SERVICE);<NEW_LINE>// method name<NEW_LINE>String methodName = tagsWithStr.get(CommonSpanTags.METHOD);<NEW_LINE>statKey.addKey(CommonSpanTags.LOCAL_APP, appName);<NEW_LINE>statKey.addKey(CommonSpanTags.SERVICE, serviceName);<NEW_LINE>statKey.addKey(CommonSpanTags.METHOD, methodName);<NEW_LINE>String resultCode = tagsWithStr.get(CommonSpanTags.RESULT_CODE);<NEW_LINE>statKey.setResult(SofaTracerConstant.RESULT_CODE_SUCCESS.equals(resultCode) ? <MASK><NEW_LINE>statKey.setEnd(buildString(new String[] { getLoadTestMark(sofaTracerSpan) }));<NEW_LINE>statKey.setLoadTest(TracerUtils.isLoadTest(sofaTracerSpan));<NEW_LINE>long duration = sofaTracerSpan.getEndTime() - sofaTracerSpan.getStartTime();<NEW_LINE>long[] values = new long[] { 1, duration };<NEW_LINE>this.addStat(statKey, values);<NEW_LINE>} | SofaTracerConstant.STAT_FLAG_SUCCESS : SofaTracerConstant.STAT_FLAG_FAILS); |
42,756 | public RegisterWorkerPResponse call() throws Exception {<NEW_LINE>// If an error was received earlier, the stream is no longer open<NEW_LINE>Preconditions.checkState(mErrorReceived.get() == null, "The stream has been closed due to an earlier error received: %s", mErrorReceived.get());<NEW_LINE>// Initialize the context on the 1st message<NEW_LINE>synchronized (workerRequestObserver) {<NEW_LINE>if (mContext == null) {<NEW_LINE>Preconditions.checkState(isHead, "Context is not initialized but the request is not the 1st in a stream!");<NEW_LINE>LOG.debug("Initializing context for {}", workerId);<NEW_LINE>mContext = WorkerRegisterContext.<MASK><NEW_LINE>LOG.debug("Context created for {}", workerId);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Verify the context is successfully initialized<NEW_LINE>Preconditions.checkState(mContext != null, "Stream message received from the client side but the context was not initialized!");<NEW_LINE>Preconditions.checkState(mContext.isOpen(), "WorkerRegisterContext has been closed before this message is received! " + "Probably %s was exceeded!", PropertyKey.MASTER_WORKER_REGISTER_STREAM_RESPONSE_TIMEOUT.toString());<NEW_LINE>// Update the TS before and after processing the request, so that when a message<NEW_LINE>// takes long to process, the stream does not time out.<NEW_LINE>mContext.updateTs();<NEW_LINE>mBlockMaster.workerRegisterStream(mContext, chunk, isHead);<NEW_LINE>mContext.updateTs();<NEW_LINE>// Return an ACK to the worker so it sends the next batch<NEW_LINE>return RegisterWorkerPResponse.newBuilder().build();<NEW_LINE>} | create(mBlockMaster, workerId, workerRequestObserver); |
1,337,502 | public boolean eventOccurred(UISWTViewEvent event) {<NEW_LINE>switch(event.getType()) {<NEW_LINE>case UISWTViewEvent.TYPE_CREATE:<NEW_LINE>swtView = event.getView();<NEW_LINE>swtView.setTitle(MessageText<MASK><NEW_LINE>swtView.setToolBarListener(this);<NEW_LINE>break;<NEW_LINE>case UISWTViewEvent.TYPE_DESTROY:<NEW_LINE>delete();<NEW_LINE>break;<NEW_LINE>case UISWTViewEvent.TYPE_INITIALIZE:<NEW_LINE>initialize((Composite) event.getData());<NEW_LINE>break;<NEW_LINE>case UISWTViewEvent.TYPE_LANGUAGEUPDATE:<NEW_LINE>Messages.updateLanguageForControl(getComposite());<NEW_LINE>swtView.setTitle(MessageText.getString(getData()));<NEW_LINE>break;<NEW_LINE>case UISWTViewEvent.TYPE_DATASOURCE_CHANGED:<NEW_LINE>dataSourceChanged(event.getData());<NEW_LINE>break;<NEW_LINE>case UISWTViewEvent.TYPE_FOCUSGAINED:<NEW_LINE>String id = "DMDetails_Swarm";<NEW_LINE>// do this before next code as it can pick up the corrent 'manager' ref<NEW_LINE>setFocused(true);<NEW_LINE>synchronized (dm_data_lock) {<NEW_LINE>if (dm_data.length == 0) {<NEW_LINE>SelectedContentManager.changeCurrentlySelectedContent(id, null);<NEW_LINE>} else {<NEW_LINE>DownloadManager manager = dm_data[0].manager;<NEW_LINE>if (manager.getTorrent() != null) {<NEW_LINE>id += "." + manager.getInternalName();<NEW_LINE>} else {<NEW_LINE>id += ":" + manager.getSize();<NEW_LINE>}<NEW_LINE>SelectedContentManager.changeCurrentlySelectedContent(id, new SelectedContent[] { new SelectedContent(manager) });<NEW_LINE>}<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case UISWTViewEvent.TYPE_FOCUSLOST:<NEW_LINE>setFocused(false);<NEW_LINE>SelectedContentManager.clearCurrentlySelectedContent();<NEW_LINE>break;<NEW_LINE>case UISWTViewEvent.TYPE_REFRESH:<NEW_LINE>refresh();<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | .getString(getData())); |
1,650,562 | private void addFileToConfigFileManager(final Set<ConfigFileGroup> selectedGroups, final File file) throws IOException {<NEW_LINE>final ConfigFileManager manager = getConfigFileManager(Templates.getProject(wizard));<NEW_LINE>try {<NEW_LINE>manager.mutex().writeAccess(new ExceptionAction<Void>() {<NEW_LINE><NEW_LINE>public Void run() throws IOException {<NEW_LINE>List<File> origFiles = manager.getConfigFiles();<NEW_LINE>List<File> newFiles = <MASK><NEW_LINE>if (!newFiles.contains(file)) {<NEW_LINE>newFiles.add(file);<NEW_LINE>}<NEW_LINE>List<ConfigFileGroup> origGroups = manager.getConfigFileGroups();<NEW_LINE>List<ConfigFileGroup> newGroups = null;<NEW_LINE>if (selectedGroups.size() > 0) {<NEW_LINE>newGroups = new ArrayList<ConfigFileGroup>(origGroups.size());<NEW_LINE>for (ConfigFileGroup group : origGroups) {<NEW_LINE>if (selectedGroups.contains(group)) {<NEW_LINE>ConfigFileGroup newGroup = addFileToConfigGroup(group, file);<NEW_LINE>newGroups.add(newGroup);<NEW_LINE>} else {<NEW_LINE>newGroups.add(group);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>newGroups = origGroups;<NEW_LINE>}<NEW_LINE>manager.putConfigFilesAndGroups(newFiles, newGroups);<NEW_LINE>manager.save();<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (MutexException e) {<NEW_LINE>throw (IOException) e.getException();<NEW_LINE>}<NEW_LINE>} | new ArrayList<File>(origFiles); |
1,618,005 | public Object execute(CommandContext commandContext) {<NEW_LINE>if (resultType == ResultType.LIST) {<NEW_LINE>return executeList(commandContext, getParameterMap(), 0, Integer.MAX_VALUE);<NEW_LINE>} else if (resultType == ResultType.LIST_PAGE) {<NEW_LINE>Map<String, Object> parameterMap = getParameterMap();<NEW_LINE>parameterMap.put("resultType", "LIST_PAGE");<NEW_LINE>parameterMap.put("firstResult", firstResult);<NEW_LINE>parameterMap.put("maxResults", maxResults);<NEW_LINE>if (StringUtils.isNotBlank(Objects.toString(parameterMap.get("orderBy"), ""))) {<NEW_LINE>parameterMap.put("orderByColumns", "RES." + parameterMap.get("orderBy"));<NEW_LINE>} else {<NEW_LINE>parameterMap.put("orderByColumns", "RES.ID_ asc");<NEW_LINE>}<NEW_LINE>int firstRow = firstResult + 1;<NEW_LINE>parameterMap.put("firstRow", firstRow);<NEW_LINE>int lastRow = 0;<NEW_LINE>if (maxResults == Integer.MAX_VALUE) {<NEW_LINE>lastRow = maxResults;<NEW_LINE>} else {<NEW_LINE>lastRow = firstResult + maxResults + 1;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>return executeList(commandContext, parameterMap, firstResult, maxResults);<NEW_LINE>} else if (resultType == ResultType.SINGLE_RESULT) {<NEW_LINE>return executeSingleResult(commandContext);<NEW_LINE>} else {<NEW_LINE>return executeCount(commandContext, getParameterMap());<NEW_LINE>}<NEW_LINE>} | parameterMap.put("lastRow", lastRow); |
330,755 | private void processEntitlementNotification(final EntitlementNotificationKey key, final InternalCallContext internalCallContext, final CallContext callContext) {<NEW_LINE>final Entitlement entitlement;<NEW_LINE>try {<NEW_LINE>entitlement = entitlementInternalApi.getEntitlementForId(key.getEntitlementId(), internalCallContext);<NEW_LINE>} catch (final EntitlementApiException e) {<NEW_LINE>log.error("Error retrieving entitlementId='{}'", key.getEntitlementId(), e);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!(entitlement instanceof DefaultEntitlement)) {<NEW_LINE>log.error("Error retrieving entitlementId='{}', unexpected entitlement className='{}'", key.getEntitlementId(), entitlement.getClass().getName());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final <MASK><NEW_LINE>try {<NEW_LINE>if (EntitlementNotificationKeyAction.CHANGE.equals(entitlementNotificationKeyAction) || EntitlementNotificationKeyAction.CANCEL.equals(entitlementNotificationKeyAction)) {<NEW_LINE>blockAddOnsIfRequired(key, (DefaultEntitlement) entitlement, callContext, internalCallContext);<NEW_LINE>} else if (EntitlementNotificationKeyAction.PAUSE.equals(entitlementNotificationKeyAction)) {<NEW_LINE>entitlementInternalApi.pause(key.getBundleId(), internalCallContext.toLocalDate(key.getEffectiveDate()), ImmutableList.<PluginProperty>of(), internalCallContext);<NEW_LINE>} else if (EntitlementNotificationKeyAction.RESUME.equals(entitlementNotificationKeyAction)) {<NEW_LINE>entitlementInternalApi.resume(key.getBundleId(), internalCallContext.toLocalDate(key.getEffectiveDate()), ImmutableList.<PluginProperty>of(), internalCallContext);<NEW_LINE>}<NEW_LINE>} catch (final EntitlementApiException e) {<NEW_LINE>log.error("Error processing event for entitlementId='{}'", entitlement.getId(), e);<NEW_LINE>}<NEW_LINE>} | EntitlementNotificationKeyAction entitlementNotificationKeyAction = key.getEntitlementNotificationKeyAction(); |
1,598,214 | private VisualSampleEntry createSampleEntry(@NonNull final ArrayList<ByteBuffer> sps, @NonNull final ArrayList<ByteBuffer> pps, @NonNull final ArrayList<ByteBuffer> vps, @Nullable final SequenceParameterSetRbsp spsStruct) {<NEW_LINE>final <MASK><NEW_LINE>visualSampleEntry.setDataReferenceIndex(1);<NEW_LINE>visualSampleEntry.setDepth(24);<NEW_LINE>visualSampleEntry.setFrameCount(1);<NEW_LINE>visualSampleEntry.setHorizresolution(72);<NEW_LINE>visualSampleEntry.setVertresolution(72);<NEW_LINE>visualSampleEntry.setCompressorname("HEVC Coding");<NEW_LINE>final HevcConfigurationBox hevcConfigurationBox = new HevcConfigurationBox();<NEW_LINE>hevcConfigurationBox.getHevcDecoderConfigurationRecord().setConfigurationVersion(1);<NEW_LINE>if (spsStruct != null) {<NEW_LINE>visualSampleEntry.setWidth(spsStruct.pic_width_in_luma_samples);<NEW_LINE>visualSampleEntry.setHeight(spsStruct.pic_height_in_luma_samples);<NEW_LINE>final DimensionTrackExtension dte = this.getTrackExtension(DimensionTrackExtension.class);<NEW_LINE>if (dte == null) {<NEW_LINE>this.addTrackExtension(new DimensionTrackExtension(spsStruct.pic_width_in_luma_samples, spsStruct.pic_height_in_luma_samples));<NEW_LINE>}<NEW_LINE>final HevcDecoderConfigurationRecord hevcDecoderConfigurationRecord = hevcConfigurationBox.getHevcDecoderConfigurationRecord();<NEW_LINE>hevcDecoderConfigurationRecord.setChromaFormat(spsStruct.chroma_format_idc);<NEW_LINE>hevcDecoderConfigurationRecord.setGeneral_profile_idc(spsStruct.general_profile_idc);<NEW_LINE>hevcDecoderConfigurationRecord.setGeneral_profile_compatibility_flags(spsStruct.general_profile_compatibility_flags);<NEW_LINE>hevcDecoderConfigurationRecord.setGeneral_constraint_indicator_flags(spsStruct.general_constraint_indicator_flags);<NEW_LINE>hevcDecoderConfigurationRecord.setGeneral_level_idc(spsStruct.general_level_idc);<NEW_LINE>hevcDecoderConfigurationRecord.setGeneral_tier_flag(spsStruct.general_tier_flag);<NEW_LINE>hevcDecoderConfigurationRecord.setGeneral_profile_space(spsStruct.general_profile_space);<NEW_LINE>hevcDecoderConfigurationRecord.setBitDepthChromaMinus8(spsStruct.bit_depth_chroma_minus8);<NEW_LINE>hevcDecoderConfigurationRecord.setBitDepthLumaMinus8(spsStruct.bit_depth_luma_minus8);<NEW_LINE>hevcDecoderConfigurationRecord.setTemporalIdNested(spsStruct.sps_temporal_id_nesting_flag);<NEW_LINE>}<NEW_LINE>hevcConfigurationBox.getHevcDecoderConfigurationRecord().setLengthSizeMinusOne(3);<NEW_LINE>final HevcDecoderConfigurationRecord.Array vpsArray = new HevcDecoderConfigurationRecord.Array();<NEW_LINE>vpsArray.array_completeness = false;<NEW_LINE>vpsArray.nal_unit_type = NAL_TYPE_VPS_NUT;<NEW_LINE>vpsArray.nalUnits = new ArrayList<>();<NEW_LINE>for (ByteBuffer vp : vps) {<NEW_LINE>vpsArray.nalUnits.add(Utils.toArray(vp));<NEW_LINE>}<NEW_LINE>final HevcDecoderConfigurationRecord.Array spsArray = new HevcDecoderConfigurationRecord.Array();<NEW_LINE>spsArray.array_completeness = false;<NEW_LINE>spsArray.nal_unit_type = NAL_TYPE_SPS_NUT;<NEW_LINE>spsArray.nalUnits = new ArrayList<>();<NEW_LINE>for (ByteBuffer sp : sps) {<NEW_LINE>spsArray.nalUnits.add(Utils.toArray(sp));<NEW_LINE>}<NEW_LINE>final HevcDecoderConfigurationRecord.Array ppsArray = new HevcDecoderConfigurationRecord.Array();<NEW_LINE>ppsArray.array_completeness = false;<NEW_LINE>ppsArray.nal_unit_type = NAL_TYPE_PPS_NUT;<NEW_LINE>ppsArray.nalUnits = new ArrayList<>();<NEW_LINE>for (ByteBuffer pp : pps) {<NEW_LINE>ppsArray.nalUnits.add(Utils.toArray(pp));<NEW_LINE>}<NEW_LINE>hevcConfigurationBox.getArrays().addAll(Arrays.asList(spsArray, vpsArray, ppsArray));<NEW_LINE>visualSampleEntry.addBox(hevcConfigurationBox);<NEW_LINE>return visualSampleEntry;<NEW_LINE>} | VisualSampleEntry visualSampleEntry = new VisualSampleEntry("hvc1"); |
257,005 | public InputDestinationRequest unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>InputDestinationRequest inputDestinationRequest = new InputDestinationRequest();<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>if (context.testExpression("streamName", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>inputDestinationRequest.setStreamName(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 inputDestinationRequest;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
695,891 | public SqlNode toSql(RexProgram program, RexNode rex) {<NEW_LINE>if (rex.getKind().equals(SqlKind.LITERAL)) {<NEW_LINE>final RexLiteral literal = (RexLiteral) rex;<NEW_LINE>SqlTypeName name = literal.getTypeName();<NEW_LINE>SqlTypeFamily family = name.getFamily();<NEW_LINE>if (SqlTypeName.TIMESTAMP_WITH_LOCAL_TIME_ZONE.equals(name)) {<NEW_LINE>TimestampString timestampString = literal.getValueAs(TimestampString.class);<NEW_LINE>return new SqlDateTimeLiteral(timestampString, POS);<NEW_LINE>} else if (SqlTypeFamily.BINARY.equals(family)) {<NEW_LINE>ByteString byteString = <MASK><NEW_LINE>BitString bitString = BitString.createFromHexString(byteString.toString(16));<NEW_LINE>return new SqlByteStringLiteral(bitString, POS);<NEW_LINE>} else if (SqlTypeFamily.CHARACTER.equals(family)) {<NEW_LINE>String escaped = ESCAPE_FOR_ZETA_SQL.translate(literal.getValueAs(String.class));<NEW_LINE>return SqlLiteral.createCharString(escaped, POS);<NEW_LINE>} else if (SqlTypeName.SYMBOL.equals(literal.getTypeName())) {<NEW_LINE>Enum symbol = literal.getValueAs(Enum.class);<NEW_LINE>if (TimeUnitRange.DOW.equals(symbol)) {<NEW_LINE>return new ReplaceLiteral(literal, POS, "DAYOFWEEK");<NEW_LINE>} else if (TimeUnitRange.DOY.equals(symbol)) {<NEW_LINE>return new ReplaceLiteral(literal, POS, "DAYOFYEAR");<NEW_LINE>} else if (TimeUnitRange.WEEK.equals(symbol)) {<NEW_LINE>return new ReplaceLiteral(literal, POS, "ISOWEEK");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (rex.getKind().equals(SqlKind.DYNAMIC_PARAM)) {<NEW_LINE>final RexDynamicParam param = (RexDynamicParam) rex;<NEW_LINE>final int index = param.getIndex();<NEW_LINE>final String name = "null_param_" + index;<NEW_LINE>nullParams.put(name, param.getType());<NEW_LINE>return new NamedDynamicParam(index, POS, name);<NEW_LINE>} else if (SqlKind.SEARCH.equals(rex.getKind())) {<NEW_LINE>// Workaround CALCITE-4716<NEW_LINE>RexCall search = (RexCall) rex;<NEW_LINE>RexLocalRef ref = (RexLocalRef) search.operands.get(1);<NEW_LINE>RexLiteral literal = (RexLiteral) program.getExprList().get(ref.getIndex());<NEW_LINE>rex = search.clone(search.getType(), ImmutableList.of(search.operands.get(0), literal));<NEW_LINE>}<NEW_LINE>return super.toSql(program, rex);<NEW_LINE>} | literal.getValueAs(ByteString.class); |
824,892 | private void lumaCode(EncodingContext ctx, Picture pic, int mbX, int mbY, BitWriter out, int qp, EncodedMB outMB, int[] predType, int[][] _coeff, int cbpLuma) {<NEW_LINE>int cbp = 0;<NEW_LINE>for (int i8x8 = 0; i8x8 < 4; i8x8++) {<NEW_LINE>int bx = (mbX << 2) | (<MASK><NEW_LINE>int by = (mbY << 2) | (i8x8 & 2);<NEW_LINE>if ((cbpLuma & (1 << i8x8)) != 0) {<NEW_LINE>cbp |= (1 << i8x8);<NEW_LINE>for (int i4x4 = 0; i4x4 < 4; i4x4++) {<NEW_LINE>int blkX = bx | (i4x4 & 1);<NEW_LINE>int blkY = by | ((i4x4 >> 1) & 1);<NEW_LINE>int blkOffLeft = blkX & 0x3;<NEW_LINE>int blkOffTop = blkY & 0x3;<NEW_LINE>int bIdx = (i8x8 << 2) + i4x4;<NEW_LINE>int dIdx = BLK_DISP_MAP[bIdx];<NEW_LINE>outMB.nc[dIdx] = CAVLC.totalCoeff(ctx.cavlc[0].writeACBlock(out, blkX, blkY, blkOffLeft == 0 ? ctx.leftMBType : MBType.I_NxN, blkOffTop == 0 ? ctx.topMBType[mbX] : MBType.I_NxN, _coeff[bIdx], H264Const.totalZeros16, 0, 16, CoeffTransformer.zigzag4x4));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>for (int i4x4 = 0; i4x4 < 4; i4x4++) {<NEW_LINE>int blkX = bx | (i4x4 & 1);<NEW_LINE>int blkY = by | ((i4x4 >> 1) & 1);<NEW_LINE>ctx.cavlc[0].setZeroCoeff(blkX, blkY);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | (i8x8 << 1) & 2); |
25,777 | private String expand(String value, ErrorReporter reporter) {<NEW_LINE>int restart = 0;<NEW_LINE>StringBuilder result = new StringBuilder(value.length());<NEW_LINE>while (true) {<NEW_LINE>// (1) Find '$(<fname> '.<NEW_LINE>int start = value.indexOf("$(", restart);<NEW_LINE>if (start == -1) {<NEW_LINE>result.append(value.substring(restart));<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>int nextWhitespace = value.indexOf(' ', start);<NEW_LINE>if (nextWhitespace == -1) {<NEW_LINE>result.append(value, restart, start + 2);<NEW_LINE>restart = start + 2;<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>String fname = value.substring(start + 2, nextWhitespace);<NEW_LINE>if (!functions.containsKey(fname)) {<NEW_LINE>result.append(value, restart, start + 2);<NEW_LINE>restart = start + 2;<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>result.append(value, restart, start);<NEW_LINE>int end = value.indexOf(')', nextWhitespace);<NEW_LINE>if (end == -1) {<NEW_LINE>reporter.report(String.format("unterminated $(%s) expression", value.substring(<MASK><NEW_LINE>return value;<NEW_LINE>}<NEW_LINE>// (2) Call appropriate function to obtain string replacement.<NEW_LINE>String functionValue = value.substring(nextWhitespace + 1, end).trim();<NEW_LINE>try {<NEW_LINE>String replacement = functions.get(fname).apply(functionValue, repositoryMapping);<NEW_LINE>result.append(replacement);<NEW_LINE>} catch (IllegalStateException ise) {<NEW_LINE>reporter.report(ise.getMessage());<NEW_LINE>return value;<NEW_LINE>}<NEW_LINE>restart = end + 1;<NEW_LINE>}<NEW_LINE>return result.toString();<NEW_LINE>} | start + 2, nextWhitespace))); |
1,555,233 | protected void addNewHistoryCommit(Directory indexDirectory, Terminal terminal, boolean updateLocalCheckpoint) throws IOException {<NEW_LINE>final <MASK><NEW_LINE>terminal.println("Marking index with the new history uuid : " + historyUUID);<NEW_LINE>// commit the new history id<NEW_LINE>final IndexWriterConfig iwc = // we don't want merges to happen here - we call maybe merge on the engine<NEW_LINE>new IndexWriterConfig(null).// later once we stared it up otherwise we would need to wait for it here<NEW_LINE>// we also don't specify a codec here and merges should use the engines for this index<NEW_LINE>setCommitOnClose(false).setSoftDeletesField(Lucene.SOFT_DELETES_FIELD).setMergePolicy(NoMergePolicy.INSTANCE).setOpenMode(IndexWriterConfig.OpenMode.APPEND);<NEW_LINE>// IndexWriter acquires directory lock by its own<NEW_LINE>try (IndexWriter indexWriter = new IndexWriter(indexDirectory, iwc)) {<NEW_LINE>final Map<String, String> userData = new HashMap<>();<NEW_LINE>indexWriter.getLiveCommitData().forEach(e -> userData.put(e.getKey(), e.getValue()));<NEW_LINE>if (updateLocalCheckpoint) {<NEW_LINE>// In order to have a safe commit invariant, we have to assign the global checkpoint to the max_seqno of the last commit.<NEW_LINE>// We can only safely do it because we will generate a new history uuid this shard.<NEW_LINE>final SequenceNumbers.CommitInfo commitInfo = SequenceNumbers.loadSeqNoInfoFromLuceneCommit(userData.entrySet());<NEW_LINE>// Also advances the local checkpoint of the last commit to its max_seqno.<NEW_LINE>userData.put(SequenceNumbers.LOCAL_CHECKPOINT_KEY, Long.toString(commitInfo.maxSeqNo));<NEW_LINE>}<NEW_LINE>// commit the new history id<NEW_LINE>userData.put(Engine.HISTORY_UUID_KEY, historyUUID);<NEW_LINE>indexWriter.setLiveCommitData(userData.entrySet());<NEW_LINE>indexWriter.commit();<NEW_LINE>}<NEW_LINE>} | String historyUUID = UUIDs.randomBase64UUID(); |
482,421 | public void createPreflightNodeCheckTasks(Universe universe, Collection<Cluster> clusters) {<NEW_LINE>Set<Cluster> onPremClusters = clusters.stream().filter(cluster -> cluster.userIntent.providerType == CloudType.onprem).<MASK><NEW_LINE>if (onPremClusters.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>SubTaskGroup subTaskGroup = getTaskExecutor().createSubTaskGroup("SetNodeStatus", executor);<NEW_LINE>for (Cluster cluster : onPremClusters) {<NEW_LINE>Set<NodeDetails> nodesToProvision = PlacementInfoUtil.getNodesToProvision(taskParams().getNodesInCluster(cluster.uuid));<NEW_LINE>applyOnNodesWithStatus(universe, nodesToProvision, false, NodeStatus.builder().nodeState(NodeState.ToBeAdded).build(), filteredNodes -> {<NEW_LINE>createPreflightNodeCheckTasks(subTaskGroup, cluster, filteredNodes);<NEW_LINE>});<NEW_LINE>}<NEW_LINE>getRunnableTask().addSubTaskGroup(subTaskGroup);<NEW_LINE>} | collect(Collectors.toSet()); |
649,487 | public static Map<String, RexNode> permutePredicateOnFullColumn(Mapping fullColumnMapping, Map<String, RexNode> predicates) {<NEW_LINE>final Mapping inverted = fullColumnMapping.inverse();<NEW_LINE>final List<Integer> sourceList = new ArrayList<>();<NEW_LINE>for (IntPair intPair : inverted) {<NEW_LINE>sourceList.add(intPair.source);<NEW_LINE>}<NEW_LINE>final RexPermuteInputsShuttle permute = RexPermuteInputsShuttle.of(inverted);<NEW_LINE>final ImmutableBitSet inputSet = ImmutableBitSet.of(sourceList);<NEW_LINE>Map<String, RexNode> result = new HashMap<>();<NEW_LINE>for (Entry<String, RexNode> entry : predicates.entrySet()) {<NEW_LINE>final RexNode rexNode = entry.getValue();<NEW_LINE>if (inputSet.contains(InputFinder.bits(rexNode))) {<NEW_LINE>RexNode <MASK><NEW_LINE>result.put(call.toString(), call);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | call = rexNode.accept(permute); |
1,191,170 | public void sendHttpRequest(final HttpRequest httpRequest, final HttpResponseListener httpResultListener) {<NEW_LINE>if (httpRequest.getUrl() == null) {<NEW_LINE>httpResultListener.failed(new GdxRuntimeException("can't process a HTTP request without URL set"));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final String method = httpRequest.getMethod();<NEW_LINE>final String value = httpRequest.getContent();<NEW_LINE>final boolean valueInBody = method.equalsIgnoreCase(HttpMethods.POST) || method.equals(HttpMethods.PUT);<NEW_LINE>RequestBuilder builder;<NEW_LINE>String url = httpRequest.getUrl();<NEW_LINE>if (method.equalsIgnoreCase(HttpMethods.HEAD)) {<NEW_LINE>if (value != null) {<NEW_LINE>url += "?" + value;<NEW_LINE>}<NEW_LINE>builder = new RequestBuilder(RequestBuilder.HEAD, url);<NEW_LINE>} else if (method.equalsIgnoreCase(HttpMethods.GET)) {<NEW_LINE>if (value != null) {<NEW_LINE>url += "?" + value;<NEW_LINE>}<NEW_LINE>builder = new RequestBuilder(RequestBuilder.GET, url);<NEW_LINE>} else if (method.equalsIgnoreCase(HttpMethods.POST)) {<NEW_LINE>builder = new RequestBuilder(RequestBuilder.POST, url);<NEW_LINE>} else if (method.equalsIgnoreCase(HttpMethods.DELETE)) {<NEW_LINE>if (value != null) {<NEW_LINE>url += "?" + value;<NEW_LINE>}<NEW_LINE>builder = new RequestBuilder(RequestBuilder.DELETE, url);<NEW_LINE>} else if (method.equalsIgnoreCase(HttpMethods.PUT)) {<NEW_LINE>builder = new RequestBuilder(RequestBuilder.PUT, url);<NEW_LINE>} else {<NEW_LINE>throw new GdxRuntimeException("Unsupported HTTP Method");<NEW_LINE>}<NEW_LINE>Map<String, String> content = httpRequest.getHeaders();<NEW_LINE>Set<String> keySet = content.keySet();<NEW_LINE>for (String name : keySet) {<NEW_LINE>builder.setHeader(name, content.get(name));<NEW_LINE>}<NEW_LINE>builder.setTimeoutMillis(httpRequest.getTimeOut());<NEW_LINE>builder.setIncludeCredentials(httpRequest.getIncludeCredentials());<NEW_LINE>try {<NEW_LINE>Request request = builder.sendRequest(valueInBody ? value : null, new RequestCallback() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onResponseReceived(Request request, Response response) {<NEW_LINE>if (response.getStatusCode() > 0) {<NEW_LINE>httpResultListener.handleHttpResponse(new HttpClientResponse(response));<NEW_LINE>requests.remove(httpRequest);<NEW_LINE>listeners.remove(httpRequest);<NEW_LINE>} else {<NEW_LINE>onError(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onError(Request request, Throwable exception) {<NEW_LINE>httpResultListener.failed(exception);<NEW_LINE>requests.remove(httpRequest);<NEW_LINE>listeners.remove(httpRequest);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>requests.put(httpRequest, request);<NEW_LINE>listeners.put(httpRequest, httpResultListener);<NEW_LINE>} catch (Throwable e) {<NEW_LINE>httpResultListener.failed(e);<NEW_LINE>}<NEW_LINE>} | request, new IOException("HTTP request failed")); |
639,478 | private List<String> list(Business business, EffectivePerson effectivePerson) throws Exception {<NEW_LINE>EntityManager em = business.entityManagerContainer().get(Portal.class);<NEW_LINE>CriteriaBuilder cb = em.getCriteriaBuilder();<NEW_LINE>CriteriaQuery<String> cq = cb.createQuery(String.class);<NEW_LINE>Root<Portal> root = cq.from(Portal.class);<NEW_LINE>Predicate p = cb.or(cb.isNull(root.get(Portal_.mobileClient)), cb.isTrue(root.get(Portal_.mobileClient)));<NEW_LINE>if (effectivePerson.isNotManager() && (!business.organization().person().hasRole(effectivePerson, OrganizationDefinition.PortalManager))) {<NEW_LINE>List<String> identities = business.organization().identity().listWithPerson(effectivePerson.getDistinguishedName());<NEW_LINE>List<String> units = business.organization().unit().listWithPersonSupNested(effectivePerson.getDistinguishedName());<NEW_LINE>Predicate who = cb.equal(root.get(Portal_.creatorPerson), effectivePerson.getDistinguishedName());<NEW_LINE>who = cb.or(who, cb.isMember(effectivePerson.getDistinguishedName(), root.get(Portal_.controllerList)));<NEW_LINE>who = cb.or(who, cb.and(cb.isEmpty(root.get(Portal_.availableIdentityList)), cb.isEmpty(root.get(Portal_.availableUnitList))));<NEW_LINE>who = cb.or(who, root.get(Portal_.availableIdentityList).in(identities));<NEW_LINE>who = cb.or(who, root.get(Portal_.availableUnitList).in(units));<NEW_LINE>p = <MASK><NEW_LINE>}<NEW_LINE>cq.select(root.get(Portal_.id)).where(p);<NEW_LINE>return em.createQuery(cq).getResultList().stream().distinct().collect(Collectors.toList());<NEW_LINE>} | cb.and(p, who); |
1,088,934 | private void sharpenBorder4(AutoTypeImage image) {<NEW_LINE>String name = image.getSingleBandName();<NEW_LINE>String cast = image.getTypeCastFromSum();<NEW_LINE><MASK><NEW_LINE>out.print("\tpublic static void sharpenBorder4( " + name + " input , " + name + " output , " + sumtype + " minValue , " + sumtype + " maxValue ) {\n" + "\n" + "\t\tint b = input.height-1;\n" + "\t\tint c = input.width-1;\n" + "\n" + "\t\t//CONCURRENT_BELOW BoofConcurrency.loopFor(0,input.width,x->{\n" + "\t\tfor( int x = 0; x < input.width; x++ ) {\n" + "\t\t\tint indexTop = input.startIndex + x;\n" + "\t\t\tint indexBottom = input.startIndex + b*input.stride + x;\n" + "\t\t\t" + sumtype + " value = 4*safeGet(input,x,0) - (safeGet(input,x-1,0) + safeGet(input,x+1,0) + safeGet(input,x,1));\n" + "\n" + "\t\t\tif( value > maxValue )\n" + "\t\t\t\tvalue = maxValue;\n" + "\t\t\telse if( value < minValue )\n" + "\t\t\t\tvalue = minValue;\n" + "\n" + "\t\t\toutput.data[indexTop++] = " + cast + "value;\n" + "\n" + "\t\t\tvalue = 4*safeGet(input,x,b) - (safeGet(input,x-1,b) + safeGet(input,x+1,b) + safeGet(input,x,b-1));\n" + "\n" + "\t\t\tif( value > maxValue )\n" + "\t\t\t\tvalue = maxValue;\n" + "\t\t\telse if( value < minValue )\n" + "\t\t\t\tvalue = minValue;\n" + "\n" + "\t\t\toutput.data[indexBottom++] = " + cast + "value;\n" + "\t\t}\n" + "\t\t//CONCURRENT_ABOVE });\n" + "\n" + "\t\t//CONCURRENT_BELOW BoofConcurrency.loopFor(1,input.height-1,y->{\n" + "\t\tfor( int y = 1; y < input.height-1; y++ ) {\n" + "\t\t\tint indexLeft = input.startIndex + input.stride*y;\n" + "\t\t\tint indexRight = input.startIndex + input.stride*y + c;\n" + "\t\t\t" + sumtype + " value = 4*safeGet(input,0,y) - (safeGet(input,1,y) + safeGet(input,0,y-1) + safeGet(input,0,y+1));\n" + "\n" + "\t\t\tif( value > maxValue )\n" + "\t\t\t\tvalue = maxValue;\n" + "\t\t\telse if( value < minValue )\n" + "\t\t\t\tvalue = minValue;\n" + "\n" + "\t\t\toutput.data[indexLeft] = " + cast + "value;\n" + "\n" + "\t\t\tvalue = 4*safeGet(input,c,y) - (safeGet(input,c-1,y) + safeGet(input,c,y-1) + safeGet(input,c,y+1));\n" + "\n" + "\t\t\tif( value > maxValue )\n" + "\t\t\t\tvalue = maxValue;\n" + "\t\t\telse if( value < minValue )\n" + "\t\t\t\tvalue = minValue;\n" + "\n" + "\t\t\toutput.data[indexRight] = " + cast + "value;\n" + "\t\t}\n" + "\t\t//CONCURRENT_ABOVE });\n" + "\t}\n\n");<NEW_LINE>} | String sumtype = image.getSumType(); |
519,455 | private void createCreateReflectorMethod1(String newClassPrefix, CtClass reflectorFactoryImpl) throws NotFoundException, CannotCompileException {<NEW_LINE>CtClass[] parameters = new CtClass[2];<NEW_LINE>parameters[0] = pool.get(<MASK><NEW_LINE>parameters[1] = pool.get(Reflector.class.getName());<NEW_LINE>CtMethod method = new CtMethod(pool.get(PublicInterface.class.getName()), "createReflector", parameters, reflectorFactoryImpl);<NEW_LINE>StringBuilder methodBuilder = new StringBuilder();<NEW_LINE>methodBuilder.append("{");<NEW_LINE>methodBuilder.append("if (1==0) {");<NEW_LINE>for (String name : servicesMap.keySetName()) {<NEW_LINE>SService sService = servicesMap.getByName(name);<NEW_LINE>methodBuilder.append("} else if ($1.getSimpleName().equals(\"" + sService.getSimpleName() + "\")) {");<NEW_LINE>methodBuilder.append("return new " + GENERATED_CLASSES_PACKAGE + "." + sService.getSimpleName() + "Impl" + newClassPrefix + "($2);");<NEW_LINE>}<NEW_LINE>methodBuilder.append("}");<NEW_LINE>methodBuilder.append("return null;");<NEW_LINE>methodBuilder.append("}");<NEW_LINE>method.setBody(methodBuilder.toString());<NEW_LINE>reflectorFactoryImpl.addMethod(method);<NEW_LINE>} | Class.class.getName()); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.