idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
1,108,545 | final void calcVolume() {<NEW_LINE>synchronized (control_mutex) {<NEW_LINE>double gain = Math.pow(10.0, gain_control.getValue() / 20.0);<NEW_LINE>if (mute_control.getValue())<NEW_LINE>gain = 0;<NEW_LINE>leftgain = (float) gain;<NEW_LINE>rightgain = (float) gain;<NEW_LINE>if (mixer.getFormat().getChannels() > 1) {<NEW_LINE>// -1 = Left, 0 Center, 1 = Right<NEW_LINE>double balance = balance_control.getValue();<NEW_LINE>if (balance > 0)<NEW_LINE>leftgain *= (1 - balance);<NEW_LINE>else<NEW_LINE>rightgain *= (1 + balance);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>eff1gain = (float) Math.pow(10.0, <MASK><NEW_LINE>eff2gain = (float) Math.pow(10.0, chorussend_control.getValue() / 20.0);<NEW_LINE>if (!apply_reverb.getValue()) {<NEW_LINE>eff1gain = 0;<NEW_LINE>}<NEW_LINE>} | reverbsend_control.getValue() / 20.0); |
83,284 | private // cracker, that uses brute force (a<NEW_LINE>// cracker, that uses brute force (a<NEW_LINE>boolean // double loop) to find segment<NEW_LINE>checkCrackingBrute_() // intersections.<NEW_LINE>{<NEW_LINE>MultiPathImpl multiPathImpl = (MultiPathImpl) m_geometry._getImpl();<NEW_LINE>// Implementation without a QuadTreeImpl accelerator<NEW_LINE>SegmentIteratorImpl segIter1 = multiPathImpl.querySegmentIterator();<NEW_LINE>SegmentIteratorImpl segIter2 = multiPathImpl.querySegmentIterator();<NEW_LINE>// Envelope2D env2D;<NEW_LINE>while (segIter1.nextPath()) {<NEW_LINE>while (segIter1.hasNextSegment()) {<NEW_LINE>Segment seg2 = segIter2.nextSegment();<NEW_LINE>int res = seg1.<MASK><NEW_LINE>if (res != 0) {<NEW_LINE>NonSimpleResult.Reason reason = res == 2 ? NonSimpleResult.Reason.CrossOver : NonSimpleResult.Reason.Cracking;<NEW_LINE>m_nonSimpleResult = new NonSimpleResult(reason, segIter1.getStartPointIndex(), segIter2.getStartPointIndex());<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} while (segIter2.nextPath());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | _isIntersecting(seg2, m_toleranceIsSimple, true); |
26,803 | public void makeTabItem(ReactBottomNavigation bottomNavigation, Menu menu, int index, Integer itemId, ReadableMap config) {<NEW_LINE>Log.d(TAG, "makeTabItem");<NEW_LINE>MenuItem item = menu.add(Menu.NONE, itemId, Menu.NONE, config.getString("title"));<NEW_LINE>if (config.hasKey("image")) {<NEW_LINE>bottomNavigation.setMenuItemIcon(item<MASK><NEW_LINE>} else {<NEW_LINE>// TODO(lmr): this probably isn't the best default.<NEW_LINE>item.setIcon(android.R.drawable.btn_radio);<NEW_LINE>}<NEW_LINE>if (config.hasKey("enabled")) {<NEW_LINE>boolean enabled = config.getBoolean("enabled");<NEW_LINE>item.setEnabled(enabled);<NEW_LINE>}<NEW_LINE>// not sure if we want/need to set anything on the itemview itself. hacky.<NEW_LINE>// BottomNavigationMenuView menuView = (BottomNavigationMenuView) bottomNavigation.getChildAt(0);<NEW_LINE>// BottomNavigationItemView itemView = (BottomNavigationItemView)menuView.getChildAt(index);<NEW_LINE>} | , config.getMap("image")); |
1,111,462 | public void onCreate(@Nullable Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>setRetainInstance(true);<NEW_LINE>UUID toAddress = (UUID) getArguments().getSerializable(Constants.DESTADDRESS);<NEW_LINE>UUID fromAddress = (UUID) getArguments().getSerializable(Constants.FROM_ADDRESS);<NEW_LINE>toValue = getArguments().getString(Constants.TO_AMOUNT);<NEW_LINE>amount = getArguments().getDouble(Constants.FROM_AMOUNT);<NEW_LINE>mbwManager = MbwManager.getInstance(getActivity());<NEW_LINE>mbwManager.getEventBus().register(this);<NEW_LINE>fromAccount = mbwManager.getWalletManager<MASK><NEW_LINE>toAccount = mbwManager.getWalletManager(false).getAccount(toAddress);<NEW_LINE>BigDecimal txFee = UtilsKt.estimateFeeFromTransferrableAmount(fromAccount, mbwManager, BitcoinCash.valueOf(amount).getLongValue());<NEW_LINE>sentAmount = amount - txFee.doubleValue();<NEW_LINE>createOffer();<NEW_LINE>} | (false).getAccount(fromAddress); |
993,633 | public static DatabaseConnection findDatabaseConnection(PersistenceUnit pu, Project project) {<NEW_LINE>// try to find a connection specified using the PU properties<NEW_LINE>DatabaseConnection dbcon = ProviderUtil.getConnection(pu);<NEW_LINE>if (dbcon != null) {<NEW_LINE>return dbcon;<NEW_LINE>}<NEW_LINE>// try to find a datasource-based connection, but only for a FileObject-based context,<NEW_LINE>// otherwise we don't have a J2eeModuleProvider to retrieve the DS's from<NEW_LINE>String datasourceName = ProviderUtil.getDatasourceName(pu);<NEW_LINE>if (datasourceName == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (project == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>JPADataSource datasource = null;<NEW_LINE>JPADataSourceProvider dsProvider = project.getLookup(<MASK><NEW_LINE>if (dsProvider == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>for (JPADataSource each : dsProvider.getDataSources()) {<NEW_LINE>if (datasourceName.equals(each.getJndiName())) {<NEW_LINE>datasource = each;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (datasource == null) {<NEW_LINE>// NOI18N<NEW_LINE>ErrorManager.getDefault().log(ErrorManager.INFORMATIONAL, "The " + datasourceName + " was not found.");<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>List<DatabaseConnection> dbconns = findDatabaseConnections(datasource);<NEW_LINE>if (dbconns.size() > 0) {<NEW_LINE>return dbconns.get(0);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | ).lookup(JPADataSourceProvider.class); |
14,880 | final SendEmailResult executeSendEmail(SendEmailRequest sendEmailRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(sendEmailRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<SendEmailRequest> request = null;<NEW_LINE>Response<SendEmailResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new SendEmailRequestMarshaller().marshall(super.beforeMarshalling(sendEmailRequest));<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, "SES");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "SendEmail");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<SendEmailResult> responseHandler = new StaxResponseHandler<SendEmailResult>(new SendEmailResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig); |
1,057,840 | public org.python.Object __mul__(org.python.Object other) {<NEW_LINE>if (other instanceof org.python.types.Bool) {<NEW_LINE>boolean other_bool = ((org.python.types.Bool) other).value;<NEW_LINE>if (other_bool) {<NEW_LINE>return this;<NEW_LINE>} else {<NEW_LINE>return new Bytes(new byte[0]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (other instanceof org.python.types.Int) {<NEW_LINE>int other_value = Math.max(0, (int) ((org.python.types.Int) other).value);<NEW_LINE>int len = this.value.length;<NEW_LINE>byte[] bytes = new byte[other_value * len];<NEW_LINE>for (int i = 0; i < other_value; i++) {<NEW_LINE>System.arraycopy(this.value, 0, <MASK><NEW_LINE>}<NEW_LINE>return new Bytes(bytes);<NEW_LINE>} else {<NEW_LINE>throw new org.python.exceptions.TypeError("can't multiply sequence by non-int of type '" + other.typeName() + "'");<NEW_LINE>}<NEW_LINE>} | bytes, i * len, len); |
1,106,229 | public void caretUpdate(CaretEvent evt) {<NEW_LINE>JTextComponent comp = (JTextComponent) evt.getSource();<NEW_LINE>if (comp != null) {<NEW_LINE>if (comp.getSelectionStart() != comp.getSelectionEnd()) {<NEW_LINE>// cancel line highlighting if selection exists<NEW_LINE>removeLineHighlight(comp);<NEW_LINE>comp.repaint();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int pos = comp.getCaretPosition();<NEW_LINE>Element elem = Utilities.getParagraphElement(comp, pos);<NEW_LINE>int start = elem.getStartOffset();<NEW_LINE>int end = elem.getEndOffset();<NEW_LINE>Document doc = comp.getDocument();<NEW_LINE>Element root = doc.getDefaultRootElement();<NEW_LINE>int line = root.getElementIndex(pos);<NEW_LINE>Debug.log(5, "LineHighlight: Caret at " + pos + " line " + line + " for " + start + "-" + end);<NEW_LINE>if (SikuliIDE.getStatusbar() != null) {<NEW_LINE>SikuliIDE.getStatusbar().setCaretPosition(line + 1, pos - start + 1);<NEW_LINE>}<NEW_LINE>removeLineHighlight(comp);<NEW_LINE>try {<NEW_LINE>highlight = comp.getHighlighter().<MASK><NEW_LINE>comp.repaint();<NEW_LINE>} catch (BadLocationException ex) {<NEW_LINE>Debug.error(me + "Problem while highlighting line %d\n%s", pos, ex.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | addHighlight(start, end, painter); |
1,767,377 | public void run() {<NEW_LINE>ImageBase boof = getImageType(0).createImage(1, 1);<NEW_LINE>boolean first = true;<NEW_LINE>for (int i = 0; i < files.length && !requestStop; i++) {<NEW_LINE>String path = files[i];<NEW_LINE>inputFilePath = path;<NEW_LINE>if (path == null) {<NEW_LINE>System.err.println("Error[" + i + "] path " + files[i]);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>BufferedImage buffered = UtilImageIO.loadImage(path);<NEW_LINE>if (buffered == null) {<NEW_LINE>handleInputFailure(i, "Couldn't open " + path);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (first) {<NEW_LINE>setInputName(new File(files[i]).getName());<NEW_LINE>}<NEW_LINE>handleInputChange(i, inputMethod, buffered.getWidth(), buffered.getHeight());<NEW_LINE>ConvertBufferedImage.<MASK><NEW_LINE>processImage(i, 0, buffered, boof);<NEW_LINE>if (first) {<NEW_LINE>first = false;<NEW_LINE>inputSizeKnown = true;<NEW_LINE>synchronized (lockStartingProcess) {<NEW_LINE>startingProcess = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>running = false;<NEW_LINE>} | convertFrom(buffered, boof, true); |
1,472,721 | protected PreDeConModel computeLocalModel(DBIDRef id, DoubleDBIDList neighbors, Relation<? extends NumberVector> relation) {<NEW_LINE>mvSize.put(neighbors.size());<NEW_LINE>PCAResult epairs = pca.processIds(neighbors, relation);<NEW_LINE>int cordim = filter.filter(epairs.getEigenvalues());<NEW_LINE>PCAFilteredResult pcares = new PCAFilteredResult(epairs.getEigenPairs(), cordim, settings.kappa, 1.);<NEW_LINE>double[][] m_hat = pcares.similarityMatrix();<NEW_LINE>double[] obj = relation.get(id).toArray();<NEW_LINE>// To save computing the square root below.<NEW_LINE>double sqeps = settings.epsilon * settings.epsilon;<NEW_LINE>HashSetModifiableDBIDs survivors = DBIDUtil.newHashSet(neighbors.size());<NEW_LINE>for (DBIDIter iter = neighbors.iter(); iter.valid(); iter.advance()) {<NEW_LINE>// Compute weighted / projected distance:<NEW_LINE>double[] diff = minusEquals(relation.get(iter).toArray(), obj);<NEW_LINE>double dist = transposeTimesTimes(diff, m_hat, diff);<NEW_LINE>if (dist <= sqeps) {<NEW_LINE>survivors.add(iter);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (cordim <= settings.lambda) {<NEW_LINE>mvSize2.put(survivors.size());<NEW_LINE>}<NEW_LINE>mvCorDim.put(cordim);<NEW_LINE><MASK><NEW_LINE>} | return new PreDeConModel(cordim, survivors); |
268,070 | public static ListUserGroupsResponse unmarshall(ListUserGroupsResponse listUserGroupsResponse, UnmarshallerContext _ctx) {<NEW_LINE>listUserGroupsResponse.setRequestId(_ctx.stringValue("ListUserGroupsResponse.RequestId"));<NEW_LINE>listUserGroupsResponse.setMessage(_ctx.stringValue("ListUserGroupsResponse.Message"));<NEW_LINE>listUserGroupsResponse.setCode(_ctx.stringValue("ListUserGroupsResponse.Code"));<NEW_LINE>List<DataItem> data = new ArrayList<DataItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListUserGroupsResponse.Data.Length"); i++) {<NEW_LINE>DataItem dataItem = new DataItem();<NEW_LINE>dataItem.setUpdateTime(_ctx.stringValue<MASK><NEW_LINE>dataItem.setIsvSubId(_ctx.stringValue("ListUserGroupsResponse.Data[" + i + "].IsvSubId"));<NEW_LINE>dataItem.setUserGroupId(_ctx.longValue("ListUserGroupsResponse.Data[" + i + "].UserGroupId"));<NEW_LINE>dataItem.setCreateTime(_ctx.stringValue("ListUserGroupsResponse.Data[" + i + "].CreateTime"));<NEW_LINE>dataItem.setUserGroupName(_ctx.stringValue("ListUserGroupsResponse.Data[" + i + "].UserGroupName"));<NEW_LINE>dataItem.setUserCount(_ctx.longValue("ListUserGroupsResponse.Data[" + i + "].UserCount"));<NEW_LINE>dataItem.setParentUserGroupId(_ctx.longValue("ListUserGroupsResponse.Data[" + i + "].ParentUserGroupId"));<NEW_LINE>dataItem.setCreator(_ctx.stringValue("ListUserGroupsResponse.Data[" + i + "].Creator"));<NEW_LINE>data.add(dataItem);<NEW_LINE>}<NEW_LINE>listUserGroupsResponse.setData(data);<NEW_LINE>return listUserGroupsResponse;<NEW_LINE>} | ("ListUserGroupsResponse.Data[" + i + "].UpdateTime")); |
1,440,747 | private void loadOptions() {<NEW_LINE>Options opt = tool.getOptions(PluginConstants.SEARCH_OPTION_NAME);<NEW_LINE>int newSearchLimit = opt.getInt(GhidraOptions.OPTION_SEARCH_LIMIT, PluginConstants.DEFAULT_SEARCH_LIMIT);<NEW_LINE>if (newSearchLimit <= 0) {<NEW_LINE>throw new OptionsVetoException("Search limit must be greater than 0");<NEW_LINE>}<NEW_LINE>searchLimit = newSearchLimit;<NEW_LINE>prepopulateSearch = opt.getBoolean(PluginConstants.PRE_POPULATE_MEM_SEARCH, true);<NEW_LINE>autoRestrictSelection = opt.getBoolean(PluginConstants.AUTO_RESTRICT_SELECTION, true);<NEW_LINE>doHighlight = opt.getBoolean(PluginConstants.SEARCH_HIGHLIGHT_NAME, true);<NEW_LINE>defaultHighlightColor = opt.getColor(PluginConstants.SEARCH_HIGHLIGHT_COLOR_NAME, PluginConstants.SEARCH_HIGHLIGHT_COLOR);<NEW_LINE>activeHighlightColor = opt.getColor(PluginConstants.SEARCH_HIGHLIGHT_CURRENT_COLOR_NAME, PluginConstants.SEARCH_HIGHLIGHT_CURRENT_ADDR_COLOR);<NEW_LINE>opt = tool.getOptions(GhidraOptions.CATEGORY_BROWSER_FIELDS);<NEW_LINE>byteGroupSize = opt.getInt(BytesFieldFactory.BYTE_GROUP_SIZE_MSG, 1);<NEW_LINE>byteDelimiter = opt.<MASK><NEW_LINE>} | getString(BytesFieldFactory.DELIMITER_MSG, " "); |
1,237,128 | private void startUploadTask(final String file_path) {<NEW_LINE>upInProgress = true;<NEW_LINE>new UploadRSSLogTask(new UploadRSSLogTask.UploadRSSLogTaskListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onSuccess(String result) {<NEW_LINE>upInProgress = false;<NEW_LINE>File file = new File(file_path);<NEW_LINE>file.delete();<NEW_LINE>AlertDialog.Builder builder = new AlertDialog.Builder(AnyplaceLoggerActivity.this);<NEW_LINE>if (mCurrentBuilding == null)<NEW_LINE>builder.setMessage("Thank you for improving the location quality of Anyplace");<NEW_LINE>else<NEW_LINE>builder.setMessage("Thank you for improving the location quality for building " + mCurrentBuilding.name);<NEW_LINE>builder.setCancelable(false).setPositiveButton("OK", new DialogInterface.OnClickListener() {<NEW_LINE><NEW_LINE>public void onClick(DialogInterface dialog, int id) {<NEW_LINE>// do things<NEW_LINE>}<NEW_LINE>});<NEW_LINE>AlertDialog alert = builder.create();<NEW_LINE>alert.show();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onErrorOrCancel(String result) {<NEW_LINE>upInProgress = false;<NEW_LINE>Toast.makeText(getApplicationContext(), result, Toast.LENGTH_LONG).show();<NEW_LINE>}<NEW_LINE>}, this, file_path, preferences.getString("username", ""), preferences.getString("password"<MASK><NEW_LINE>} | , "")).execute(); |
447,884 | public void handleMouseInput() {<NEW_LINE>int x = (int) (Mouse.getEventX() * this.width / <MASK><NEW_LINE>int y = (int) ((this.height - Mouse.getEventY() * this.height / this.mc.displayHeight - 1) * glScale);<NEW_LINE>int k = Mouse.getEventButton();<NEW_LINE>if (k == 0) {<NEW_LINE>if (Mouse.getEventButtonState()) {<NEW_LINE>if (isButton(x, y)) {<NEW_LINE>buttonState = 2;<NEW_LINE>}<NEW_LINE>} else if (buttonState == 2) {<NEW_LINE>if (isButton(x, y)) {<NEW_LINE>buttonState = ENABLE_HIGHLIGHT ? 0 : 1;<NEW_LINE>} else {<NEW_LINE>buttonState = 1;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (ENABLE_HIGHLIGHT && k == -1 && buttonState != 2) {<NEW_LINE>if (isButton(x, y)) {<NEW_LINE>buttonState = 0;<NEW_LINE>} else {<NEW_LINE>buttonState = 1;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | this.mc.displayWidth * glScale); |
882,188 | public void change(Event e, @Nullable Object[] delta, ChangeMode mode) {<NEW_LINE>for (Object object : this.objects.getArray(e)) {<NEW_LINE>switch(mode) {<NEW_LINE>case DELETE:<NEW_LINE>if (object instanceof LivingEntity)<NEW_LINE>PotionEffectUtils.clearAllEffects((LivingEntity) object);<NEW_LINE>else if (object instanceof ItemType)<NEW_LINE>PotionEffectUtils.clearAllEffects((ItemType) object);<NEW_LINE>break;<NEW_LINE>case ADD:<NEW_LINE>if (delta == null)<NEW_LINE>return;<NEW_LINE>if (object instanceof LivingEntity)<NEW_LINE>PotionEffectUtils.addEffects(((LivingEntity) object), delta);<NEW_LINE>else if (object instanceof ItemType)<NEW_LINE>PotionEffectUtils.addEffects(((ItemType) object), delta);<NEW_LINE>break;<NEW_LINE>case REMOVE:<NEW_LINE>if (delta == null)<NEW_LINE>return;<NEW_LINE>if (object instanceof LivingEntity)<NEW_LINE>PotionEffectUtils.removeEffects(((LivingEntity) object), delta);<NEW_LINE>else if (object instanceof ItemType)<NEW_LINE>PotionEffectUtils.removeEffects((<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | (ItemType) object), delta); |
618,440 | public void mouseClicked(final MouseEvent e) {<NEW_LINE>boolean shouldEditOrResetPosition = e.getButton() == MouseEvent.BUTTON1 && e.getClickCount() == 2 && doubleClickTimer.getDelay() > 0;<NEW_LINE>if (shouldEditOrResetPosition) {<NEW_LINE>final MainView mainView = (MainView) e.getComponent();<NEW_LINE>if (mainView.getMouseArea().equals(MouseArea.MOTION)) {<NEW_LINE>final Controller controller = Controller.getCurrentController();<NEW_LINE>MLocationController locationController = (MLocationController) LocationController.getController(controller.getModeController());<NEW_LINE>if (e.getModifiersEx() == 0) {<NEW_LINE>final NodeView nodeV = getNodeView(e);<NEW_LINE>final <MASK><NEW_LINE>locationController.moveNodePosition(node, LocationModel.DEFAULT_HGAP, LocationModel.DEFAULT_SHIFT_Y);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (Compat.isCtrlEvent(e)) {<NEW_LINE>final NodeView nodeV = getNodeView(e);<NEW_LINE>NodeModel childDistanceContainer = nodeV.getParentView().getChildDistanceContainer().getModel();<NEW_LINE>locationController.setMinimalDistanceBetweenChildren(childDistanceContainer, LocationModel.DEFAULT_VGAP);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (Compat.isPlainEvent(e) && !isInFoldingRegion(e) && !mainView.isInDragRegion(e.getPoint())) {<NEW_LINE>final MTextController textController = MTextController.getController();<NEW_LINE>textController.getEventQueue().activate(e);<NEW_LINE>textController.edit(FirstAction.EDIT_CURRENT, false);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>super.mouseClicked(e);<NEW_LINE>} | NodeModel node = nodeV.getModel(); |
291,979 | public WritableArchive createSubArchive(String name) throws IOException {<NEW_LINE>String subEntryName = getFileSubArchivePath(name);<NEW_LINE><MASK><NEW_LINE>if (!subEntry.exists()) {<NEW_LINE>// time to create a new sub directory<NEW_LINE>if (!subEntry.exists() && !subEntry.mkdirs()) {<NEW_LINE>throw new IOException("Unable to create directory for " + subEntry.getAbsolutePath());<NEW_LINE>}<NEW_LINE>deplLogger.log(DEBUG_LEVEL, "FileArchive.createSubArchive created dirs for {0}", subEntry.getAbsolutePath());<NEW_LINE>} else {<NEW_LINE>deplLogger.log(DEBUG_LEVEL, "FileArchive.createSubArchive found existing dir for {0}", subEntry.getAbsolutePath());<NEW_LINE>staleFileManager().ifPresent(sfm -> sfm.recordValidEntry(subEntry));<NEW_LINE>}<NEW_LINE>final WritableArchive result = archiveFactory.createArchive(subEntry);<NEW_LINE>if (result instanceof AbstractReadableArchive) {<NEW_LINE>((AbstractReadableArchive) result).setParentArchive(this);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | File subEntry = new File(subEntryName); |
791,390 | public Set<Integer> updateQuote(short siteId, Serializable id, CmsContentParameters contentParameters, CmsModel cmsModel, CmsCategory category, CmsContentAttribute attribute) {<NEW_LINE>CmsContent entity = getEntity(id);<NEW_LINE>Set<Integer> categoryIds = new HashSet<>();<NEW_LINE>if (null != entity) {<NEW_LINE>for (CmsContent quote : getListByQuoteId(siteId, entity.getId())) {<NEW_LINE>if (null != contentParameters.getContentIds() && contentParameters.getContentIds().contains(quote.getId())) {<NEW_LINE>quote.setUrl(entity.getUrl());<NEW_LINE>quote.setTitle(entity.getTitle());<NEW_LINE>quote.setDescription(entity.getDescription());<NEW_LINE>quote.setAuthor(entity.getAuthor());<NEW_LINE>quote.setCover(entity.getCover());<NEW_LINE>quote.setEditor(entity.getEditor());<NEW_LINE>quote.setExpiryDate(entity.getExpiryDate());<NEW_LINE>quote.setStatus(entity.getStatus());<NEW_LINE>quote.setCheckUserId(entity.getCheckUserId());<NEW_LINE>quote.setCheckDate(entity.getCheckDate());<NEW_LINE>quote.setPublishDate(entity.getPublishDate());<NEW_LINE>quote.setHasStatic(entity.isHasStatic());<NEW_LINE>quote.setHasFiles(entity.isHasFiles());<NEW_LINE>quote.setHasImages(entity.isHasImages());<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>categoryIds.add(quote.getCategoryId());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return categoryIds;<NEW_LINE>} | delete(quote.getId()); |
454,596 | public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {<NEW_LINE>logDebug("onCreateView");<NEW_LINE>View v = inflater.inflate(R.layout.fragment_info_achievements, container, false);<NEW_LINE>icon = v.findViewById(R.id.icon_info_achievements);<NEW_LINE>checkIcon = v.findViewById(R.id.icon_achievement_completed);<NEW_LINE>title = v.findViewById(R.id.title_info_achievements);<NEW_LINE>sectionTitle = v.findViewById(R.id.how_works_title);<NEW_LINE>firstParagraph = v.findViewById(R.id.info_achievements_how_works_first_p);<NEW_LINE>secondParagraph = v.findViewById(R.id.info_achievements_how_works_second_p);<NEW_LINE>final Bundle arguments = getArguments();<NEW_LINE>if (arguments == null) {<NEW_LINE>logWarning("Arguments are null. No achievement type.");<NEW_LINE>return v;<NEW_LINE>}<NEW_LINE>achievementType = arguments.getInt("achievementType");<NEW_LINE>if (Util.isDarkMode(context)) {<NEW_LINE>int backgroundColor = ColorUtils.getColorForElevation(context, 1f);<NEW_LINE>v.findViewById(R.id<MASK><NEW_LINE>v.findViewById(R.id.how_it_works_layout).setBackgroundColor(backgroundColor);<NEW_LINE>}<NEW_LINE>return v;<NEW_LINE>} | .title_layout).setBackgroundColor(backgroundColor); |
1,670,788 | public void drawImage(JRPrintImage image, Graphics2DRenderable renderer, boolean forceSvgShapes, double templateWidth, double templateHeight, int translateX, int translateY, double angle, double renderWidth, double renderHeight, float ratioX, float ratioY, float x, float y) throws JRException, IOException {<NEW_LINE>PdfContentByte pdfContentByte = getPdfContentByte();<NEW_LINE>PdfTemplate template = pdfContentByte.createTemplate((float) templateWidth, (float) templateHeight);<NEW_LINE>Graphics2D g = forceSvgShapes ? template.createGraphicsShapes((float) templateWidth, (float) templateHeight) : template.createGraphics((float) templateWidth, (float) templateHeight, new ClassicPdfFontMapper(this));<NEW_LINE>try {<NEW_LINE>g.translate(translateX, translateY);<NEW_LINE>if (angle != 0) {<NEW_LINE>g.rotate(angle);<NEW_LINE>}<NEW_LINE>if (image.getModeValue() == ModeEnum.OPAQUE) {<NEW_LINE>g.setColor(image.getBackcolor());<NEW_LINE>g.fillRect(0, 0, (int<MASK><NEW_LINE>}<NEW_LINE>renderer.render(context.getJasperReportsContext(), g, new Rectangle2D.Double(0, 0, renderWidth, renderHeight));<NEW_LINE>} finally {<NEW_LINE>g.dispose();<NEW_LINE>}<NEW_LINE>pdfContentByte.saveState();<NEW_LINE>pdfContentByte.addTemplate(template, ratioX, 0f, 0f, ratioY, x, y);<NEW_LINE>pdfContentByte.restoreState();<NEW_LINE>getPdfWriter().releaseTemplate(template);<NEW_LINE>} | ) renderWidth, (int) renderHeight); |
1,084,216 | private String commitToGitLab(String repositoryUrl, String content, String commitMessage, boolean create) throws SourceConnectorException {<NEW_LINE>try (CloseableHttpClient httpClient = HttpClients.createDefault()) {<NEW_LINE>GitLabResource resource = resolver.resolve(repositoryUrl);<NEW_LINE>String contentUrl = this.endpoint("/api/v4/projects/:id/repository/commits").bind("id", toEncodedId(resource)).toString();<NEW_LINE>HttpPost post = new HttpPost(contentUrl);<NEW_LINE>post.addHeader("Content-Type", "application/json");<NEW_LINE>addSecurity(post);<NEW_LINE>GitLabCreateFileRequest body = new GitLabCreateFileRequest();<NEW_LINE>body.setBranch(resource.getBranch());<NEW_LINE>body.setCommitMessage(commitMessage);<NEW_LINE>body.setActions(new ArrayList<>());<NEW_LINE>GitLabAction action = new GitLabAction();<NEW_LINE>String b64Content = Base64.encodeBase64String(content.getBytes(StandardCharsets.UTF_8));<NEW_LINE>action.setGitLabAction(GitLabActionType.UPDATE);<NEW_LINE>if (create) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>action.setFilePath(resource.getResourcePath());<NEW_LINE>action.setContent(b64Content);<NEW_LINE>action.setEncoding("base64");<NEW_LINE>body.getActions().add(action);<NEW_LINE>// Set the POST body<NEW_LINE>post.setEntity(new StringEntity(mapper.writeValueAsString(body), StandardCharsets.UTF_8));<NEW_LINE>try (CloseableHttpResponse response = httpClient.execute(post)) {<NEW_LINE>if (response.getStatusLine().getStatusCode() != 201) {<NEW_LINE>throw new SourceConnectorException("Unexpected response from GitLab: " + response.getStatusLine().toString());<NEW_LINE>}<NEW_LINE>try (InputStream contentStream = response.getEntity().getContent()) {<NEW_LINE>JsonNode node = mapper.readTree(contentStream);<NEW_LINE>return node.get("id").asText();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new SourceConnectorException("Error creating GitLab resource content.", e);<NEW_LINE>}<NEW_LINE>} | action.setGitLabAction(GitLabActionType.CREATE); |
289,599 | public JMethod overrideAnnotatedMethod(ExecutableElement executableElement, GeneratedClassHolder holder) {<NEW_LINE>TypeMirror annotatedClass = holder.getAnnotatedElement().asType();<NEW_LINE>DeclaredType baseClass = (DeclaredType) executableElement.getEnclosingElement().asType();<NEW_LINE>Types typeUtils = environment.getProcessingEnvironment().getTypeUtils();<NEW_LINE>Map<String, TypeMirror> actualTypes = getActualTypes(typeUtils, baseClass, annotatedClass);<NEW_LINE>Map<String, List<AbstractJClass>> methodTypes = new LinkedHashMap<>();<NEW_LINE>for (TypeParameterElement typeParameter : executableElement.getTypeParameters()) {<NEW_LINE>List<? extends TypeMirror> bounds = typeParameter.getBounds();<NEW_LINE>List<AbstractJClass> addedBounds = typeBoundsToJClass(bounds, actualTypes);<NEW_LINE>methodTypes.put(typeParameter.toString(), addedBounds);<NEW_LINE>}<NEW_LINE>actualTypes.keySet().removeAll(methodTypes.keySet());<NEW_LINE>JMethod existingMethod = findAlreadyGeneratedMethod(executableElement, holder);<NEW_LINE>if (existingMethod != null) {<NEW_LINE>return existingMethod;<NEW_LINE>}<NEW_LINE>String methodName = executableElement.getSimpleName().toString();<NEW_LINE>AbstractJClass returnType = typeMirrorToJClass(executableElement.getReturnType(), actualTypes);<NEW_LINE>int modifier = elementVisibilityModifierToJMod(executableElement);<NEW_LINE>JMethod method = holder.getGeneratedClass().method(modifier, returnType, methodName);<NEW_LINE>copyNonAAAnnotations(method, executableElement.getAnnotationMirrors());<NEW_LINE>if (!hasAnnotation(method, Override.class)) {<NEW_LINE>method.annotate(Override.class);<NEW_LINE>}<NEW_LINE>for (Map.Entry<String, List<AbstractJClass>> typeDeclaration : methodTypes.entrySet()) {<NEW_LINE>List<AbstractJClass<MASK><NEW_LINE>addTypeBounds(method, bounds, typeDeclaration.getKey());<NEW_LINE>}<NEW_LINE>int i = 0;<NEW_LINE>for (VariableElement parameter : executableElement.getParameters()) {<NEW_LINE>boolean varParam = i == executableElement.getParameters().size() - 1 && executableElement.isVarArgs();<NEW_LINE>addParamToMethod(method, parameter, JMod.FINAL, actualTypes, varParam);<NEW_LINE>i++;<NEW_LINE>}<NEW_LINE>for (TypeMirror superThrownType : executableElement.getThrownTypes()) {<NEW_LINE>AbstractJClass thrownType = typeMirrorToJClass(superThrownType, actualTypes);<NEW_LINE>method._throws(thrownType);<NEW_LINE>}<NEW_LINE>callSuperMethod(method, holder, method.body());<NEW_LINE>return method;<NEW_LINE>} | > bounds = typeDeclaration.getValue(); |
1,563,460 | public // region update<NEW_LINE>UpdateRequest updateRequest(UpdateQuery query, IndexCoordinates index) {<NEW_LINE>String indexName = query.getIndexName() != null ? query.getIndexName() : index.getIndexName();<NEW_LINE>UpdateRequest updateRequest = new UpdateRequest(indexName, query.getId());<NEW_LINE>if (query.getScript() != null) {<NEW_LINE>Map<String, Object> params = query.getParams();<NEW_LINE>if (params == null) {<NEW_LINE>params = new HashMap<>();<NEW_LINE>}<NEW_LINE>Script script = new Script(getScriptType(query.getScriptType()), query.getLang(), query.getScript(), params);<NEW_LINE>updateRequest.script(script);<NEW_LINE>}<NEW_LINE>if (query.getDocument() != null) {<NEW_LINE>updateRequest.doc(query.getDocument());<NEW_LINE>}<NEW_LINE>if (query.getUpsert() != null) {<NEW_LINE>updateRequest.upsert(query.getUpsert());<NEW_LINE>}<NEW_LINE>if (query.getRouting() != null) {<NEW_LINE>updateRequest.routing(query.getRouting());<NEW_LINE>}<NEW_LINE>if (query.getScriptedUpsert() != null) {<NEW_LINE>updateRequest.scriptedUpsert(query.getScriptedUpsert());<NEW_LINE>}<NEW_LINE>if (query.getDocAsUpsert() != null) {<NEW_LINE>updateRequest.docAsUpsert(query.getDocAsUpsert());<NEW_LINE>}<NEW_LINE>if (query.getFetchSource() != null) {<NEW_LINE>updateRequest.fetchSource(query.getFetchSource());<NEW_LINE>}<NEW_LINE>if (query.getFetchSourceIncludes() != null || query.getFetchSourceExcludes() != null) {<NEW_LINE>List<String> includes = query.getFetchSourceIncludes() != null ? query.getFetchSourceIncludes() : Collections.emptyList();<NEW_LINE>List<String> excludes = query.getFetchSourceExcludes() != null ? query.getFetchSourceExcludes<MASK><NEW_LINE>updateRequest.fetchSource(includes.toArray(new String[0]), excludes.toArray(new String[0]));<NEW_LINE>}<NEW_LINE>if (query.getIfSeqNo() != null) {<NEW_LINE>updateRequest.setIfSeqNo(query.getIfSeqNo());<NEW_LINE>}<NEW_LINE>if (query.getIfPrimaryTerm() != null) {<NEW_LINE>updateRequest.setIfPrimaryTerm(query.getIfPrimaryTerm());<NEW_LINE>}<NEW_LINE>if (query.getRefreshPolicy() != null) {<NEW_LINE>updateRequest.setRefreshPolicy(RequestFactory.toElasticsearchRefreshPolicy(query.getRefreshPolicy()));<NEW_LINE>}<NEW_LINE>if (query.getRetryOnConflict() != null) {<NEW_LINE>updateRequest.retryOnConflict(query.getRetryOnConflict());<NEW_LINE>}<NEW_LINE>if (query.getTimeout() != null) {<NEW_LINE>updateRequest.timeout(query.getTimeout());<NEW_LINE>}<NEW_LINE>if (query.getWaitForActiveShards() != null) {<NEW_LINE>updateRequest.waitForActiveShards(ActiveShardCount.parseString(query.getWaitForActiveShards()));<NEW_LINE>}<NEW_LINE>return updateRequest;<NEW_LINE>} | () : Collections.emptyList(); |
1,842,276 | public void initialize(ConfigurableListableBeanFactory beanFactory) throws BeansException {<NEW_LINE>BeanDefinitionRegistry registry = (BeanDefinitionRegistry) beanFactory;<NEW_LINE>List<Map<String, String>> idempotentEndpointsMapping = new ManagedList<>();<NEW_LINE>for (String beanName : registry.getBeanDefinitionNames()) {<NEW_LINE>BeanDefinition beanDefinition = registry.getBeanDefinition(beanName);<NEW_LINE>if (IdempotentReceiverInterceptor.class.getName().equals(beanDefinition.getBeanClassName())) {<NEW_LINE>Object value = beanDefinition.removeAttribute(IDEMPOTENT_ENDPOINTS_MAPPING);<NEW_LINE>Assert.isInstanceOf(<MASK><NEW_LINE>String mapping = (String) value;<NEW_LINE>String[] endpoints = StringUtils.tokenizeToStringArray(mapping, ",");<NEW_LINE>for (String endpoint : endpoints) {<NEW_LINE>Map<String, String> idempotentEndpoint = new ManagedMap<>();<NEW_LINE>idempotentEndpoint.put(beanName, beanFactory.resolveEmbeddedValue(endpoint) + IntegrationConfigUtils.HANDLER_ALIAS_SUFFIX);<NEW_LINE>idempotentEndpointsMapping.add(idempotentEndpoint);<NEW_LINE>}<NEW_LINE>} else if (beanDefinition instanceof AnnotatedBeanDefinition) {<NEW_LINE>annotated(beanFactory, idempotentEndpointsMapping, beanName, beanDefinition);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!idempotentEndpointsMapping.isEmpty()) {<NEW_LINE>BeanDefinition bd = BeanDefinitionBuilder.rootBeanDefinition(IdempotentReceiverAutoProxyCreator.class, IdempotentReceiverAutoProxyCreator::new).addPropertyValue("idempotentEndpointsMapping", idempotentEndpointsMapping).getBeanDefinition();<NEW_LINE>registry.registerBeanDefinition(IDEMPOTENT_RECEIVER_AUTO_PROXY_CREATOR_BEAN_NAME, bd);<NEW_LINE>}<NEW_LINE>} | String.class, value, "The 'mapping' of BeanDefinition 'IDEMPOTENT_ENDPOINTS_MAPPING' must be String."); |
1,436,427 | public void startAdding(LayoutComponent[] comps, Rectangle[] bounds, Point hotspot, String defaultContId) {<NEW_LINE>if (logTestCode()) {<NEW_LINE>// NOI18N<NEW_LINE>testCode.add("// > START ADDING");<NEW_LINE>}<NEW_LINE>prepareDragger(comps, bounds, hotspot, LayoutDragger.ALL_EDGES);<NEW_LINE>if (logTestCode()) {<NEW_LINE>// NOI18N<NEW_LINE>testCode.add("{");<NEW_LINE>// lc should be already filled in the MetaComponentCreator.getPrecreatedComponent<NEW_LINE>// NOI18N<NEW_LINE>LayoutTestUtils.writeLayoutComponentArray(testCode, "comps", "lc");<NEW_LINE>// NOI18N<NEW_LINE>LayoutTestUtils.writeRectangleArray(testCode, "bounds", bounds);<NEW_LINE>// NOI18N<NEW_LINE>LayoutTestUtils.<MASK><NEW_LINE>// NOI18N<NEW_LINE>testCode.// NOI18N<NEW_LINE>add(// NOI18N<NEW_LINE>"Point hotspot = new Point(" + new Double(hotspot.getX()).intValue() + "," + new Double(hotspot.getY()).intValue() + ");");<NEW_LINE>// NOI18N<NEW_LINE>testCode.add("ld.startAdding(comps, bounds, hotspot, defaultContId);");<NEW_LINE>// NOI18N<NEW_LINE>testCode.add("}");<NEW_LINE>}<NEW_LINE>if (defaultContId != null) {<NEW_LINE>setDragTarget(layoutModel.getLayoutComponent(defaultContId), comps, false);<NEW_LINE>}<NEW_LINE>if (logTestCode()) {<NEW_LINE>// NOI18N<NEW_LINE>testCode.add("// < START ADDING");<NEW_LINE>}<NEW_LINE>} | writeString(testCode, "defaultContId", defaultContId); |
950,877 | public BufferedImage apply(BufferedImage img) {<NEW_LINE>BufferedImage <MASK><NEW_LINE>Graphics2D g = newImage.createGraphics();<NEW_LINE>g.setFont(font);<NEW_LINE>g.setColor(c);<NEW_LINE>g.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, alpha));<NEW_LINE>int imageWidth = img.getWidth();<NEW_LINE>int imageHeight = img.getHeight();<NEW_LINE>int captionWidth = g.getFontMetrics().stringWidth(caption);<NEW_LINE>int captionHeight = g.getFontMetrics().getHeight() / 2;<NEW_LINE>Point p = position.calculate(imageWidth, imageHeight, captionWidth, 0, insets, insets, insets, insets);<NEW_LINE>double yRatio = p.y / (double) img.getHeight();<NEW_LINE>int yOffset = (int) ((1.0 - yRatio) * captionHeight);<NEW_LINE>g.drawString(caption, p.x, p.y + yOffset);<NEW_LINE>g.dispose();<NEW_LINE>return newImage;<NEW_LINE>} | newImage = BufferedImages.copy(img); |
907,379 | private List<BibEntry> parseEntries(Document content) {<NEW_LINE>List<BibEntry> result = new LinkedList<>();<NEW_LINE>// used for creating test cases<NEW_LINE>// XMLUtil.printDocument(content);<NEW_LINE>// Namespace srwNamespace = Namespace.getNamespace("srw","http://www.loc.gov/zing/srw/");<NEW_LINE>// Schleife ueber alle Teilergebnisse<NEW_LINE>// Element root = content.getDocumentElement();<NEW_LINE>Element root = (Element) content.getElementsByTagName("zs:searchRetrieveResponse").item(0);<NEW_LINE>Element srwrecords = getChild("zs:records", root);<NEW_LINE>if (srwrecords == null) {<NEW_LINE>// no records found -> return empty list<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>List<Element> records = getChildren("zs:record", srwrecords);<NEW_LINE>for (Element record : records) {<NEW_LINE>Element e = getChild("zs:recordData", record);<NEW_LINE>if (e != null) {<NEW_LINE><MASK><NEW_LINE>if (e != null) {<NEW_LINE>BibEntry bibEntry = parseEntry(e);<NEW_LINE>// TODO: Add filtering on years (based on org.jabref.logic.importer.fetcher.transformers.YearRangeByFilteringQueryTransformer.getStartYear)<NEW_LINE>result.add(bibEntry);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | e = getChild("record", e); |
148,631 | private void configurePublications(Project project) {<NEW_LINE>var publishingExtension = project.getExtensions().getByType(PublishingExtension.class);<NEW_LINE>var publication = publishingExtension.getPublications().create("elastic", MavenPublication.class);<NEW_LINE>project.afterEvaluate(project1 -> {<NEW_LINE>if (project1.getPlugins().hasPlugin(ShadowPlugin.class)) {<NEW_LINE>configureWithShadowPlugin(project1, publication);<NEW_LINE>} else if (project1.getPlugins().hasPlugin(JavaPlugin.class)) {<NEW_LINE>publication.from(project.getComponents().getByName("java"));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>var projectLicenses = (MapProperty<String, String>) project.getExtensions().getExtraProperties().get("projectLicenses");<NEW_LINE>publication.getPom().withXml(xml -> {<NEW_LINE>var node = xml.asNode();<NEW_LINE>node.appendNode("inceptionYear", "2009");<NEW_LINE>var licensesNode = node.appendNode("licenses");<NEW_LINE>projectLicenses.get().entrySet().stream().sorted(Map.Entry.comparingByKey()).forEach(entry -> {<NEW_LINE>Node license = licensesNode.appendNode("license");<NEW_LINE>license.appendNode("name", entry.getKey());<NEW_LINE>license.appendNode("url", entry.getValue());<NEW_LINE><MASK><NEW_LINE>});<NEW_LINE>var developer = node.appendNode("developers").appendNode("developer");<NEW_LINE>developer.appendNode("name", "Elastic");<NEW_LINE>developer.appendNode("url", "https://www.elastic.co");<NEW_LINE>});<NEW_LINE>publishingExtension.getRepositories().maven(mavenArtifactRepository -> {<NEW_LINE>mavenArtifactRepository.setName("test");<NEW_LINE>mavenArtifactRepository.setUrl(new File(buildLayout.getRootDirectory(), "build/local-test-repo"));<NEW_LINE>});<NEW_LINE>} | license.appendNode("distribution", "repo"); |
897,297 | public void initNearbyFilter() {<NEW_LINE>nearbyFilterList.setVisibility(View.GONE);<NEW_LINE>searchView.setOnQueryTextFocusChangeListener((v, hasFocus) -> {<NEW_LINE>if (hasFocus) {<NEW_LINE>presenter.searchViewGainedFocus();<NEW_LINE>nearbyFilterList.setVisibility(View.VISIBLE);<NEW_LINE>} else {<NEW_LINE>nearbyFilterList.setVisibility(View.GONE);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>recyclerView.setHasFixedSize(true);<NEW_LINE>recyclerView.addItemDecoration(new DividerItemDecoration(getContext(), DividerItemDecoration.VERTICAL));<NEW_LINE>final LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getActivity());<NEW_LINE>linearLayoutManager.setOrientation(LinearLayoutManager.VERTICAL);<NEW_LINE>recyclerView.setLayoutManager(linearLayoutManager);<NEW_LINE>nearbyFilterSearchRecyclerViewAdapter = new NearbyFilterSearchRecyclerViewAdapter(getContext(), new ArrayList<>(Label<MASK><NEW_LINE>nearbyFilterSearchRecyclerViewAdapter.setCallback(new NearbyFilterSearchRecyclerViewAdapter.Callback() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void setCheckboxUnknown() {<NEW_LINE>presenter.setCheckboxUnknown();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void filterByMarkerType(final ArrayList<Label> selectedLabels, final int i, final boolean b, final boolean b1) {<NEW_LINE>presenter.filterByMarkerType(selectedLabels, i, b, b1);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean isDarkTheme() {<NEW_LINE>return isDarkTheme;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>nearbyFilterList.getLayoutParams().width = (int) LayoutUtils.getScreenWidth(getActivity(), 0.75);<NEW_LINE>recyclerView.setAdapter(nearbyFilterSearchRecyclerViewAdapter);<NEW_LINE>LayoutUtils.setLayoutHeightAllignedToWidth(1.25, nearbyFilterList);<NEW_LINE>compositeDisposable.add(RxSearchView.queryTextChanges(searchView).takeUntil(RxView.detaches(searchView)).debounce(500, TimeUnit.MILLISECONDS).observeOn(AndroidSchedulers.mainThread()).subscribe(query -> {<NEW_LINE>((NearbyFilterSearchRecyclerViewAdapter) recyclerView.getAdapter()).getFilter().filter(query.toString());<NEW_LINE>}));<NEW_LINE>initFilterChips();<NEW_LINE>} | .valuesAsList()), recyclerView); |
450,629 | protected static KeyPair generateDHKeyPair(TransportHelper transport, boolean outbound) throws IOException {<NEW_LINE>if (dh_key_generator == null) {<NEW_LINE>throw (new IOException("Crypto not setup"));<NEW_LINE>}<NEW_LINE>synchronized (dh_key_generator) {<NEW_LINE>if (!outbound) {<NEW_LINE>InetSocketAddress is_address = transport.getAddress();<NEW_LINE>byte[] address = AddressUtils.getAddressBytes(is_address);<NEW_LINE>int hit_count = generate_bloom.add(address);<NEW_LINE><MASK><NEW_LINE>// allow up to 10% bloom filter utilisation<NEW_LINE>if (generate_bloom.getSize() / generate_bloom.getEntryCount() < 10) {<NEW_LINE>generate_bloom = BloomFilterFactory.createAddRemove4Bit(generate_bloom.getSize() + BLOOM_INCREASE);<NEW_LINE>generate_bloom_create_time = now;<NEW_LINE>Logger.log(new LogEvent(LOGID, "PHE bloom: size increased to " + generate_bloom.getSize()));<NEW_LINE>} else if (now < generate_bloom_create_time || now - generate_bloom_create_time > BLOOM_RECREATE) {<NEW_LINE>generate_bloom = BloomFilterFactory.createAddRemove4Bit(generate_bloom.getSize());<NEW_LINE>generate_bloom_create_time = now;<NEW_LINE>}<NEW_LINE>if (hit_count >= 15) {<NEW_LINE>Logger.log(new LogEvent(LOGID, "PHE bloom: too many recent connection attempts from " + transport.getAddress()));<NEW_LINE>throw (new IOException("Too many recent connection attempts (phe)"));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>KeyPair res = dh_key_generator.generateKeyPair();<NEW_LINE>return (res);<NEW_LINE>}<NEW_LINE>} | long now = SystemTime.getCurrentTime(); |
826,021 | public // ----------------------------------------------<NEW_LINE>void listAirports(int max) {<NEW_LINE>if (max < -1)<NEW_LINE>return;<NEW_LINE>// Try to find the requested number of airports.<NEW_LINE>// Note the use of the "__." and "Order" prefixes.<NEW_LINE>List<Vertex> vlist = g.V().hasLabel("airport").order().by(__.id(), Order.asc).limit(max).toList();<NEW_LINE>// Vertex ID<NEW_LINE>Long id;<NEW_LINE>// 3 character IATA code.<NEW_LINE>String iata;<NEW_LINE>// 4 character ICAO code.<NEW_LINE>String icao;<NEW_LINE>// City the airport is in.<NEW_LINE>String city;<NEW_LINE>// Airport description.<NEW_LINE>String desc;<NEW_LINE>// 2 character country code.<NEW_LINE>String ctry;<NEW_LINE>// 5 or 6 character Region code<NEW_LINE>String rgn;<NEW_LINE>for (Vertex v : vlist) {<NEW_LINE>id = (Long) v.id();<NEW_LINE>iata = (String) v.<MASK><NEW_LINE>icao = (String) v.values("icao").next();<NEW_LINE>city = (String) v.values("city").next();<NEW_LINE>desc = (String) v.values("desc").next();<NEW_LINE>ctry = (String) v.values("country").next();<NEW_LINE>rgn = (String) v.values("region").next();<NEW_LINE>System.out.format("%5d %3s %4s %2s %6s %15s %-50s\n", id, iata, icao, ctry, rgn, city, desc);<NEW_LINE>}<NEW_LINE>} | values("code").next(); |
1,024,225 | public int compare(Version version1, Version version2) {<NEW_LINE>int minLength = Math.min(version1.getFragmentCount(<MASK><NEW_LINE>for (int i = 0; i < minLength; i++) {<NEW_LINE>Fragment fragment1 = version1.getFragment(i);<NEW_LINE>Fragment fragment2 = version2.getFragment(i);<NEW_LINE>long number1 = fragment1.getNumber();<NEW_LINE>long number2 = fragment2.getNumber();<NEW_LINE>if (number1 < number2) {<NEW_LINE>return -1;<NEW_LINE>} else if (number1 > number2) {<NEW_LINE>return 1;<NEW_LINE>} else {<NEW_LINE>// Numerical values are equal => compare the textual values<NEW_LINE>int textDiff = fragment1.getText().compareTo(fragment2.getText());<NEW_LINE>if (textDiff != 0) {<NEW_LINE>return textDiff;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return version1.getFragmentCount() - version2.getFragmentCount();<NEW_LINE>} | ), version2.getFragmentCount()); |
796,702 | final PutPlaybackConfigurationResult executePutPlaybackConfiguration(PutPlaybackConfigurationRequest putPlaybackConfigurationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(putPlaybackConfigurationRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<PutPlaybackConfigurationRequest> request = null;<NEW_LINE>Response<PutPlaybackConfigurationResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new PutPlaybackConfigurationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(putPlaybackConfigurationRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "MediaTailor");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "PutPlaybackConfiguration");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<PutPlaybackConfigurationResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new PutPlaybackConfigurationResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | HandlerContextKey.SIGNING_REGION, getSigningRegion()); |
1,183,884 | private Map<String, Map<Class<?>, HandlerMethod>> findHandlerMethodsForTarget() {<NEW_LINE>Map<String, Map<Class<?>, HandlerMethod>> methods = new HashMap<>();<NEW_LINE>Map<Class<?>, HandlerMethod> candidateMethods = new HashMap<>();<NEW_LINE>Map<Class<?>, HandlerMethod> candidateMessageMethods = new HashMap<>();<NEW_LINE>Map<Class<?>, HandlerMethod> fallbackMethods = new HashMap<>();<NEW_LINE>Map<Class<?>, HandlerMethod> fallbackMessageMethods = new HashMap<>();<NEW_LINE>AtomicReference<Class<?>> ambiguousFallbackType = new AtomicReference<>();<NEW_LINE>AtomicReference<Class<?>> ambiguousFallbackMessageGenericType = new AtomicReference<>();<NEW_LINE>Class<?> targetClass = getTargetClass(this.targetObject);<NEW_LINE>processMethodsFromTarget(candidateMethods, candidateMessageMethods, fallbackMethods, fallbackMessageMethods, ambiguousFallbackType, ambiguousFallbackMessageGenericType, targetClass);<NEW_LINE>if (!candidateMethods.isEmpty() || !candidateMessageMethods.isEmpty()) {<NEW_LINE>methods.put(CANDIDATE_METHODS, candidateMethods);<NEW_LINE>methods.put(CANDIDATE_MESSAGE_METHODS, candidateMessageMethods);<NEW_LINE>return methods;<NEW_LINE>}<NEW_LINE>if ((ambiguousFallbackType.get() != null || ambiguousFallbackMessageGenericType.get() != null) && ServiceActivator.class.equals(this.annotationType)) {<NEW_LINE>Method frameworkMethod = obtainFrameworkMethod(targetClass);<NEW_LINE>if (frameworkMethod != null) {<NEW_LINE>HandlerMethod theHandlerMethod = createHandlerMethod(frameworkMethod);<NEW_LINE>methods.put(CANDIDATE_METHODS, Collections.singletonMap(Object.class, theHandlerMethod));<NEW_LINE>methods.put(CANDIDATE_MESSAGE_METHODS, candidateMessageMethods);<NEW_LINE>return methods;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>validateFallbackMethods(fallbackMethods, fallbackMessageMethods, ambiguousFallbackType, ambiguousFallbackMessageGenericType);<NEW_LINE>methods.put(CANDIDATE_METHODS, fallbackMethods);<NEW_LINE><MASK><NEW_LINE>return methods;<NEW_LINE>} | methods.put(CANDIDATE_MESSAGE_METHODS, fallbackMessageMethods); |
569,961 | public void marshall(GroupVersion groupVersion, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (groupVersion == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(groupVersion.getConnectorDefinitionVersionArn(), CONNECTORDEFINITIONVERSIONARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(groupVersion.getCoreDefinitionVersionArn(), COREDEFINITIONVERSIONARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(groupVersion.getDeviceDefinitionVersionArn(), DEVICEDEFINITIONVERSIONARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(groupVersion.getLoggerDefinitionVersionArn(), LOGGERDEFINITIONVERSIONARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(groupVersion.getResourceDefinitionVersionArn(), RESOURCEDEFINITIONVERSIONARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(groupVersion.getSubscriptionDefinitionVersionArn(), SUBSCRIPTIONDEFINITIONVERSIONARN_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | groupVersion.getFunctionDefinitionVersionArn(), FUNCTIONDEFINITIONVERSIONARN_BINDING); |
188,650 | private static Vector combineServerIntLongRowSplits(List<ServerRow> rowSplits, MatrixMeta matrixMeta, int rowIndex) {<NEW_LINE>int colNum = (int) matrixMeta.getColNum();<NEW_LINE>int elemNum = 0;<NEW_LINE>int size = rowSplits.size();<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>elemNum += rowSplits.get(i).size();<NEW_LINE>}<NEW_LINE>IntLongVector row;<NEW_LINE>if (matrixMeta.isHash()) {<NEW_LINE>row = VFactory.sparseLongVector(colNum, elemNum);<NEW_LINE>} else {<NEW_LINE>if (elemNum >= (int) (storageConvFactor * colNum)) {<NEW_LINE>row = VFactory.denseLongVector(colNum);<NEW_LINE>} else {<NEW_LINE>row = VFactory.sparseLongVector(colNum, elemNum);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>row.<MASK><NEW_LINE>row.setRowId(rowIndex);<NEW_LINE>Collections.sort(rowSplits, serverRowComp);<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>if (rowSplits.get(i) == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>((ServerIntLongRow) rowSplits.get(i)).mergeTo(row);<NEW_LINE>}<NEW_LINE>return row;<NEW_LINE>} | setMatrixId(matrixMeta.getId()); |
1,354,089 | private void initializeIteratorNextReturnType() {<NEW_LINE>Type type;<NEW_LINE>if (this.type.getTag() == PredefinedTypes.TYPE_MAP.getTag()) {<NEW_LINE>BMapType <MASK><NEW_LINE>type = mapType.getConstrainedType();<NEW_LINE>} else {<NEW_LINE>BRecordType recordType = (BRecordType) this.type;<NEW_LINE>LinkedHashSet<Type> types = recordType.getFields().values().stream().map(Field::getFieldType).collect(Collectors.toCollection(LinkedHashSet::new));<NEW_LINE>if (recordType.restFieldType != null) {<NEW_LINE>types.add(recordType.restFieldType);<NEW_LINE>}<NEW_LINE>if (types.size() == 1) {<NEW_LINE>type = types.iterator().next();<NEW_LINE>} else {<NEW_LINE>type = new BUnionType(new ArrayList<>(types));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>iteratorNextReturnType = IteratorUtils.createIteratorNextReturnType(type);<NEW_LINE>} | mapType = (BMapType) this.type; |
10,157 | public MJournal reverseCorrectIt(int GL_JournalBatch_ID) {<NEW_LINE>log.info(toString());<NEW_LINE>// Journal<NEW_LINE>MJournal reverse = new MJournal(this);<NEW_LINE>reverse.setGL_JournalBatch_ID(GL_JournalBatch_ID);<NEW_LINE>reverse.setDateDoc(getDateDoc());<NEW_LINE>reverse.setC_Period_ID(getC_Period_ID());<NEW_LINE>reverse.setDateAcct(getDateAcct());<NEW_LINE>reverse.setControlAmt(getControlAmt().negate());<NEW_LINE>// Reverse indicator<NEW_LINE>reverse.addDescription("(->" + getDocumentNo() + ")");<NEW_LINE>// FR [ 1948157 ]<NEW_LINE>reverse.setReversal_ID(getGL_Journal_ID());<NEW_LINE><MASK><NEW_LINE>MDocType docType = MDocType.get(getCtx(), getC_DocType_ID());<NEW_LINE>// Set Document No from flag<NEW_LINE>if (docType.isCopyDocNoOnReversal()) {<NEW_LINE>reverse.setDocumentNo(getDocumentNo() + Msg.getMsg(getCtx(), "Cancelled"));<NEW_LINE>}<NEW_LINE>reverse.saveEx();<NEW_LINE>addDescription("(" + reverse.getDocumentNo() + "<-)");<NEW_LINE>// Lines<NEW_LINE>reverse.copyLinesFrom(this, null, 'C');<NEW_LINE>// Add support for process journal to reverse<NEW_LINE>boolean sucess = reverse.processIt(DOCACTION_Complete);<NEW_LINE>if (!sucess) {<NEW_LINE>throw new AdempiereException(reverse.getProcessMsg());<NEW_LINE>}<NEW_LINE>reverse.setDocAction(DOCACTION_None);<NEW_LINE>reverse.setDocStatus(DOCSTATUS_Reversed);<NEW_LINE>reverse.saveEx();<NEW_LINE>//<NEW_LINE>setProcessed(true);<NEW_LINE>// FR [ 1948157 ]<NEW_LINE>setReversal_ID(reverse.getGL_Journal_ID());<NEW_LINE>setDocAction(DOCACTION_None);<NEW_LINE>setDocStatus(DOCSTATUS_Reversed);<NEW_LINE>return reverse;<NEW_LINE>} | reverse.set_ValueNoCheck("DocumentNo", null); |
48,620 | public void execute(IvyModuleDescriptorSpec descriptor) {<NEW_LINE>descriptor.description(new Action<IvyModuleDescriptorDescription>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void execute(IvyModuleDescriptorDescription description) {<NEW_LINE>description.getText().set(declaration.getDescription());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>descriptor.withXml(new Action<XmlProvider>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void execute(XmlProvider xmlProvider) {<NEW_LINE>Element root = xmlProvider.asElement();<NEW_LINE>Document document = root.getOwnerDocument();<NEW_LINE>Node dependencies = root.getElementsByTagName("dependencies").item(0);<NEW_LINE>Node dependency = dependencies.appendChild(document.createElement("dependency"));<NEW_LINE>Attr org = document.createAttribute("org");<NEW_LINE>org.setValue(mainPublication.getOrganisation());<NEW_LINE>dependency.getAttributes().setNamedItem(org);<NEW_LINE>Attr name = document.createAttribute("name");<NEW_LINE>name.setValue(mainPublication.getModule());<NEW_LINE>dependency.<MASK><NEW_LINE>Attr rev = document.createAttribute("rev");<NEW_LINE>rev.setValue(mainPublication.getRevision());<NEW_LINE>dependency.getAttributes().setNamedItem(rev);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | getAttributes().setNamedItem(name); |
1,811,466 | // callback changed dc list<NEW_LINE>List<String> diffRoutes(Map<String, RouteMeta> current, Map<String, RouteMeta> future) {<NEW_LINE>if (current == null || current.size() == 0)<NEW_LINE>return new ArrayList<>(future.keySet());<NEW_LINE>if (future == null || future.size() == 0)<NEW_LINE>return new ArrayList<>(current.keySet());<NEW_LINE>List<String> changedDcs = new LinkedList<>();<NEW_LINE>Set<String> <MASK><NEW_LINE>for (Map.Entry<String, RouteMeta> entry : current.entrySet()) {<NEW_LINE>RouteMeta comparedRouteMeta = future.get(entry.getKey());<NEW_LINE>if (comparedRouteMeta == null || !comparedRouteMeta.equals(entry.getValue())) {<NEW_LINE>changedDcs.add(entry.getKey());<NEW_LINE>}<NEW_LINE>comparedDcs.add(entry.getKey());<NEW_LINE>}<NEW_LINE>for (Map.Entry<String, RouteMeta> entry : future.entrySet()) {<NEW_LINE>if (!comparedDcs.contains(entry.getKey())) {<NEW_LINE>changedDcs.add(entry.getKey());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return changedDcs;<NEW_LINE>} | comparedDcs = new HashSet<>(); |
1,491,982 | protected JComponent createContent() {<NEW_LINE>myMouseMotionListener = new MyMouseMotionListener();<NEW_LINE>myMouseListener = new MyMouseListener();<NEW_LINE>ListPopupStep<Object> step = getListStep();<NEW_LINE>myListModel = new ListPopupModel(this, getSpeedSearch(), step);<NEW_LINE>myList = new MyList();<NEW_LINE>if (myStep.getTitle() != null) {<NEW_LINE>myList.getAccessibleContext().setAccessibleName(myStep.getTitle());<NEW_LINE>}<NEW_LINE>if (step instanceof ListPopupStepEx) {<NEW_LINE>((ListPopupStepEx) step).setEmptyText(myList.getEmptyText());<NEW_LINE>}<NEW_LINE>myList.setSelectionModel(new MyListSelectionModel());<NEW_LINE>selectFirstSelectableItem();<NEW_LINE>Insets padding = UIUtil.getListViewportPadding();<NEW_LINE>myList.<MASK><NEW_LINE>ScrollingUtil.installActions(myList);<NEW_LINE>myList.setCellRenderer(getListElementRenderer());<NEW_LINE>registerAction("handleSelection1", KeyEvent.VK_ENTER, 0, new AbstractAction() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void actionPerformed(ActionEvent e) {<NEW_LINE>handleSelect(true);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>myList.getActionMap().put(ListActions.Right.ID, new AbstractAction() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void actionPerformed(ActionEvent e) {<NEW_LINE>handleSelect(false);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>myList.getActionMap().put(ListActions.Left.ID, new AbstractAction() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void actionPerformed(ActionEvent e) {<NEW_LINE>if (isClosableByLeftArrow()) {<NEW_LINE>goBack();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>myList.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));<NEW_LINE>return myList;<NEW_LINE>} | setBorder(new EmptyBorder(padding)); |
1,066,446 | boolean saveLists(List<KeywordList> lists) {<NEW_LINE>List<KeywordList> overwritten = new ArrayList<>();<NEW_LINE>List<KeywordList> newLists = new ArrayList<>();<NEW_LINE>for (KeywordList list : lists) {<NEW_LINE>if (this.listExists(list.getName())) {<NEW_LINE>overwritten.add(list);<NEW_LINE>} else {<NEW_LINE>newLists.add(list);<NEW_LINE>}<NEW_LINE>theLists.put(list.getName(), list);<NEW_LINE>}<NEW_LINE>boolean saved = save(true);<NEW_LINE>if (saved) {<NEW_LINE>for (KeywordList list : newLists) {<NEW_LINE>try {<NEW_LINE>changeSupport.firePropertyChange(ListsEvt.LIST_ADDED.toString(), null, list.getName());<NEW_LINE>} catch (Exception e) {<NEW_LINE>// NON-NLS<NEW_LINE>LOGGER.log(Level.SEVERE, "KeywordSearchListsAbstract listener threw exception", e);<NEW_LINE>MessageNotifyUtil.Notify.show(NbBundle.getMessage(this.getClass(), "KeywordSearchListsAbstract.moduleErr"), NbBundle.getMessage(this.getClass(), "KeywordSearchListsAbstract.saveList.errMsg1.msg"<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (KeywordList over : overwritten) {<NEW_LINE>try {<NEW_LINE>changeSupport.firePropertyChange(ListsEvt.LIST_UPDATED.toString(), null, over.getName());<NEW_LINE>} catch (Exception e) {<NEW_LINE>// NON-NLS<NEW_LINE>LOGGER.log(Level.SEVERE, "KeywordSearchListsAbstract listener threw exception", e);<NEW_LINE>MessageNotifyUtil.Notify.show(NbBundle.getMessage(this.getClass(), "KeywordSearchListsAbstract.moduleErr"), NbBundle.getMessage(this.getClass(), "KeywordSearchListsAbstract.saveList.errMsg2.msg"), MessageNotifyUtil.MessageType.ERROR);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return saved;<NEW_LINE>} | ), MessageNotifyUtil.MessageType.ERROR); |
1,471,418 | private void mapResourceFileToTargetClassFiles(Map<File, Set<String>> typesCompiledByFile) {<NEW_LINE>if (typesCompiledByFile.isEmpty()) {<NEW_LINE>// nothing to add<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Keep track of compiled Manifold types during a Rebuild.<NEW_LINE>//<NEW_LINE>// Generally, since Manifold types are magically added to the build as<NEW_LINE>// they are referenced, they need to be mapped in the JPS compilation<NEW_LINE>// process to support hotswap debugging, etc.<NEW_LINE>Map<File, Set<String>> typesToFile = getTypesToFile();<NEW_LINE>if (typesToFile != null) {<NEW_LINE>typesCompiledByFile.forEach((file, types) -> {<NEW_LINE>Set<String> existingTypes = typesToFile.get(file);<NEW_LINE>if (existingTypes != null) {<NEW_LINE>existingTypes.addAll(types);<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>} | typesToFile.put(file, types); |
1,608,545 | public static DoubleMatrix2D distance(DoubleMatrix2D matrix, VectorVectorFunction distanceFunction) {<NEW_LINE>int columns = matrix.columns();<NEW_LINE>DoubleMatrix2D distance = new cern.colt.matrix.impl.DenseDoubleMatrix2D(columns, columns);<NEW_LINE>// cache views<NEW_LINE>DoubleMatrix1D[] cols = new DoubleMatrix1D[columns];<NEW_LINE>for (int i = columns; --i >= 0; ) {<NEW_LINE>cols[i] = matrix.viewColumn(i);<NEW_LINE>}<NEW_LINE>// work out all permutations<NEW_LINE>for (int i = columns; --i >= 0; ) {<NEW_LINE>for (int j = i; --j >= 0; ) {<NEW_LINE>double d = distanceFunction.apply(cols[i], cols[j]);<NEW_LINE>distance.setQuick(i, j, d);<NEW_LINE>// symmetric<NEW_LINE>distance.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return distance;<NEW_LINE>} | setQuick(j, i, d); |
1,201,123 | public void visitMethodInsn(int opcode, String owner, String name, String descriptor, boolean isInterface) {<NEW_LINE>if (opcode == INVOKESTATIC && name.equals("notNull")) {<NEW_LINE>// This code is rewriting the Assert.notNull<NEW_LINE>// first, remove the parameters that would have been passed to the notNull call<NEW_LINE>mv.visitInsn(POP);<NEW_LINE>mv.visitInsn(POP);<NEW_LINE>mv.visitMethodInsn(INVOKESTATIC, "org/springframework/nativex/AotModeDetector", "isAotModeEnabled", "()Z", false);<NEW_LINE>Label normal = new Label();<NEW_LINE>mv.visitJumpInsn(IFEQ, normal);<NEW_LINE>mv.visitVarInsn(ALOAD, 0);<NEW_LINE>mv.visitTypeInsn(NEW, "java/util/LinkedHashSet");<NEW_LINE>mv.visitInsn(DUP);<NEW_LINE>mv.visitInsn(ICONST_1);<NEW_LINE>mv.visitTypeInsn(ANEWARRAY, "java/lang/Class");<NEW_LINE>mv.visitInsn(DUP);<NEW_LINE>mv.visitInsn(ICONST_0);<NEW_LINE>mv.visitLdcInsn<MASK><NEW_LINE>mv.visitInsn(AASTORE);<NEW_LINE>mv.visitMethodInsn(INVOKESTATIC, "java/util/Arrays", "asList", "([Ljava/lang/Object;)Ljava/util/List;", false);<NEW_LINE>mv.visitMethodInsn(INVOKESPECIAL, "java/util/LinkedHashSet", "<init>", "(Ljava/util/Collection;)V", false);<NEW_LINE>after = new Label();<NEW_LINE>mv.visitJumpInsn(GOTO, after);<NEW_LINE>mv.visitLabel(normal);<NEW_LINE>} else {<NEW_LINE>super.visitMethodInsn(opcode, owner, name, descriptor, isInterface);<NEW_LINE>}<NEW_LINE>} | (Type.getObjectType("java/lang/Object")); |
1,116,222 | public int ladderLength(String beginWord, String endWord, List<String> wordList) {<NEW_LINE>//<NEW_LINE>List<String> visited = new ArrayList<>();<NEW_LINE>int len = beginWord.length();<NEW_LINE>Map<String, List<String>> base = new HashMap<>();<NEW_LINE>for (String word : wordList) {<NEW_LINE>for (int i = 0; i < len; i++) {<NEW_LINE>String newWord = word.substring(0, i) + '*' + word.substring(i + 1, len);<NEW_LINE>List<String> list = base.getOrDefault(newWord, new ArrayList<String>());<NEW_LINE>list.add(word);<NEW_LINE>base.put(newWord, list);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Queue<Pair> queue = new LinkedList<>();<NEW_LINE>queue.add(new Pair(beginWord, 1));<NEW_LINE>visited.add(beginWord);<NEW_LINE>while (queue.size() > 0) {<NEW_LINE>Pair pair = queue.poll();<NEW_LINE>visited.add(String.valueOf<MASK><NEW_LINE>String curWord = String.valueOf(pair.getKey());<NEW_LINE>int level = pair.getVal();<NEW_LINE>for (int i = 0; i < len; i++) {<NEW_LINE>String keyWord = curWord.substring(0, i) + '*' + curWord.substring(i + 1, len);<NEW_LINE>List<String> baseList = base.getOrDefault(keyWord, new ArrayList<>());<NEW_LINE>for (String baseWord : baseList) {<NEW_LINE>if (baseWord.equals(endWord)) {<NEW_LINE>return level + 1;<NEW_LINE>}<NEW_LINE>if (!visited.contains(baseWord)) {<NEW_LINE>queue.add(new Pair(baseWord, level + 1));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return 0;<NEW_LINE>} | (pair.getKey())); |
1,447,801 | public void lowerStoreIndexedNode(StoreIndexedNode storeIndexed, LoweringTool tool) {<NEW_LINE>StructuredGraph graph = storeIndexed.graph();<NEW_LINE>JavaKind elementKind = storeIndexed.elementKind();<NEW_LINE>ValueNode value = storeIndexed.value();<NEW_LINE>ValueNode array = storeIndexed.array();<NEW_LINE>AddressNode address = createArrayAddress(graph, array, <MASK><NEW_LINE>ValueNode writeValue = value;<NEW_LINE>Stamp valueStamp = value.stamp(NodeView.DEFAULT);<NEW_LINE>if (!(valueStamp instanceof PTXStamp) || !((PTXStamp) valueStamp).getPTXKind().isVector()) {<NEW_LINE>writeValue = implicitStoreConvert(graph, elementKind, value);<NEW_LINE>}<NEW_LINE>AbstractWriteNode memoryWrite = createMemWriteNode(elementKind, writeValue, array, address, graph, storeIndexed);<NEW_LINE>memoryWrite.setStateAfter(storeIndexed.stateAfter());<NEW_LINE>graph.replaceFixedWithFixed(storeIndexed, memoryWrite);<NEW_LINE>} | elementKind, storeIndexed.index()); |
1,225,114 | private static Map<String, String> exportMetadata(VolumeManager fs, ServerContext context, TableId tableID, ZipOutputStream zipOut, DataOutputStream dataOut) throws IOException, TableNotFoundException {<NEW_LINE>zipOut.putNextEntry(new ZipEntry(Constants.EXPORT_METADATA_FILE));<NEW_LINE>Map<String, String> uniqueFiles = new HashMap<>();<NEW_LINE>Scanner metaScanner = context.createScanner(MetadataTable.NAME, Authorizations.EMPTY);<NEW_LINE>metaScanner.fetchColumnFamily(DataFileColumnFamily.NAME);<NEW_LINE><MASK><NEW_LINE>ServerColumnFamily.TIME_COLUMN.fetch(metaScanner);<NEW_LINE>metaScanner.setRange(new KeyExtent(tableID, null, null).toMetaRange());<NEW_LINE>for (Entry<Key, Value> entry : metaScanner) {<NEW_LINE>entry.getKey().write(dataOut);<NEW_LINE>entry.getValue().write(dataOut);<NEW_LINE>if (entry.getKey().getColumnFamily().equals(DataFileColumnFamily.NAME)) {<NEW_LINE>String path = TabletFileUtil.validate(entry.getKey().getColumnQualifierData().toString());<NEW_LINE>String[] tokens = path.split("/");<NEW_LINE>if (tokens.length < 1) {<NEW_LINE>throw new RuntimeException("Illegal path " + path);<NEW_LINE>}<NEW_LINE>String filename = tokens[tokens.length - 1];<NEW_LINE>String existingPath = uniqueFiles.get(filename);<NEW_LINE>if (existingPath == null) {<NEW_LINE>uniqueFiles.put(filename, path);<NEW_LINE>} else if (!existingPath.equals(path)) {<NEW_LINE>// make sure file names are unique, should only apply for tables with file names generated<NEW_LINE>// by Accumulo 1.3 and earlier<NEW_LINE>throw new IOException("Cannot export table with nonunique file names " + filename + ". Major compact table.");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return uniqueFiles;<NEW_LINE>} | TabletColumnFamily.PREV_ROW_COLUMN.fetch(metaScanner); |
1,523,197 | private static DruidExpression literalToDruidExpression(final PlannerContext plannerContext, final RexNode rexNode) {<NEW_LINE>final SqlTypeName sqlTypeName = rexNode.getType().getSqlTypeName();<NEW_LINE>// Translate literal.<NEW_LINE>final ColumnType columnType = Calcites.getColumnTypeForRelDataType(rexNode.getType());<NEW_LINE>if (RexLiteral.isNullLiteral(rexNode)) {<NEW_LINE>return DruidExpression.ofLiteral(columnType, DruidExpression.nullLiteral());<NEW_LINE>} else if (SqlTypeName.NUMERIC_TYPES.contains(sqlTypeName)) {<NEW_LINE>return DruidExpression.ofLiteral(columnType, DruidExpression.numberLiteral((Number) RexLiteral.value(rexNode)));<NEW_LINE>} else if (SqlTypeFamily.INTERVAL_DAY_TIME == sqlTypeName.getFamily()) {<NEW_LINE>// Calcite represents DAY-TIME intervals in milliseconds.<NEW_LINE>final long milliseconds = ((Number) RexLiteral.value(rexNode)).longValue();<NEW_LINE>return DruidExpression.ofLiteral(columnType, DruidExpression.numberLiteral(milliseconds));<NEW_LINE>} else if (SqlTypeFamily.INTERVAL_YEAR_MONTH == sqlTypeName.getFamily()) {<NEW_LINE>// Calcite represents YEAR-MONTH intervals in months.<NEW_LINE>final long months = ((Number) RexLiteral.value(rexNode)).longValue();<NEW_LINE>return DruidExpression.ofLiteral(columnType, DruidExpression.numberLiteral(months));<NEW_LINE>} else if (SqlTypeName.STRING_TYPES.contains(sqlTypeName)) {<NEW_LINE>return DruidExpression.ofStringLiteral<MASK><NEW_LINE>} else if (SqlTypeName.TIMESTAMP == sqlTypeName || SqlTypeName.DATE == sqlTypeName) {<NEW_LINE>if (RexLiteral.isNullLiteral(rexNode)) {<NEW_LINE>return DruidExpression.ofLiteral(columnType, DruidExpression.nullLiteral());<NEW_LINE>} else {<NEW_LINE>return DruidExpression.ofLiteral(columnType, DruidExpression.numberLiteral(Calcites.calciteDateTimeLiteralToJoda(rexNode, plannerContext.getTimeZone()).getMillis()));<NEW_LINE>}<NEW_LINE>} else if (SqlTypeName.BOOLEAN == sqlTypeName) {<NEW_LINE>return DruidExpression.ofLiteral(columnType, DruidExpression.numberLiteral(RexLiteral.booleanValue(rexNode) ? 1 : 0));<NEW_LINE>} else {<NEW_LINE>// Can't translate other literals.<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} | (RexLiteral.stringValue(rexNode)); |
96,031 | private void addDecoratedMethods(Map<MethodKey, DecorationInfo> decoratedMethods, ClassInfo classInfo, ClassInfo originalClassInfo, List<DecoratorInfo> boundDecorators, SubclassSkipPredicate skipPredicate) {<NEW_LINE>skipPredicate.startProcessing(classInfo, originalClassInfo);<NEW_LINE>for (MethodInfo method : classInfo.methods()) {<NEW_LINE>if (skipPredicate.test(method)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>List<DecoratorInfo> <MASK><NEW_LINE>if (!matching.isEmpty()) {<NEW_LINE>decoratedMethods.computeIfAbsent(new MethodKey(method), key -> new DecorationInfo(matching));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>skipPredicate.methodsProcessed();<NEW_LINE>if (!classInfo.superName().equals(DotNames.OBJECT)) {<NEW_LINE>ClassInfo superClassInfo = getClassByName(beanDeployment.getBeanArchiveIndex(), classInfo.superName());<NEW_LINE>if (superClassInfo != null) {<NEW_LINE>addDecoratedMethods(decoratedMethods, superClassInfo, originalClassInfo, boundDecorators, skipPredicate);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | matching = findMatchingDecorators(method, boundDecorators); |
1,020,390 | public LdcInsnAST visit(int lineNo, String line) throws ASTParseException {<NEW_LINE>try {<NEW_LINE>String trim = line.trim();<NEW_LINE>int ti = line.indexOf(trim);<NEW_LINE>int space = line.indexOf(' ');<NEW_LINE>String opS = trim.substring(0, space);<NEW_LINE>// op<NEW_LINE>OpcodeParser opParser = new OpcodeParser();<NEW_LINE>opParser.setOffset(line.indexOf(opS));<NEW_LINE>OpcodeAST op = opParser.visit(lineNo, opS);<NEW_LINE>// content<NEW_LINE>String content = trim.substring(space + 1);<NEW_LINE>AST ast = null;<NEW_LINE>if (content.contains("\"")) {<NEW_LINE>// String<NEW_LINE>StringParser parser = new StringParser();<NEW_LINE>parser.setOffset(ti + space + 1);<NEW_LINE>ast = parser.visit(lineNo, content);<NEW_LINE>} else if (content.contains("H_") && content.contains("]")) {<NEW_LINE>// Handle<NEW_LINE>HandleParser parser = new HandleParser();<NEW_LINE>parser.setOffset(ti + space + 1);<NEW_LINE>ast = parser.visit(lineNo, content.substring(content.indexOf('[') + 1, content.lastIndexOf(']')));<NEW_LINE>} else if (content.startsWith("(") || content.contains("[") || content.contains(";")) {<NEW_LINE>// Type<NEW_LINE>DescParser parser = new DescParser();<NEW_LINE>parser.setOffset(ti + space + 1);<NEW_LINE>ast = parser.visit(lineNo, content);<NEW_LINE>} else if (content.matches("-?(?:(?:Infinity|NaN)|-?(?:\\d+\\.\\d+))[Ff]") || content.matches("-?[\\d.]+[eE](?:-?\\d+)?[Ff]")) {<NEW_LINE>// Float<NEW_LINE>FloatParser parser = new FloatParser();<NEW_LINE>parser.setOffset(ti + space + 1);<NEW_LINE>ast = parser.visit(lineNo, content);<NEW_LINE>} else if (content.matches("-?\\d+[LlJj]")) {<NEW_LINE>// Long<NEW_LINE>LongParser parser = new LongParser();<NEW_LINE>parser.setOffset(ti + space + 1);<NEW_LINE>ast = <MASK><NEW_LINE>} else if (content.matches("-?(?:Infinity|NaN)|-?(?:\\d+\\.\\d+[Dd]?)") || content.matches("-?[\\d.]+[eE](?:-?\\d+)?[dD]?")) {<NEW_LINE>// Double<NEW_LINE>DoubleParser parser = new DoubleParser();<NEW_LINE>parser.setOffset(ti + space + 1);<NEW_LINE>ast = parser.visit(lineNo, content);<NEW_LINE>} else {<NEW_LINE>// Integer<NEW_LINE>IntParser parser = new IntParser();<NEW_LINE>parser.setOffset(ti + space + 1);<NEW_LINE>ast = parser.visit(lineNo, content);<NEW_LINE>}<NEW_LINE>return new LdcInsnAST(lineNo, ti, op, ast);<NEW_LINE>} catch (Exception ex) {<NEW_LINE>throw new ASTParseException(ex, lineNo, "Bad format for LDC");<NEW_LINE>}<NEW_LINE>} | parser.visit(lineNo, content); |
884,464 | public static FaceletTagLibrary create(ExternalContext externalContext, URL url) throws IOException {<NEW_LINE>InputStream is = null;<NEW_LINE>FaceletTagLibrary t = null;<NEW_LINE>URLConnection conn = null;<NEW_LINE>try {<NEW_LINE>boolean schemaValidating = false;<NEW_LINE>// validate XML<NEW_LINE>if (MyfacesConfig.getCurrentInstance(externalContext).isValidateXML()) {<NEW_LINE>String version = ConfigFilesXmlValidationUtils.getFaceletTagLibVersion(url);<NEW_LINE>schemaValidating = "2.0".equals(version);<NEW_LINE>if (schemaValidating) {<NEW_LINE>ConfigFilesXmlValidationUtils.validateFaceletTagLibFile(url, externalContext, version);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// parse file<NEW_LINE>LibraryHandler handler = new LibraryHandler(url);<NEW_LINE>SAXParser parser = createSAXParser(handler, externalContext, schemaValidating);<NEW_LINE>conn = url.openConnection();<NEW_LINE>conn.setUseCaches(false);<NEW_LINE>is = conn.getInputStream();<NEW_LINE>parser.parse(is, handler);<NEW_LINE>t = handler.getLibrary();<NEW_LINE>} catch (SAXException e) {<NEW_LINE>IOException ioe = new <MASK><NEW_LINE>ioe.initCause(e);<NEW_LINE>throw ioe;<NEW_LINE>} catch (ParserConfigurationException e) {<NEW_LINE>IOException ioe = new IOException("Error parsing [" + url + "]: ");<NEW_LINE>ioe.initCause(e);<NEW_LINE>throw ioe;<NEW_LINE>} finally {<NEW_LINE>if (is != null) {<NEW_LINE>is.close();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return t;<NEW_LINE>} | IOException("Error parsing [" + url + "]: "); |
1,180,903 | private static void addDataFilesFromFolder(File folder, StringBuilder itemPath, List<DataFile> dataFiles) {<NEW_LINE>File[] files = folder.listFiles();<NEW_LINE>if (files == null || files.length == 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int folderPathLength = itemPath.length();<NEW_LINE>if (folderPathLength > 0) {<NEW_LINE>// The item path must use the ICU file separator character,<NEW_LINE>// not the platform-dependent File.separatorChar,<NEW_LINE>// so that the enumerated item paths match the paths requested by ICU code.<NEW_LINE>itemPath.append('/');<NEW_LINE>++folderPathLength;<NEW_LINE>}<NEW_LINE>for (File file : files) {<NEW_LINE><MASK><NEW_LINE>if (fileName.endsWith(".txt")) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>itemPath.append(fileName);<NEW_LINE>if (file.isDirectory()) {<NEW_LINE>// TODO: Within a folder, put all single files before all .dat packages?<NEW_LINE>addDataFilesFromFolder(file, itemPath, dataFiles);<NEW_LINE>} else if (fileName.endsWith(".dat")) {<NEW_LINE>ByteBuffer pkgBytes = mapFile(file);<NEW_LINE>if (pkgBytes != null && DatPackageReader.validate(pkgBytes)) {<NEW_LINE>dataFiles.add(new PackageDataFile(itemPath.toString(), pkgBytes));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>dataFiles.add(new SingleDataFile(itemPath.toString(), file));<NEW_LINE>}<NEW_LINE>itemPath.setLength(folderPathLength);<NEW_LINE>}<NEW_LINE>} | String fileName = file.getName(); |
1,106,937 | private void parseHeaders(String headers) {<NEW_LINE>int index = 0;<NEW_LINE>List<String> keys = new ArrayList<>();<NEW_LINE>List<String> values = new ArrayList<>();<NEW_LINE>responseHeaders = new HashMap<>();<NEW_LINE>headerFields = new HashMap<>();<NEW_LINE>while (index < headers.length()) {<NEW_LINE>int next = <MASK><NEW_LINE>if (next < 0) {<NEW_LINE>next = headers.length();<NEW_LINE>}<NEW_LINE>int colon = headers.indexOf(':', index);<NEW_LINE>if (colon < 0) {<NEW_LINE>colon = headers.length();<NEW_LINE>}<NEW_LINE>String key = colon < next ? headers.substring(index, colon) : headers.substring(index, next);<NEW_LINE>String value = colon < next ? headers.substring(colon + 1, next).trim() : "";<NEW_LINE>key = key.trim();<NEW_LINE>keys.add(key);<NEW_LINE>values.add(value);<NEW_LINE>List<String> headerFieldValues = headerFields.get(key);<NEW_LINE>if (headerFieldValues == null) {<NEW_LINE>headerFieldValues = new ArrayList<>();<NEW_LINE>headerFields.put(key, headerFieldValues);<NEW_LINE>}<NEW_LINE>headerFieldValues.add(value);<NEW_LINE>key = key.toLowerCase();<NEW_LINE>responseHeaders.put(key, value);<NEW_LINE>index = next + 2;<NEW_LINE>}<NEW_LINE>responseHeaderKeys = keys.toArray(new String[keys.size()]);<NEW_LINE>responseHeaderValues = values.toArray(new String[values.size()]);<NEW_LINE>} | headers.indexOf("\r\n", index); |
543,806 | public boolean onCreateOptionsMenu(final Menu menu) {<NEW_LINE>super.onCreateOptionsMenu(menu);<NEW_LINE>menu.findItem(R.id.menu_image).setVisible(cache.supportsLogImages());<NEW_LINE>menu.findItem(R.id<MASK><NEW_LINE>menu.findItem(R.id.clear).setVisible(true);<NEW_LINE>menu.findItem(R.id.menu_sort_trackables_by).setVisible(true);<NEW_LINE>switch(Settings.getTrackableComparator()) {<NEW_LINE>case TRACKABLE_COMPARATOR_NAME:<NEW_LINE>menu.findItem(R.id.menu_sort_trackables_name).setChecked(true);<NEW_LINE>break;<NEW_LINE>case TRACKABLE_COMPARATOR_TRACKCODE:<NEW_LINE>menu.findItem(R.id.menu_sort_trackables_code).setChecked(true);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>menu.findItem(R.id.menu_sort_trackables_name).setChecked(true);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | .save).setVisible(true); |
521,730 | private Collection<? extends TripToTripTransfer<T>> findStandardTransfers(TripStopTime<T> from) {<NEW_LINE>final List<TripToTripTransfer<T>> result = new ArrayList<>();<NEW_LINE>Iterator<? extends RaptorTransfer> transfers = stdTransfers.getTransfersFromStop(from.stop());<NEW_LINE>while (transfers.hasNext()) {<NEW_LINE>var it = transfers.next();<NEW_LINE>int toStop = it.stop();<NEW_LINE>ConstrainedTransfer tx = transferServiceAdaptor.findTransfer(from, toTrip, toStop);<NEW_LINE>if (tx != null && tx.getTransferConstraint().isNotAllowed()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>int earliestDepartureTime = earliestDepartureTime(from.time(), it.durationInSeconds(), tx);<NEW_LINE>int toTripStopPos = toTrip.findDepartureStopPosition(earliestDepartureTime, toStop);<NEW_LINE>if (toTripStopPos < 0) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>var to = TripStopTime.departure(toTrip, toTripStopPos);<NEW_LINE>boolean boardingPossible = to.trip().pattern().boardingPossibleAt(to.stopPosition());<NEW_LINE>if (boardingPossible) {<NEW_LINE>result.add(new TripToTripTransfer<>(from<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | , to, it, tx)); |
206,313 | private ClassTree addPostMethod(MimeType mime, String type, WorkingCopy copy, ClassTree tree) {<NEW_LINE>Modifier[] modifiers = Constants.PUBLIC;<NEW_LINE>String[] annotations = new String[] { RestConstants.POST_ANNOTATION, RestConstants.CONSUME_MIME_ANNOTATION, RestConstants.PRODUCE_MIME_ANNOTATION };<NEW_LINE>ExpressionTree mimeTree = mime.expressionTree(copy.getTreeMaker());<NEW_LINE>Object[] annotationAttrs = new Object[] { null, mimeTree, mimeTree };<NEW_LINE>// NOI18N<NEW_LINE>String bodyText = "{ //TODO\n return Response.created(context.getAbsolutePath()).build(); }";<NEW_LINE>String[] parameters = getPostPutParams();<NEW_LINE>Object[] paramTypes = getPostPutParamTypes(type);<NEW_LINE>if (type != null) {<NEW_LINE>paramTypes[paramTypes.length - 1] = type;<NEW_LINE>}<NEW_LINE>String[] paramAnnotations = getParamAnnotations(parameters.length);<NEW_LINE>Object[] paramAnnotationAttrs = getParamAnnotationAttributes(parameters.length);<NEW_LINE>GenericResourceBean subBean = getSubresourceBean();<NEW_LINE><MASK><NEW_LINE>comment.append(subBean == null ? bean.getName() : subBean.getName());<NEW_LINE>comment.append("\n");<NEW_LINE>for (int i = 0; i < parameters.length - 1; i++) {<NEW_LINE>comment.append("@param ");<NEW_LINE>comment.append(parameters[i]);<NEW_LINE>comment.append(" resource URI parameter\n");<NEW_LINE>}<NEW_LINE>comment.append("@param ");<NEW_LINE>comment.append(parameters[parameters.length - 1]);<NEW_LINE>comment.append(" representation for the new resource\n");<NEW_LINE>comment.append("@return an HTTP response with content of the created resource");<NEW_LINE>return JavaSourceHelper.addMethod(copy, tree, modifiers, annotations, annotationAttrs, getMethodName(HttpMethodType.POST, mime), RestConstants.HTTP_RESPONSE, parameters, paramTypes, paramAnnotations, paramAnnotationAttrs, bodyText, comment.toString());<NEW_LINE>} | StringBuilder comment = new StringBuilder("POST method for creating an instance of "); |
1,341,139 | private Mono<Response<Flux<ByteBuffer>>> createOrUpdateWithResponseAsync(String resourceGroupName, String loadBalancerName, LoadBalancerInner parameters, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (loadBalancerName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (parameters == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));<NEW_LINE>} else {<NEW_LINE>parameters.validate();<NEW_LINE>}<NEW_LINE>final String apiVersion = "2021-05-01";<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = <MASK><NEW_LINE>return service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, loadBalancerName, apiVersion, this.client.getSubscriptionId(), parameters, accept, context);<NEW_LINE>} | this.client.mergeContext(context); |
792,727 | private HttpMediaType fromString(String combinedType) {<NEW_LINE>Matcher matcher = FULL_MEDIA_TYPE_REGEX.matcher(combinedType);<NEW_LINE>Preconditions.checkArgument(matcher.matches(), "Type must be in the 'maintype/subtype; parameter=value' format");<NEW_LINE>setType(matcher.group(1));<NEW_LINE>setSubType(matcher.group(2));<NEW_LINE>String params = matcher.group(3);<NEW_LINE>if (params != null) {<NEW_LINE>matcher = PARAMETER_REGEX.matcher(params);<NEW_LINE>while (matcher.find()) {<NEW_LINE>// 1=key, 2=valueWithQuotes, 3=valueWithoutQuotes<NEW_LINE>String <MASK><NEW_LINE>String value = matcher.group(3);<NEW_LINE>if (value == null) {<NEW_LINE>value = matcher.group(2);<NEW_LINE>}<NEW_LINE>setParameter(key, value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return this;<NEW_LINE>} | key = matcher.group(1); |
1,200,767 | protected void encodeControls(FacesContext context, OrderList ol) throws IOException {<NEW_LINE><MASK><NEW_LINE>writer.startElement("div", null);<NEW_LINE>writer.writeAttribute("class", OrderList.CONTROLS_CLASS, null);<NEW_LINE>encodeButton(context, ol.getMoveUpLabel(), OrderList.MOVE_UP_BUTTON_CLASS, OrderList.MOVE_UP_BUTTON_ICON_CLASS);<NEW_LINE>encodeButton(context, ol.getMoveTopLabel(), OrderList.MOVE_TOP_BUTTON_CLASS, OrderList.MOVE_TOP_BUTTON_ICON_CLASS);<NEW_LINE>encodeButton(context, ol.getMoveDownLabel(), OrderList.MOVE_DOWN_BUTTON_CLASS, OrderList.MOVE_DOWN_BUTTON_ICON_CLASS);<NEW_LINE>encodeButton(context, ol.getMoveBottomLabel(), OrderList.MOVE_BOTTOM_BUTTON_CLASS, OrderList.MOVE_BOTTOM_BUTTON_ICON_CLASS);<NEW_LINE>writer.endElement("div");<NEW_LINE>} | ResponseWriter writer = context.getResponseWriter(); |
1,525,161 | public byte[] transform(String name, String transformedName, byte[] basicClass) {<NEW_LINE>if (basicClass == null)<NEW_LINE>return null;<NEW_LINE>// Ignore the state tracker itself<NEW_LINE>if (name.equals(GLStateTracker_CLASS))<NEW_LINE>return basicClass;<NEW_LINE>ClassReader reader = new ClassReader(basicClass);<NEW_LINE>Set<Method> eligibleMethods = findEligibleMethods(reader);<NEW_LINE>if (eligibleMethods.isEmpty()) {<NEW_LINE>return basicClass;<NEW_LINE>}<NEW_LINE>ClassWriter writer <MASK><NEW_LINE>reader.accept(new ClassVisitor(Opcodes.ASM5, writer) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {<NEW_LINE>MethodVisitor mv = super.visitMethod(access, name, desc, signature, exceptions);<NEW_LINE>if (!eligibleMethods.contains(new Method(name, desc))) {<NEW_LINE>return mv;<NEW_LINE>}<NEW_LINE>return new MethodVisitor(Opcodes.ASM5, mv) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void visitMethodInsn(int opcode, String owner, String name, String desc, boolean itf) {<NEW_LINE>if (owner.equals(GL11)) {<NEW_LINE>if (name.equals(glEnable)) {<NEW_LINE>owner = GLStateTracker;<NEW_LINE>name = hook_glEnable;<NEW_LINE>} else if (name.equals(glDisable)) {<NEW_LINE>owner = GLStateTracker;<NEW_LINE>name = hook_glDisable;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>super.visitMethodInsn(opcode, owner, name, desc, itf);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}<NEW_LINE>}, 0);<NEW_LINE>return writer.toByteArray();<NEW_LINE>} | = new ClassWriter(reader, 0); |
1,737,327 | public void run(ApplicationArguments applicationArguments) throws Exception {<NEW_LINE>String[] templates = { "Up and running with %s", "%s Basics", "%s for Beginners", "%s for Neckbeards", "Under the hood: %s", "Discovering %s", "A short guide to %s", "%s with Baeldung" };<NEW_LINE>String[] buzzWords = { "Spring REST Data", "Java 9", "Scala", "Groovy", "Hibernate", "Spring HATEOS", "The HAL Browser", "Spring webflux" };<NEW_LINE>String[] authorFirstName = { "John %s", "Steve %s", "Samantha %s", "Gale %s", "Tom %s" };<NEW_LINE>String[] authorLastName = { "Giles", "Gill", "Smith", "Armstrong" };<NEW_LINE>String[] blurbs = { "It was getting dark when the %s %s", "Scott was nearly there when he heard that a %s %s", "Diana was a lovable Java coder until the %s %s", "The gripping story of a small %s and the day it %s" };<NEW_LINE>String[] blublMiddles = { "distaster", "dog", "cat", "turtle", "hurricane" };<NEW_LINE>String[] end = { "hit the school", "memorised pi to 100 decimal places!", "became a world champion armwrestler", "became a Java REST master!!" };<NEW_LINE>Random random = new Random();<NEW_LINE>IntStream.range(0, 100).forEach(i -> {<NEW_LINE>String template = templates[i % templates.length];<NEW_LINE>String buzzword = buzzWords[i % buzzWords.length];<NEW_LINE>String blurbStart = blurbs[i % blurbs.length];<NEW_LINE>String middle = blublMiddles[i % blublMiddles.length];<NEW_LINE>String ending = end[i % end.length];<NEW_LINE>String blurb = String.format(blurbStart, middle, ending);<NEW_LINE>String firstName = authorFirstName[i % authorFirstName.length];<NEW_LINE>String lastname = authorLastName[i % authorLastName.length];<NEW_LINE>Book book = new Book(String.format(template, buzzword), String.format(firstName, lastname), blurb, random.nextInt<MASK><NEW_LINE>bookRepository.save(book);<NEW_LINE>System.out.println(book);<NEW_LINE>});<NEW_LINE>} | (1000 - 200) + 200); |
756,269 | void open() throws MessagingException {<NEW_LINE>try {<NEW_LINE>SocketAddress socketAddress = new InetSocketAddress(settings.getHost(), settings.getPort());<NEW_LINE>if (settings.getConnectionSecurity() == ConnectionSecurity.SSL_TLS_REQUIRED) {<NEW_LINE>socket = trustedSocketFactory.createSocket(null, settings.getHost(), settings.getPort(), settings.getClientCertificateAlias());<NEW_LINE>} else {<NEW_LINE>socket = new Socket();<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>in = new BufferedInputStream(socket.getInputStream(), 1024);<NEW_LINE>out = new BufferedOutputStream(socket.getOutputStream(), 512);<NEW_LINE>socket.setSoTimeout(SOCKET_READ_TIMEOUT);<NEW_LINE>if (!isOpen()) {<NEW_LINE>throw new MessagingException("Unable to connect socket");<NEW_LINE>}<NEW_LINE>String serverGreeting = executeSimpleCommand(null);<NEW_LINE>capabilities = getCapabilities();<NEW_LINE>if (settings.getConnectionSecurity() == ConnectionSecurity.STARTTLS_REQUIRED) {<NEW_LINE>performStartTlsUpgrade(trustedSocketFactory, settings.getHost(), settings.getPort(), settings.getClientCertificateAlias());<NEW_LINE>}<NEW_LINE>performAuthentication(settings.getAuthType(), serverGreeting);<NEW_LINE>} catch (SSLException e) {<NEW_LINE>if (e.getCause() instanceof CertificateException) {<NEW_LINE>throw new CertificateValidationException(e.getMessage(), e);<NEW_LINE>} else {<NEW_LINE>throw new MessagingException("Unable to connect", e);<NEW_LINE>}<NEW_LINE>} catch (GeneralSecurityException gse) {<NEW_LINE>throw new MessagingException("Unable to open connection to POP server due to security error.", gse);<NEW_LINE>} catch (IOException ioe) {<NEW_LINE>throw new MessagingException("Unable to open connection to POP server.", ioe);<NEW_LINE>}<NEW_LINE>} | socket.connect(socketAddress, SOCKET_CONNECT_TIMEOUT); |
1,090,273 | public void execute() {<NEW_LINE>String mysqlShowTableCol = "Tables_in_" + phyShardingNode.getDatabase();<NEW_LINE>String[] mysqlShowTableCols = new String[] { mysqlShowTableCol };<NEW_LINE>PhysicalDbInstance tds = phyShardingNode.getDbGroup().getWriteDbInstance();<NEW_LINE>PhysicalDbInstance ds = null;<NEW_LINE>if (tds != null) {<NEW_LINE>if (tds.isTestConnSuccess()) {<NEW_LINE>ds = tds;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (ds != null) {<NEW_LINE>MultiRowSQLQueryResultHandler resultHandler = new MultiRowSQLQueryResultHandler(mysqlShowTableCols, new MySQLShowTablesListener(mysqlShowTableCol));<NEW_LINE>SpecialSqlJob sqlJob = new SpecialSqlJob(SQL, phyShardingNode.getDatabase(<MASK><NEW_LINE>sqlJob.run();<NEW_LINE>} else {<NEW_LINE>list.add(new ErrorInfo("Backend", "WARNING", "shardingNode[" + phyShardingNode.getName() + "] has no available primary dbinstance,The table in this shardingNode has not checked"));<NEW_LINE>handleFinished();<NEW_LINE>}<NEW_LINE>} | ), resultHandler, ds, list); |
276,636 | public IPath[] enclosingProjectsAndJars() {<NEW_LINE>IPath[] result = this.enclosingPaths;<NEW_LINE>if (result != null) {<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>long start = BasicSearchEngine.VERBOSE ? System.currentTimeMillis() : -1;<NEW_LINE>try {<NEW_LINE>IJavaProject[] projects = JavaModelManager.getJavaModelManager().getJavaModel().getJavaProjects();<NEW_LINE>// use a linked set to preserve the order during search: see bug 348507<NEW_LINE>Set<IPath> paths = new LinkedHashSet<>(projects.length * 2);<NEW_LINE>for (int i = 0, length = projects.length; i < length; i++) {<NEW_LINE>JavaProject javaProject = (JavaProject) projects[i];<NEW_LINE>// Add project full path<NEW_LINE>IPath projectPath = javaProject.getProject().getFullPath();<NEW_LINE>paths.add(projectPath);<NEW_LINE>}<NEW_LINE>// add the project source paths first in a separate loop above<NEW_LINE>// to ensure source files always get higher precedence during search.<NEW_LINE>// see bug 348507<NEW_LINE>for (int i = 0, length = projects.length; i < length; i++) {<NEW_LINE>JavaProject javaProject = (JavaProject) projects[i];<NEW_LINE>// Add project libraries paths<NEW_LINE>IClasspathEntry[] entries = javaProject.getResolvedClasspath();<NEW_LINE>for (int j = 0, eLength = entries.length; j < eLength; j++) {<NEW_LINE>IClasspathEntry entry = entries[j];<NEW_LINE>if (entry.getEntryKind() == IClasspathEntry.CPE_LIBRARY) {<NEW_LINE>IPath path = entry.getPath();<NEW_LINE>Object target = JavaModel.getTarget(path, false);<NEW_LINE>if (// case of an external folder<NEW_LINE>target instanceof IFolder)<NEW_LINE>path = ((IFolder) target).getFullPath();<NEW_LINE>paths.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>result = new IPath[paths.size()];<NEW_LINE>paths.toArray(result);<NEW_LINE>return this.enclosingPaths = result;<NEW_LINE>} catch (JavaModelException e) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>Util.log(e, "Exception while computing workspace scope's enclosing projects and jars");<NEW_LINE>return new IPath[0];<NEW_LINE>} finally {<NEW_LINE>if (BasicSearchEngine.VERBOSE) {<NEW_LINE>long time = System.currentTimeMillis() - start;<NEW_LINE>int length = result == null ? 0 : result.length;<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$<NEW_LINE>Util.verbose("JavaWorkspaceScope.enclosingProjectsAndJars: " + length + " paths computed in " + time + "ms.");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | add(entry.getPath()); |
745,339 | public void createVerticalChain(int topId, int topSide, int bottomId, int bottomSide, int[] chainIds, float[] weights, int style) {<NEW_LINE>if (chainIds.length < 2) {<NEW_LINE>throw new IllegalArgumentException("must have 2 or more widgets in a chain");<NEW_LINE>}<NEW_LINE>if (weights != null && weights.length != chainIds.length) {<NEW_LINE>throw new IllegalArgumentException("must have 2 or more widgets in a chain");<NEW_LINE>}<NEW_LINE>if (weights != null) {<NEW_LINE>get(chainIds[0]).layout.verticalWeight = weights[0];<NEW_LINE>}<NEW_LINE>get(chainIds[0]).layout.verticalChainStyle = style;<NEW_LINE>connect(chainIds[0], TOP, topId, topSide, 0);<NEW_LINE>for (int i = 1; i < chainIds.length; i++) {<NEW_LINE>int chainId = chainIds[i];<NEW_LINE>connect(chainIds[i], TOP, chainIds[i <MASK><NEW_LINE>connect(chainIds[i - 1], BOTTOM, chainIds[i], TOP, 0);<NEW_LINE>if (weights != null) {<NEW_LINE>get(chainIds[i]).layout.verticalWeight = weights[i];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>connect(chainIds[chainIds.length - 1], BOTTOM, bottomId, bottomSide, 0);<NEW_LINE>} | - 1], BOTTOM, 0); |
15,250 | public <T> T run(Function<? super BuildTreeLifecycleController, T> buildAction) {<NEW_LINE>StartParameterInternal startParameter = buildDefinition.getStartParameter();<NEW_LINE>BuildRequestMetaData buildRequestMetaData = new <MASK><NEW_LINE>BuildSessionState session = new BuildSessionState(userHomeDirServiceRegistry, crossBuildSessionState, startParameter, buildRequestMetaData, ClassPath.EMPTY, buildCancellationToken, buildRequestMetaData.getClient(), new NoOpBuildEventConsumer());<NEW_LINE>try {<NEW_LINE>session.getServices().get(BuildLayoutValidator.class).validate(startParameter);<NEW_LINE>BuildTreeModelControllerServices.Supplier modelServices = session.getServices().get(BuildTreeModelControllerServices.class).servicesForNestedBuildTree(startParameter);<NEW_LINE>BuildTreeState buildTree = new BuildTreeState(session.getServices(), modelServices);<NEW_LINE>try {<NEW_LINE>RootOfNestedBuildTree rootBuild = new RootOfNestedBuildTree(buildDefinition, buildIdentifier, identityPath, owner, buildTree);<NEW_LINE>rootBuild.attach();<NEW_LINE>return rootBuild.run(buildAction);<NEW_LINE>} finally {<NEW_LINE>buildTree.close();<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>session.close();<NEW_LINE>}<NEW_LINE>} | DefaultBuildRequestMetaData(Time.currentTimeMillis()); |
477,394 | public static List<Region> find(int strictness, boolean findAll, RobotBase robot, Mat source, Mat target, boolean resize) {<NEW_LINE>List<Region> found = new ArrayList();<NEW_LINE>collect(strictness, found, findAll, <MASK><NEW_LINE>if (!found.isEmpty()) {<NEW_LINE>return found;<NEW_LINE>}<NEW_LINE>int stepUp = collect(strictness, found, findAll, robot, source, target, 1.1);<NEW_LINE>if (!found.isEmpty()) {<NEW_LINE>return found;<NEW_LINE>}<NEW_LINE>int stepDown = collect(strictness, found, findAll, robot, source, target, 0.9);<NEW_LINE>if (!found.isEmpty()) {<NEW_LINE>return found;<NEW_LINE>}<NEW_LINE>boolean goUpFirst = stepUp < stepDown;<NEW_LINE>for (int step = 2; step < 6; step++) {<NEW_LINE>double scale = 1 + 0.1 * step * (goUpFirst ? 1 : -1);<NEW_LINE>collect(strictness, found, findAll, robot, source, target, scale);<NEW_LINE>}<NEW_LINE>if (!findAll && !found.isEmpty()) {<NEW_LINE>return found;<NEW_LINE>}<NEW_LINE>for (int step = 2; step < 6; step++) {<NEW_LINE>double scale = 1 + 0.1 * step * (goUpFirst ? -1 : 1);<NEW_LINE>collect(strictness, found, findAll, robot, source, target, scale);<NEW_LINE>}<NEW_LINE>return found;<NEW_LINE>} | robot, source, target, 1); |
1,020,908 | public void recoverUserName(RecoverUserNameRequest body) throws ApiException {<NEW_LINE>Object localVarPostBody = body;<NEW_LINE>// verify the required parameter 'body' is set<NEW_LINE>if (body == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'body' when calling recoverUserName");<NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/v4/auth/recover_username";<NEW_LINE>// query params<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final <MASK><NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>final String[] localVarContentTypes = { "application/json" };<NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>String[] localVarAuthNames = new String[] {};<NEW_LINE>apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);<NEW_LINE>} | String[] localVarAccepts = { "application/json" }; |
1,056,185 | private HttpClient createHttpClient(boolean isSecure, boolean isHostnameVerification, SSLSocketFactory sslSocketFactory, boolean addBasicAuthHeader, BasicCredentialsProvider credentialsProvider, boolean useSystemPropertiesForHttpClientConnections) {<NEW_LINE>HttpClient client = null;<NEW_LINE>if (isSecure) {<NEW_LINE>ClassLoader origCL = ThreadContextHelper.getContextClassLoader();<NEW_LINE>ThreadContextHelper.setClassLoader(getClass().getClassLoader());<NEW_LINE>try {<NEW_LINE>SSLConnectionSocketFactory connectionFactory = null;<NEW_LINE>if (!isHostnameVerification) {<NEW_LINE>connectionFactory = new SSLConnectionSocketFactory<MASK><NEW_LINE>} else {<NEW_LINE>connectionFactory = new SSLConnectionSocketFactory(sslSocketFactory, new DefaultHostnameVerifier());<NEW_LINE>}<NEW_LINE>if (addBasicAuthHeader) {<NEW_LINE>client = getBuilder(useSystemPropertiesForHttpClientConnections).setDefaultCredentialsProvider(credentialsProvider).setSSLSocketFactory(connectionFactory).build();<NEW_LINE>} else {<NEW_LINE>client = getBuilder(useSystemPropertiesForHttpClientConnections).setSSLSocketFactory(connectionFactory).build();<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>ThreadContextHelper.setClassLoader(origCL);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (addBasicAuthHeader) {<NEW_LINE>client = getBuilder(useSystemPropertiesForHttpClientConnections).setDefaultCredentialsProvider(credentialsProvider).build();<NEW_LINE>} else {<NEW_LINE>client = getBuilder(useSystemPropertiesForHttpClientConnections).build();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return client;<NEW_LINE>} | (sslSocketFactory, new NoopHostnameVerifier()); |
282,172 | private void toSlime(ApplicationVersion applicationVersion, Cursor object) {<NEW_LINE>applicationVersion.buildNumber().ifPresent(number -> object.setLong(applicationBuildNumberField, number));<NEW_LINE>applicationVersion.source().ifPresent(source -> toSlime(source, object.setObject(sourceRevisionField)));<NEW_LINE>applicationVersion.authorEmail().ifPresent(email -> object.setString(authorEmailField, email));<NEW_LINE>applicationVersion.compileVersion().ifPresent(version -> object.setString(compileVersionField, version.toString()));<NEW_LINE>applicationVersion.buildTime().ifPresent(time -> object.setLong(buildTimeField, time.toEpochMilli()));<NEW_LINE>applicationVersion.sourceUrl().ifPresent(url -> object.setString(sourceUrlField, url));<NEW_LINE>applicationVersion.commit().ifPresent(commit -> object<MASK><NEW_LINE>object.setBool(deployedDirectlyField, applicationVersion.isDeployedDirectly());<NEW_LINE>applicationVersion.bundleHash().ifPresent(bundleHash -> object.setString(bundleHashField, bundleHash));<NEW_LINE>} | .setString(commitField, commit)); |
1,378,990 | private static void validateConditionConnections(ModuleTypeRegistry mtRegistry, @NonNull Condition condition, @NonNull List<? extends @NonNull Trigger> triggers) {<NEW_LINE>// get module type of the condition<NEW_LINE>ConditionType type = (ConditionType) mtRegistry.get(condition.getTypeUID());<NEW_LINE>if (type == null) {<NEW_LINE>// if module type not exists in the system - throws exception<NEW_LINE>throw new IllegalArgumentException("Condition Type \"" + condition.getTypeUID() + "\" does not exist!");<NEW_LINE>}<NEW_LINE>// get inputs of the condition according to module type definition<NEW_LINE>List<Input> inputs = type.getInputs();<NEW_LINE>// gets connected inputs from the condition module and put them into map<NEW_LINE>Set<Connection> cons = getConnections(condition.getInputs());<NEW_LINE>Map<String, Connection> connectionsMap = new HashMap<>();<NEW_LINE>Iterator<Connection> connectionsI = cons.iterator();<NEW_LINE>while (connectionsI.hasNext()) {<NEW_LINE>Connection connection = connectionsI.next();<NEW_LINE>String inputName = connection.getInputName();<NEW_LINE>connectionsMap.put(inputName, connection);<NEW_LINE>}<NEW_LINE>// checks is there unconnected required inputs<NEW_LINE>if (inputs != null && !inputs.isEmpty()) {<NEW_LINE>for (Input input : inputs) {<NEW_LINE><MASK><NEW_LINE>Connection connection = connectionsMap.get(name);<NEW_LINE>if (connection != null) {<NEW_LINE>checkConnection(mtRegistry, connection, input, triggers);<NEW_LINE>} else if (input.isRequired()) {<NEW_LINE>throw new IllegalArgumentException("Required input \"" + name + "\" of the condition \"" + condition.getId() + "\" not connected");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | String name = input.getName(); |
1,565,916 | private static void addInstrumentedFiles(StructImpl insStruct, RuleContext ruleContext, RuleConfiguredTargetBuilder builder) throws EvalException {<NEW_LINE>List<String> extensions = null;<NEW_LINE>if (insStruct.getFieldNames().contains("extensions")) {<NEW_LINE>extensions = Sequence.cast(insStruct.getValue("extensions"), String.class, "extensions");<NEW_LINE>}<NEW_LINE>List<String> dependencyAttributes = Collections.emptyList();<NEW_LINE>if (insStruct.getFieldNames().contains("dependency_attributes")) {<NEW_LINE>dependencyAttributes = Sequence.cast(insStruct.getValue("dependency_attributes"), String.class, "dependency_attributes");<NEW_LINE>}<NEW_LINE>List<String<MASK><NEW_LINE>if (insStruct.getFieldNames().contains("source_attributes")) {<NEW_LINE>sourceAttributes = Sequence.cast(insStruct.getValue("source_attributes"), String.class, "source_attributes");<NEW_LINE>}<NEW_LINE>InstrumentedFilesInfo instrumentedFilesProvider = CoverageCommon.createInstrumentedFilesInfo(ruleContext, sourceAttributes, dependencyAttributes, extensions);<NEW_LINE>builder.addNativeDeclaredProvider(instrumentedFilesProvider);<NEW_LINE>} | > sourceAttributes = Collections.emptyList(); |
1,728,917 | private static LoggingStrategy createLoggingStrategy(final AnnotationNode logAnnotation, final ClassLoader classLoader, final ClassLoader xformLoader) {<NEW_LINE>String annotationName = logAnnotation.getClassNode().getName();<NEW_LINE>Class<?> annotationClass;<NEW_LINE>try {<NEW_LINE>annotationClass = Class.forName(annotationName, false, xformLoader);<NEW_LINE>} catch (Throwable t) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>Method annotationMethod;<NEW_LINE>try {<NEW_LINE>annotationMethod = annotationClass.getDeclaredMethod("loggingStrategy", (Class[]) null);<NEW_LINE>} catch (Throwable t) {<NEW_LINE>throw new RuntimeException("Could not find method named loggingStrategy on class named " + annotationName);<NEW_LINE>}<NEW_LINE>Object defaultValue;<NEW_LINE>try {<NEW_LINE>defaultValue = annotationMethod.getDefaultValue();<NEW_LINE>} catch (Throwable t) {<NEW_LINE>throw new RuntimeException("Could not find default value of method named loggingStrategy on class named " + annotationName);<NEW_LINE>}<NEW_LINE>if (!LoggingStrategy.class.isAssignableFrom((Class<?>) defaultValue) && !LoggingStrategyV2.class.isAssignableFrom((Class<?>) defaultValue)) {<NEW_LINE>throw new RuntimeException("Default loggingStrategy value on class named " + annotationName + " is not a LoggingStrategy");<NEW_LINE>}<NEW_LINE>// try configurable logging strategy<NEW_LINE>try {<NEW_LINE>Class<? extends LoggingStrategyV2> strategyClass = (Class<? extends LoggingStrategyV2>) defaultValue;<NEW_LINE>if (AbstractLoggingStrategy.class.isAssignableFrom(strategyClass)) {<NEW_LINE>return DefaultGroovyMethods.newInstance(strategyClass, new Object[] { classLoader });<NEW_LINE>} else {<NEW_LINE>return strategyClass.getDeclaredConstructor().newInstance();<NEW_LINE>}<NEW_LINE>} catch (Exception ignore) {<NEW_LINE>}<NEW_LINE>// try legacy logging strategy<NEW_LINE>try {<NEW_LINE>Class<? extends LoggingStrategy> strategyClass = (Class<? extends LoggingStrategy>) defaultValue;<NEW_LINE>if (AbstractLoggingStrategy.class.isAssignableFrom(strategyClass)) {<NEW_LINE>return DefaultGroovyMethods.newInstance(strategyClass, new Object[] { classLoader });<NEW_LINE>} else {<NEW_LINE>return strategyClass.getDeclaredConstructor().newInstance();<NEW_LINE>}<NEW_LINE>} catch (Exception ignore) {<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | throw new RuntimeException("Could not resolve class named " + annotationName); |
266,649 | static Version of(Stream<String> lines) {<NEW_LINE>final Iterator<String> it = lines.iterator();<NEW_LINE>while (it.hasNext()) {<NEW_LINE>final String line = it.next();<NEW_LINE>final Matcher matcher = PATTERN.matcher(line);<NEW_LINE>if (matcher.find()) {<NEW_LINE>// GraalVM/Mandrel:<NEW_LINE>final String version = matcher.group("version");<NEW_LINE>final String distro = matcher.group("distro");<NEW_LINE>// JDK:<NEW_LINE>// e.g. JDK 17.0.1, feature: 17, interim: 0 (not used here), update: 1<NEW_LINE>final String jFeatureMatch = matcher.group("jfeature");<NEW_LINE>final // Old GraalVM versions, like 19, didn't report the Java version.<NEW_LINE>int // Old GraalVM versions, like 19, didn't report the Java version.<NEW_LINE>jFeature = jFeatureMatch == null ? 11 : Integer.parseInt(jFeatureMatch);<NEW_LINE>final String <MASK><NEW_LINE>final // Some JDK dev builds don't report full version string.<NEW_LINE>int // Some JDK dev builds don't report full version string.<NEW_LINE>jUpdate = jUpdateMatch == null ? UNDEFINED : Integer.parseInt(jUpdateMatch);<NEW_LINE>return new Version(line, version, jFeature, jUpdate, isMandrel(distro) ? Distribution.MANDREL : Distribution.ORACLE);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return UNVERSIONED;<NEW_LINE>} | jUpdateMatch = matcher.group("jupdate"); |
1,114,383 | private Message<?> convertPayloadIfNecessary(Message<?> message) {<NEW_LINE>if (this.datatypes.length > 0) {<NEW_LINE>// first pass checks if the payload type already matches any of the datatypes<NEW_LINE>for (Class<?> datatype : this.datatypes) {<NEW_LINE>if (datatype.isAssignableFrom(message.getPayload().getClass())) {<NEW_LINE>return message;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (this.messageConverter != null) {<NEW_LINE>// second pass applies conversion if possible, attempting datatypes in order<NEW_LINE>for (Class<?> datatype : this.datatypes) {<NEW_LINE>Object converted = this.<MASK><NEW_LINE>if (converted != null) {<NEW_LINE>if (converted instanceof Message) {<NEW_LINE>return (Message<?>) converted;<NEW_LINE>} else {<NEW_LINE>return getMessageBuilderFactory().withPayload(converted).copyHeaders(message.getHeaders()).build();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>throw new MessageDeliveryException(message, "Channel '" + getComponentName() + "' expected one of the following data types [" + StringUtils.arrayToCommaDelimitedString(this.datatypes) + "], but received [" + message.getPayload().getClass() + "]");<NEW_LINE>} else {<NEW_LINE>return message;<NEW_LINE>}<NEW_LINE>} | messageConverter.fromMessage(message, datatype); |
1,629,708 | // updateData<NEW_LINE>public WindowTabDataDocument readData(ModelCRUDRequestDocument req) throws XFireFault {<NEW_LINE>WindowTabDataDocument ret <MASK><NEW_LINE>WindowTabData resp = ret.addNewWindowTabData();<NEW_LINE>ModelCRUD modelCRUD = req.getModelCRUDRequest().getModelCRUD();<NEW_LINE>String serviceType = modelCRUD.getServiceType();<NEW_LINE>int cnt = 0;<NEW_LINE>ADLoginRequest reqlogin = req.getModelCRUDRequest().getADLoginRequest();<NEW_LINE>String err = modelLogin(reqlogin, webServiceName, "readData", serviceType);<NEW_LINE>if (err != null && err.length() > 0) {<NEW_LINE>resp.setError(err);<NEW_LINE>return ret;<NEW_LINE>}<NEW_LINE>// Validate parameters vs service type<NEW_LINE>validateCRUD(modelCRUD);<NEW_LINE>Properties ctx = m_cs.getM_ctx();<NEW_LINE>String tableName = modelCRUD.getTableName();<NEW_LINE>int recordID = modelCRUD.getRecordID();<NEW_LINE>// get the PO for the tablename and record ID<NEW_LINE>MTable table = MTable.get(ctx, tableName);<NEW_LINE>if (table == null)<NEW_LINE>throw new XFireFault("Web service type " + m_webservicetype.getValue() + ": table " + tableName + " not found", new QName("readData"));<NEW_LINE>PO po = table.getPO(recordID, null);<NEW_LINE>if (po == null) {<NEW_LINE>resp.setSuccess(false);<NEW_LINE>resp.setRowCount(cnt);<NEW_LINE>resp.setNumRows(cnt);<NEW_LINE>resp.setTotalRows(cnt);<NEW_LINE>resp.setStartRow(0);<NEW_LINE>return ret;<NEW_LINE>}<NEW_LINE>cnt = 1;<NEW_LINE>POInfo poinfo = POInfo.getPOInfo(ctx, table.getAD_Table_ID());<NEW_LINE>DataSet ds = resp.addNewDataSet();<NEW_LINE>DataRow dr = ds.addNewDataRow();<NEW_LINE>for (int i = 0; i < poinfo.getColumnCount(); i++) {<NEW_LINE>String columnName = poinfo.getColumnName(i);<NEW_LINE>if (m_webservicetype.isOutputColumnNameAllowed(columnName)) {<NEW_LINE>DataField dfid = dr.addNewField();<NEW_LINE>dfid.setColumn(columnName);<NEW_LINE>if (po.get_Value(i) != null)<NEW_LINE>dfid.setVal(po.get_Value(i).toString());<NEW_LINE>else<NEW_LINE>dfid.setVal(null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>resp.setSuccess(true);<NEW_LINE>resp.setRowCount(cnt);<NEW_LINE>resp.setNumRows(cnt);<NEW_LINE>resp.setTotalRows(cnt);<NEW_LINE>resp.setStartRow(1);<NEW_LINE>return ret;<NEW_LINE>} | = WindowTabDataDocument.Factory.newInstance(); |
753,955 | protected SdkFileEntry generateModelHeaderFile(ServiceModel serviceModel, Map.Entry<String, Shape> shapeEntry) throws Exception {<NEW_LINE>Shape shape = shapeEntry.getValue();<NEW_LINE>if (!(shape.isRequest() || shape.isEnum() || shape.hasEventPayloadMembers() && shape.hasBlobMembers())) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Template template = null;<NEW_LINE>VelocityContext context = createContext(serviceModel);<NEW_LINE>if (shape.isRequest()) {<NEW_LINE>template = velocityEngine.getTemplate("/com/amazonaws/util/awsclientgenerator/velocity/cpp/RequestHeader.vm", StandardCharsets.UTF_8.name());<NEW_LINE>for (Map.Entry<String, Operation> opEntry : serviceModel.getOperations().entrySet()) {<NEW_LINE>String key = opEntry.getKey();<NEW_LINE>Operation op = opEntry.getValue();<NEW_LINE>if (op.getRequest() != null && op.getRequest().getShape().getName() == shape.getName()) {<NEW_LINE>context.put("operation", op);<NEW_LINE>context.put("operationName", key);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (shape.isEnum()) {<NEW_LINE>template = velocityEngine.getTemplate("/com/amazonaws/util/awsclientgenerator/velocity/cpp/ModelEnumHeader.vm", StandardCharsets.UTF_8.name());<NEW_LINE>EnumModel enumModel = new EnumModel(serviceModel.getMetadata().getNamespace(), shapeEntry.getKey(), shape.getEnumValues());<NEW_LINE>context.put("enumModel", enumModel);<NEW_LINE>} else if (shape.isEvent() && shape.getEventPayloadType().equals("blob")) {<NEW_LINE>template = velocityEngine.getTemplate("/com/amazonaws/util/awsclientgenerator/velocity/cpp/EventHeader.vm", <MASK><NEW_LINE>shape.getMembers().entrySet().stream().filter(memberEntry -> memberEntry.getKey().equals(shape.getEventPayloadMemberName())).forEach(blobMemberEntry -> context.put("blobMember", blobMemberEntry));<NEW_LINE>}<NEW_LINE>context.put("shape", shape);<NEW_LINE>context.put("typeInfo", new CppShapeInformation(shape, serviceModel));<NEW_LINE>context.put("CppViewHelper", CppViewHelper.class);<NEW_LINE>String fileName = String.format("include/aws/%s/model/%s.h", serviceModel.getMetadata().getProjectName(), shapeEntry.getKey());<NEW_LINE>return makeFile(template, context, fileName, true);<NEW_LINE>} | StandardCharsets.UTF_8.name()); |
1,358,081 | public void processElement(ProcessContext c) throws Exception {<NEW_LINE>ReadableFile file = c.element();<NEW_LINE>InputStream stream = Channels.newInputStream(file.open());<NEW_LINE>try (InputStream tikaStream = TikaInputStream.get(stream)) {<NEW_LINE>Parser parser = tikaConfig == null ? new AutoDetectParser() : new AutoDetectParser(tikaConfig);<NEW_LINE>ParseContext context = new ParseContext();<NEW_LINE>context.set(Parser.class, parser);<NEW_LINE>Metadata tikaMetadata = spec.getInputMetadata() != null ? spec.getInputMetadata() : new Metadata();<NEW_LINE>if (spec.getContentTypeHint() != null) {<NEW_LINE>tikaMetadata.set(Metadata.<MASK><NEW_LINE>}<NEW_LINE>String location = file.getMetadata().resourceId().toString();<NEW_LINE>ParseResult res;<NEW_LINE>ContentHandler tikaHandler = new ToTextContentHandler();<NEW_LINE>try {<NEW_LINE>parser.parse(tikaStream, tikaHandler, tikaMetadata, context);<NEW_LINE>res = ParseResult.success(location, tikaHandler.toString(), tikaMetadata);<NEW_LINE>} catch (Exception e) {<NEW_LINE>res = ParseResult.failure(location, tikaHandler.toString(), tikaMetadata, e);<NEW_LINE>}<NEW_LINE>c.output(res);<NEW_LINE>}<NEW_LINE>} | CONTENT_TYPE, spec.getContentTypeHint()); |
1,177,684 | protected synchronized void ensureSvg(JasperReportsContext jasperReportsContext) throws JRException {<NEW_LINE>if (rootNode != null) {<NEW_LINE>// already loaded<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ensureData(jasperReportsContext);<NEW_LINE>try {<NEW_LINE>UserAgent userAgent = new BatikUserAgent(jasperReportsContext);<NEW_LINE>SVGDocumentFactory documentFactory = new SAXSVGDocumentFactory(userAgent.getXMLParserClassName(), true);<NEW_LINE>documentFactory.<MASK><NEW_LINE>SVGDocument document;<NEW_LINE>if (svgText != null) {<NEW_LINE>document = documentFactory.createSVGDocument(null, new StringReader(svgText));<NEW_LINE>} else {<NEW_LINE>document = documentFactory.createSVGDocument(null, new ByteArrayInputStream(svgData));<NEW_LINE>}<NEW_LINE>BridgeContext ctx = new BridgeContext(userAgent);<NEW_LINE>ctx.setDynamic(true);<NEW_LINE>GVTBuilder builder = new GVTBuilder();<NEW_LINE>rootNode = builder.build(ctx, document);<NEW_LINE>documentSize = ctx.getDocumentSize();<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new JRRuntimeException(e);<NEW_LINE>}<NEW_LINE>} | setValidating(userAgent.isXMLParserValidating()); |
1,131,586 | public vector_tile.VectorTileProto.Tile.Layer buildPartial() {<NEW_LINE>vector_tile.VectorTileProto.Tile.Layer result = new vector_tile.VectorTileProto.Tile.Layer(this);<NEW_LINE>int from_bitField0_ = bitField0_;<NEW_LINE>int to_bitField0_ = 0;<NEW_LINE>if (((from_bitField0_ & 0x00000001) != 0)) {<NEW_LINE>to_bitField0_ |= 0x00000001;<NEW_LINE>}<NEW_LINE>result.version_ = version_;<NEW_LINE>if (((from_bitField0_ & 0x00000002) != 0)) {<NEW_LINE>to_bitField0_ |= 0x00000002;<NEW_LINE>}<NEW_LINE>result.name_ = name_;<NEW_LINE>if (featuresBuilder_ == null) {<NEW_LINE>if (((bitField0_ & 0x00000004) != 0)) {<NEW_LINE>features_ = java.util.Collections.unmodifiableList(features_);<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000004);<NEW_LINE>}<NEW_LINE>result.features_ = features_;<NEW_LINE>} else {<NEW_LINE>result.features_ = featuresBuilder_.build();<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000008) != 0)) {<NEW_LINE>keys_ = keys_.getUnmodifiableView();<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000008);<NEW_LINE>}<NEW_LINE>result.keys_ = keys_;<NEW_LINE>if (valuesBuilder_ == null) {<NEW_LINE>if (((bitField0_ & 0x00000010) != 0)) {<NEW_LINE>values_ = java.util.Collections.unmodifiableList(values_);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>result.values_ = values_;<NEW_LINE>} else {<NEW_LINE>result.values_ = valuesBuilder_.build();<NEW_LINE>}<NEW_LINE>if (((from_bitField0_ & 0x00000020) != 0)) {<NEW_LINE>to_bitField0_ |= 0x00000004;<NEW_LINE>}<NEW_LINE>result.extent_ = extent_;<NEW_LINE>result.bitField0_ = to_bitField0_;<NEW_LINE>onBuilt();<NEW_LINE>return result;<NEW_LINE>} | bitField0_ = (bitField0_ & ~0x00000010); |
1,595,192 | private DocLine[] loadLines(MOrder order) {<NEW_LINE>ArrayList<DocLine> list = new ArrayList<DocLine>();<NEW_LINE>MOrderLine[] lines = order.getLines();<NEW_LINE>for (int i = 0; i < lines.length; i++) {<NEW_LINE>MOrderLine line = lines[i];<NEW_LINE>DocLine docLine = new DocLine(line, this);<NEW_LINE>BigDecimal Qty = line.getQtyOrdered();<NEW_LINE>docLine.setQty(Qty, order.isSOTrx());<NEW_LINE>//<NEW_LINE>BigDecimal priceCost = null;<NEW_LINE>if (// PO<NEW_LINE>getDocumentType().equals(DOCTYPE_POrder))<NEW_LINE>priceCost = line.getPriceCost();<NEW_LINE>BigDecimal LineNetAmt = null;<NEW_LINE>if (priceCost != null && priceCost.signum() != 0)<NEW_LINE><MASK><NEW_LINE>else<NEW_LINE>LineNetAmt = line.getLineNetAmt();<NEW_LINE>// DR<NEW_LINE>docLine.setAmount(LineNetAmt);<NEW_LINE>BigDecimal PriceList = line.getPriceList();<NEW_LINE>int C_Tax_ID = docLine.getC_Tax_ID();<NEW_LINE>// Correct included Tax<NEW_LINE>if (isTaxIncluded() && C_Tax_ID != 0) {<NEW_LINE>MTax tax = MTax.get(getCtx(), C_Tax_ID);<NEW_LINE>if (!tax.isZeroTax()) {<NEW_LINE>BigDecimal LineNetAmtTax = tax.calculateTax(LineNetAmt, true, getStdPrecision());<NEW_LINE>log.fine("LineNetAmt=" + LineNetAmt + " - Tax=" + LineNetAmtTax);<NEW_LINE>LineNetAmt = LineNetAmt.subtract(LineNetAmtTax);<NEW_LINE>for (int t = 0; t < m_taxes.length; t++) {<NEW_LINE>if (m_taxes[t].getC_Tax_ID() == C_Tax_ID) {<NEW_LINE>m_taxes[t].addIncludedTax(LineNetAmtTax);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>BigDecimal PriceListTax = tax.calculateTax(PriceList, true, getStdPrecision());<NEW_LINE>PriceList = PriceList.subtract(PriceListTax);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// correct included Tax<NEW_LINE>docLine.setAmount(LineNetAmt, PriceList, Qty);<NEW_LINE>list.add(docLine);<NEW_LINE>}<NEW_LINE>// Return Array<NEW_LINE>DocLine[] dl = new DocLine[list.size()];<NEW_LINE>list.toArray(dl);<NEW_LINE>return dl;<NEW_LINE>} | LineNetAmt = Qty.multiply(priceCost); |
897,716 | public String amt(final Properties ctx, final int WindowNo, final GridTab mTab, final GridField mField, final Object value) {<NEW_LINE>if (isCalloutActive() || value == null) {<NEW_LINE>return "";<NEW_LINE>}<NEW_LINE>// temporary<NEW_LINE>final int StdPrecision = 2;<NEW_LINE>// get values<NEW_LINE>BigDecimal QtyEntered = (BigDecimal) mTab.getValue("QtyEntered");<NEW_LINE>BigDecimal PriceEntered = (BigDecimal) mTab.getValue("PriceEntered");<NEW_LINE>log.debug("QtyEntered=" + QtyEntered + ", PriceEntered=" + PriceEntered);<NEW_LINE>if (QtyEntered == null) {<NEW_LINE>QtyEntered = Env.ZERO;<NEW_LINE>}<NEW_LINE>if (PriceEntered == null) {<NEW_LINE>PriceEntered = Env.ZERO;<NEW_LINE>}<NEW_LINE>// Line Net Amt<NEW_LINE>BigDecimal LineNetAmt = QtyEntered.multiply(PriceEntered);<NEW_LINE>if (LineNetAmt.scale() > StdPrecision) {<NEW_LINE>LineNetAmt = LineNetAmt.setScale(StdPrecision, BigDecimal.ROUND_HALF_UP);<NEW_LINE>}<NEW_LINE>// Calculate Tax Amount<NEW_LINE>final boolean IsSOTrx = "Y".equals(Env.getContext(Env.getCtx(), WindowNo, "IsSOTrx"));<NEW_LINE>final boolean IsTaxIncluded = "Y".equals(Env.getContext(Env.getCtx(), WindowNo, "IsTaxIncluded"));<NEW_LINE>BigDecimal TaxAmt = null;<NEW_LINE>if (mField.getColumnName().equals("TaxAmt")) {<NEW_LINE>TaxAmt = (BigDecimal) mTab.getValue("TaxAmt");<NEW_LINE>} else {<NEW_LINE>final Integer taxID = (<MASK><NEW_LINE>if (taxID != null) {<NEW_LINE>final int C_Tax_ID = taxID.intValue();<NEW_LINE>final MTax tax = new MTax(ctx, C_Tax_ID, null);<NEW_LINE>TaxAmt = tax.calculateTax(LineNetAmt, IsTaxIncluded, StdPrecision);<NEW_LINE>mTab.setValue("TaxAmt", TaxAmt);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>//<NEW_LINE>if (IsTaxIncluded) {<NEW_LINE>mTab.setValue("LineTotalAmt", LineNetAmt);<NEW_LINE>mTab.setValue("LineNetAmt", LineNetAmt.subtract(TaxAmt));<NEW_LINE>} else {<NEW_LINE>mTab.setValue("LineNetAmt", LineNetAmt);<NEW_LINE>mTab.setValue("LineTotalAmt", LineNetAmt.add(TaxAmt));<NEW_LINE>}<NEW_LINE>return "";<NEW_LINE>} | Integer) mTab.getValue("C_Tax_ID"); |
488,321 | public void visit(ClassDeclaration node) {<NEW_LINE>String name = node.getName().getName();<NEW_LINE>ClassElementAttribute ce = (ClassElementAttribute) global.enterWrite(name, Kind.CLASS, node);<NEW_LINE>node2Element.put(node, ce);<NEW_LINE>Identifier superClsName = (node.getSuperClass() != null) ? CodeUtils.extractUnqualifiedIdentifier(node.getSuperClass()) : null;<NEW_LINE>if (superClsName != null) {<NEW_LINE>ce.superClass = (ClassElementAttribute) lookup(superClsName.getName(), Kind.CLASS);<NEW_LINE>}<NEW_LINE>List<Expression> interfaes = node.getInterfaes();<NEW_LINE>for (Expression identifier : interfaes) {<NEW_LINE>ClassElementAttribute iface = (ClassElementAttribute) lookup(CodeUtils.extractUnqualifiedName(identifier), Kind.IFACE);<NEW_LINE>ce.ifaces.add(iface);<NEW_LINE>node2Element.put(identifier, iface);<NEW_LINE>}<NEW_LINE>scopes.push(ce.enclosedElements);<NEW_LINE>if (node.getBody() != null) {<NEW_LINE>performEnterPass(ce.enclosedElements, node.<MASK><NEW_LINE>}<NEW_LINE>super.visit(node);<NEW_LINE>scopes.pop();<NEW_LINE>} | getBody().getStatements()); |
398,314 | private boolean isNeedRun() {<NEW_LINE>List<String> ignoreAgentPortModule <MASK><NEW_LINE>ignoreAgentPortModule.add("imagestorebackupstorage.py");<NEW_LINE>if (isFullDeploy()) {<NEW_LINE>logger.debug("Ansible.fullDeploy is set, run ansible anyway");<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (ansibleNeedRun != null) {<NEW_LINE>return ansibleNeedRun.isRunNeed();<NEW_LINE>}<NEW_LINE>boolean changed = asf.isModuleChanged(playBookName);<NEW_LINE>if (changed) {<NEW_LINE>logger.debug(String.format("ansible module[%s] changed, run ansible", playBookName));<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (agentPort != 0) {<NEW_LINE>boolean opened = NetworkUtils.isRemotePortOpen(targetIp, agentPort, (int) TimeUnit.SECONDS.toMillis(5));<NEW_LINE>if (!opened) {<NEW_LINE>logger.debug(String.format("agent port[%s] on target ip[%s] is not opened, run ansible[%s]", agentPort, targetIp, playBookName));<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (runChecker()) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>logger.debug(String.format("agent port[%s] on target ip[%s] is opened, ansible module[%s] is not changed, skip to run ansible", agentPort, targetIp, playBookName));<NEW_LINE>return false;<NEW_LINE>} else if (ignoreAgentPortModule.contains(playBookName)) {<NEW_LINE>logger.debug(String.format("module %s will not check agent port, only check md5sum", playBookName));<NEW_LINE>if (runChecker()) {<NEW_LINE>logger.debug(String.format("module %s md5sum changed, run ansible", playBookName));<NEW_LINE>return true;<NEW_LINE>} else {<NEW_LINE>logger.debug(String.format("module %s md5sum not change, skip to run ansible", playBookName));<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>logger.debug("agent port is not set, run ansible anyway");<NEW_LINE>return true;<NEW_LINE>} | = new ArrayList<String>(); |
1,117,875 | public int indexOfIgnoreCase(String subString, int start) {<NEW_LINE>if (start < 0) {<NEW_LINE>start = 0;<NEW_LINE>}<NEW_LINE>int subCount = subString.length();<NEW_LINE>if (subCount == 0)<NEW_LINE>return start < length || start == 0 ? start : length;<NEW_LINE>int maxIndex = length - subCount;<NEW_LINE>if (start > maxIndex)<NEW_LINE>return -1;<NEW_LINE>char firstUpper = Character.toUpperCase(subString.charAt(0));<NEW_LINE>char firstLower = Character.toLowerCase(firstUpper);<NEW_LINE>while (true) {<NEW_LINE>int i = start;<NEW_LINE>boolean found = false;<NEW_LINE>for (; i <= maxIndex; i++) {<NEW_LINE>char c = chars[i];<NEW_LINE>if (c == firstUpper || c == firstLower) {<NEW_LINE>found = true;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!found)<NEW_LINE>return -1;<NEW_LINE><MASK><NEW_LINE>while (++o2 < subCount) {<NEW_LINE>char c = chars[++o1];<NEW_LINE>char upper = Character.toUpperCase(subString.charAt(o2));<NEW_LINE>if (c != upper && c != Character.toLowerCase(upper))<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (o2 == subCount)<NEW_LINE>return i;<NEW_LINE>start = i + 1;<NEW_LINE>}<NEW_LINE>} | int o1 = i, o2 = 0; |
1,780,827 | public void parse(BpmnParse bpmnParse, BaseElement element) {<NEW_LINE>ActivityImpl activity = bpmnParse.getCurrentScope().findActivity(element.getId());<NEW_LINE>if (element instanceof BoundaryEvent) {<NEW_LINE>// A boundary-event never receives an activity start-event<NEW_LINE>activity.addExecutionListener(org.activiti.engine.impl.pvm.PvmEvent.EVENTNAME_END, ACTIVITY_INSTANCE_START_LISTENER, 0);<NEW_LINE>activity.addExecutionListener(org.activiti.engine.impl.pvm.<MASK><NEW_LINE>} else {<NEW_LINE>activity.addExecutionListener(org.activiti.engine.impl.pvm.PvmEvent.EVENTNAME_START, ACTIVITY_INSTANCE_START_LISTENER, 0);<NEW_LINE>activity.addExecutionListener(org.activiti.engine.impl.pvm.PvmEvent.EVENTNAME_END, ACTIVITI_INSTANCE_END_LISTENER);<NEW_LINE>}<NEW_LINE>} | PvmEvent.EVENTNAME_END, ACTIVITI_INSTANCE_END_LISTENER, 1); |
713,724 | private static void writeGarbageCollectionStats(PrintStream out, boolean verbose, boolean pretty) {<NEW_LINE>List<GarbageCollectorMXBean> gcBeans = ManagementFactory.getGarbageCollectorMXBeans();<NEW_LINE>if (verbose) {<NEW_LINE>if (pretty) {<NEW_LINE>out.println("\nGarbage collection stats");<NEW_LINE>for (GarbageCollectorMXBean gcBean : gcBeans) {<NEW_LINE>out.println("\tCollector " + gcBean.getName());<NEW_LINE>out.format("\t\tcollection count : %d\n", gcBean.getCollectionCount());<NEW_LINE>out.format("\t\tcollection time : %d ms\n", gcBean.getCollectionTime());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>for (GarbageCollectorMXBean gcBean : gcBeans) {<NEW_LINE>String name = normalizeName(gcBean.getName());<NEW_LINE>out.println(normalizeTabularColonPos(String.format("gc-" + name + "-collection-count : %d", gcBean.getCollectionCount())));<NEW_LINE>out.println(normalizeTabularColonPos(String.format("gc-" + name + "-collection-time-ms : %d", <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>long collectionCount = 0;<NEW_LINE>long collectionTime = 0;<NEW_LINE>int collectorCount = gcBeans.size();<NEW_LINE>for (GarbageCollectorMXBean gcBean : gcBeans) {<NEW_LINE>collectionCount += gcBean.getCollectionCount();<NEW_LINE>collectionTime += gcBean.getCollectionTime();<NEW_LINE>}<NEW_LINE>if (pretty) {<NEW_LINE>out.println("\nGarbage collection stats");<NEW_LINE>out.format("\tAggregate of %d collectors\n", collectorCount);<NEW_LINE>out.format("\t\tcollection count : %d\n", collectionCount);<NEW_LINE>out.format("\t\tcollection time : %d ms\n", collectionTime);<NEW_LINE>} else {<NEW_LINE>String name = normalizeName("aggregate");<NEW_LINE>out.println(normalizeTabularColonPos(String.format("gc-%s-collection-count : %d", name, collectionCount)));<NEW_LINE>out.println(normalizeTabularColonPos(String.format("gc-%s-collection-time-ms : %d", name, collectionTime)));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | gcBean.getCollectionTime()))); |
1,836,795 | final GetExportResult executeGetExport(GetExportRequest getExportRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getExportRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetExportRequest> request = null;<NEW_LINE>Response<GetExportResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetExportRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getExportRequest));<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, "Lex Model Building Service");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetExport");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetExportResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetExportResultJsonUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | invoke(request, responseHandler, executionContext); |
384,899 | public void addBreezemoon(final RequestContext context) {<NEW_LINE><MASK><NEW_LINE>final Request request = context.getRequest();<NEW_LINE>final JSONObject requestJSONObject = context.requestJSON();<NEW_LINE>if (isInvalid(context, requestJSONObject)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final JSONObject breezemoon = new JSONObject();<NEW_LINE>final String breezemoonContent = requestJSONObject.optString(Breezemoon.BREEZEMOON_CONTENT);<NEW_LINE>breezemoon.put(Breezemoon.BREEZEMOON_CONTENT, breezemoonContent);<NEW_LINE>final JSONObject user = Sessions.getUser();<NEW_LINE>final String authorId = user.optString(Keys.OBJECT_ID);<NEW_LINE>breezemoon.put(Breezemoon.BREEZEMOON_AUTHOR_ID, authorId);<NEW_LINE>final String ip = Requests.getRemoteAddr(request);<NEW_LINE>breezemoon.put(Breezemoon.BREEZEMOON_IP, ip);<NEW_LINE>final String ua = Headers.getHeader(request, Common.USER_AGENT, "");<NEW_LINE>breezemoon.put(Breezemoon.BREEZEMOON_UA, ua);<NEW_LINE>final JSONObject address = Geos.getAddress(ip);<NEW_LINE>if (null != address) {<NEW_LINE>breezemoon.put(Breezemoon.BREEZEMOON_CITY, address.optString(Common.CITY));<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>breezemoonMgmtService.addBreezemoon(breezemoon);<NEW_LINE>context.renderJSONValue(Keys.CODE, StatusCodes.SUCC);<NEW_LINE>} catch (final Exception e) {<NEW_LINE>context.renderMsg(e.getMessage());<NEW_LINE>context.renderJSONValue(Keys.CODE, StatusCodes.ERR);<NEW_LINE>}<NEW_LINE>} | context.renderJSON(StatusCodes.ERR); |
1,221,962 | private void createGroupInfoCache() {<NEW_LINE>Map<String, Object> where = new HashMap<String, Object>();<NEW_LINE>where.put("state", 1);<NEW_LINE>Map<String, Object> data = new HashMap<String, Object>();<NEW_LINE>data.put("where", where);<NEW_LINE>String dataStr = JSONHelper.toString(data);<NEW_LINE>Map<String, Object> jsonRequest = new HashMap<String, Object>();<NEW_LINE>jsonRequest.put("type", "query");<NEW_LINE>jsonRequest.put("data", dataStr);<NEW_LINE>HashMap<String, String> dbInfo = new <MASK><NEW_LINE>dbInfo.put("dataStoreName", "AppHub.group");<NEW_LINE>dbInfo.put("conllectionName", "uav_groupinfo");<NEW_LINE>UAVHttpMessage request = new UAVHttpMessage();<NEW_LINE>request.putRequest("mrd.data", JSONHelper.toString(jsonRequest));<NEW_LINE>request.putRequest("datastore.name", dbInfo.get("dataStoreName"));<NEW_LINE>request.putRequest("mgo.coll.name", dbInfo.get("conllectionName"));<NEW_LINE>String jsonStr = JSONHelper.toString(request);<NEW_LINE>byte[] datab = null;<NEW_LINE>try {<NEW_LINE>datab = jsonStr.getBytes("utf-8");<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.err(this, "GUIService createGroupInfoCache \n" + e.getMessage());<NEW_LINE>throw new ApphubException(e);<NEW_LINE>}<NEW_LINE>logger.info(this, "GUIService createGroupInfoCache");<NEW_LINE>GroupCacheCallBack groupCacheCb = new GroupCacheCallBack();<NEW_LINE>doHttpPost("uav.app.manage.apphubmanager.http.addr", "/ah/group", datab, "application/json", "utf-8", groupCacheCb);<NEW_LINE>} | HashMap<String, String>(); |
1,073,037 | public static AsmMetric registerStreamMetric(String name, AsmMetric metric, boolean mergeTopology) {<NEW_LINE>name = fixNameIfPossible(name);<NEW_LINE>LOG.debug("register stream metric:{}", name);<NEW_LINE>AsmMetric ret = streamMetrics.register(name, metric);<NEW_LINE>// ret.setEnabled(enableStreamMetrics);<NEW_LINE>if (metric.isAggregate()) {<NEW_LINE>List<AsmMetric> assocMetrics = new ArrayList<>();<NEW_LINE>// in this step we've normalized metric names which contains "."<NEW_LINE>// e.g., a metric named: 'abc.def' will be normalized to 'def'<NEW_LINE>String taskMetricName = MetricUtils.stream2taskName(name);<NEW_LINE>AsmMetric taskMetric = taskMetrics.register(taskMetricName, metric.clone());<NEW_LINE>assocMetrics.add(taskMetric);<NEW_LINE>String compMetricName = MetricUtils.task2compName(taskMetricName);<NEW_LINE>AsmMetric componentMetric = componentMetrics.register(compMetricName, taskMetric.clone());<NEW_LINE>assocMetrics.add(componentMetric);<NEW_LINE>String compStreamMetricName = MetricUtils.stream2compStreamName(name);<NEW_LINE>AsmMetric componentStreamMetric = compStreamMetrics.register(compStreamMetricName, ret.clone());<NEW_LINE>assocMetrics.add(componentStreamMetric);<NEW_LINE>if (mergeTopology) {<NEW_LINE>String topologyMetricName = MetricUtils.comp2topologyName(compMetricName);<NEW_LINE>AsmMetric topologyMetric = topologyMetrics.register(<MASK><NEW_LINE>assocMetrics.add(topologyMetric);<NEW_LINE>}<NEW_LINE>ret.addAssocMetrics(assocMetrics.toArray(new AsmMetric[assocMetrics.size()]));<NEW_LINE>}<NEW_LINE>return ret;<NEW_LINE>} | topologyMetricName, ret.clone()); |
527,641 | public static void main(String[] args) {<NEW_LINE>// parse the commandline arguments to create the configuration<NEW_LINE>PSymConfiguration config = PSymOptions.ParseCommandlineArgs(args);<NEW_LINE>Reflections reflections = new Reflections("psymbolic");<NEW_LINE>try {<NEW_LINE>// load all the files in the passed jar<NEW_LINE>String jarPath = PSymbolic.class.getProtectionDomain().getCodeSource().getLocation()<MASK><NEW_LINE>LoadAllClassesInJar(jarPath);<NEW_LINE>Set<Class<? extends Program>> subTypes = reflections.getSubTypesOf(Program.class);<NEW_LINE>Optional<Class<? extends Program>> program = subTypes.stream().findFirst();<NEW_LINE>Object instance = program.get().getDeclaredConstructor().newInstance();<NEW_LINE>EntryPoint.run((Program) instance, config);<NEW_LINE>} catch (BugFoundException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>System.exit(2);<NEW_LINE>} catch (Exception ex) {<NEW_LINE>ex.printStackTrace();<NEW_LINE>System.exit(10);<NEW_LINE>}<NEW_LINE>} | .toURI().getPath(); |
627,378 | private int phySegmentFromStream(final String[] values, int index, final OStorageSegmentConfiguration iSegment) {<NEW_LINE>iSegment.location = version > 2 ? read(values[index++]) : null;<NEW_LINE>iSegment.maxSize = read(values[index++]);<NEW_LINE>iSegment.fileType = read(values[index++]);<NEW_LINE>iSegment.fileStartSize = read(values[index++]);<NEW_LINE>iSegment.fileMaxSize = read(values[index++]);<NEW_LINE>iSegment.fileIncrementSize = <MASK><NEW_LINE>iSegment.defrag = read(values[index++]);<NEW_LINE>@SuppressWarnings("ConstantConditions")<NEW_LINE>final int size = Integer.parseInt(read(values[index++]));<NEW_LINE>iSegment.infoFiles = new OStorageFileConfiguration[size];<NEW_LINE>String fileName;<NEW_LINE>for (int i = 0; i < size; ++i) {<NEW_LINE>fileName = read(values[index++]);<NEW_LINE>// noinspection ConstantConditions<NEW_LINE>if (!fileName.contains("$")) {<NEW_LINE>// @COMPATIBILITY 0.9.25<NEW_LINE>int pos = fileName.indexOf("/databases");<NEW_LINE>if (pos > -1) {<NEW_LINE>fileName = "${" + Orient.ORIENTDB_HOME + "}" + fileName.substring(pos);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>iSegment.infoFiles[i] = new OStorageFileConfiguration(iSegment, fileName, read(values[index++]), read(values[index++]), iSegment.fileIncrementSize);<NEW_LINE>}<NEW_LINE>return index;<NEW_LINE>} | read(values[index++]); |
26,330 | final ListVersionsByFunctionResult executeListVersionsByFunction(ListVersionsByFunctionRequest listVersionsByFunctionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listVersionsByFunctionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListVersionsByFunctionRequest> request = null;<NEW_LINE>Response<ListVersionsByFunctionResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListVersionsByFunctionRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listVersionsByFunctionRequest));<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, "Lambda");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListVersionsByFunction");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListVersionsByFunctionResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListVersionsByFunctionResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | endClientExecution(awsRequestMetrics, request, response); |
1,057,016 | protected void buildToString(StringBuilder sb) {<NEW_LINE>if (photometricInterpretation != null) {<NEW_LINE>sb.append(", Photometric Interpretation = ").append(photometricInterpretation);<NEW_LINE>}<NEW_LINE>if (exifOrientation != null) {<NEW_LINE>sb.append(", Exif Orientation = ").append(exifOrientation);<NEW_LINE>}<NEW_LINE>if (originalExifOrientation != null) {<NEW_LINE>sb.append(", Original Exif Orientation = ").append(originalExifOrientation);<NEW_LINE>}<NEW_LINE>if (exifVersion != null) {<NEW_LINE>sb.append(", Exif Version = ").append(exifVersion);<NEW_LINE>}<NEW_LINE>if (exifCompression != null) {<NEW_LINE>sb.append<MASK><NEW_LINE>}<NEW_LINE>if (exifColorSpace != null) {<NEW_LINE>sb.append(", Exif Color Space = ").append(exifColorSpace);<NEW_LINE>}<NEW_LINE>if (hasExifThumbnail != null) {<NEW_LINE>sb.append(", Has Exif Thumbnail = ").append(hasExifThumbnail.booleanValue() ? "True" : "False");<NEW_LINE>}<NEW_LINE>} | (", Exif Compression = ").append(exifCompression); |
65,007 | private String prepareName(String name) {<NEW_LINE>StringBuilder sb = new <MASK><NEW_LINE>Matcher wordCharMatcher = WORD_CHAR.matcher(name);<NEW_LINE>while (wordCharMatcher.find()) {<NEW_LINE>String normalizedToken = toLowerCase(wordCharMatcher.group());<NEW_LINE>String rewrite = rewriteMap.get(normalizedToken);<NEW_LINE>if (rewrite != null)<NEW_LINE>normalizedToken = rewrite;<NEW_LINE>if (normalizedToken.isEmpty())<NEW_LINE>continue;<NEW_LINE>// Ignore matching short phrases like de, la, ... except it is a number<NEW_LINE>if (normalizedToken.length() > 2) {<NEW_LINE>sb.append(normalizedToken);<NEW_LINE>} else {<NEW_LINE>if (Character.isDigit(normalizedToken.charAt(0)) && (normalizedToken.length() == 1 || Character.isDigit(normalizedToken.charAt(1)))) {<NEW_LINE>sb.append(normalizedToken);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return sb.toString();<NEW_LINE>} | StringBuilder(name.length()); |
379,271 | public Object call(ExecutionContext context, Object self, Object... args) {<NEW_LINE>// 15.4.4.4<NEW_LINE>JSObject o = Types.toObject(context, self);<NEW_LINE>DynArray array = new DynArray(context.getGlobalContext());<NEW_LINE>List<Object> items = new ArrayList<>();<NEW_LINE>items.add(o);<NEW_LINE>if (args[0] != Types.UNDEFINED) {<NEW_LINE>for (int i = 0; i < args.length; ++i) {<NEW_LINE>items.add(args[i]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int n = 0;<NEW_LINE>for (Object e : items) {<NEW_LINE>if (e instanceof JSObject && ((JSObject) e).getClassName().equals("Array")) {<NEW_LINE>JSObject jsE = (JSObject) e;<NEW_LINE>long len = Types.toInteger(context, jsE<MASK><NEW_LINE>for (long k = 0; k < len; ++k) {<NEW_LINE>final Object subElement = jsE.get(context, "" + k);<NEW_LINE>array.defineOwnProperty(context, "" + n, PropertyDescriptor.newDataPropertyDescriptor(subElement, true, true, true), false);<NEW_LINE>++n;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>final Object finalE = e;<NEW_LINE>array.defineOwnProperty(context, "" + n, PropertyDescriptor.newDataPropertyDescriptor(finalE, true, true, true), false);<NEW_LINE>++n;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return array;<NEW_LINE>} | .get(context, "length")); |
1,057,091 | protected void projectOpened() {<NEW_LINE>if (WebServicesClientSupport.isBroken(project)) {<NEW_LINE>WebServicesClientSupport.showBrokenAlert(project);<NEW_LINE>}<NEW_LINE>FileObject jaxWsFo = WSUtils.findJaxWsFileObject(project);<NEW_LINE>try {<NEW_LINE>if (jaxWsFo != null && WSUtils.hasClients(jaxWsFo)) {<NEW_LINE>final JAXWSClientSupport jaxWsClientSupport = project.getLookup().lookup(JAXWSClientSupport.class);<NEW_LINE>if (jaxWsClientSupport != null) {<NEW_LINE>FileObject wsdlFolder = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>} catch (IOException ex) {<NEW_LINE>}<NEW_LINE>if (wsdlFolder == null || wsdlFolder.getParent().getFileObject("jax-ws-catalog.xml") == null) {<NEW_LINE>// NOI18N<NEW_LINE>RequestProcessor.getDefault().post(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>try {<NEW_LINE>JaxWsCatalogPanel.generateJaxWsCatalog(project, jaxWsClientSupport);<NEW_LINE>} catch (IOException ex) {<NEW_LINE>Logger.getLogger(JaxWsCatalogPanel.class.getName()).log(Level.WARNING, "Cannot create jax-ws-catalog.xml", ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (IOException ex) {<NEW_LINE>Logger.getLogger(JaxWsCatalogPanel.class.getName()).log(Level.WARNING, "Cannot read nbproject/jax-ws.xml file", ex);<NEW_LINE>}<NEW_LINE>} | wsdlFolder = jaxWsClientSupport.getWsdlFolder(false); |
155,591 | public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {<NEW_LINE>Context context = getContext();<NEW_LINE>assert context != null;<NEW_LINE>SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(context);<NEW_LINE>String profile = sp.getString("profileToEdit", "profileStandard");<NEW_LINE>switch(Objects.requireNonNull(profile)) {<NEW_LINE>case "profileStandard":<NEW_LINE>setPreferencesFromResource(R.xml.preference_profile_standard, rootKey);<NEW_LINE>PreferenceManager.setDefaultValues(context, <MASK><NEW_LINE>break;<NEW_LINE>case "profileTrusted":<NEW_LINE>setPreferencesFromResource(R.xml.preference_profile_trusted, rootKey);<NEW_LINE>PreferenceManager.setDefaultValues(context, R.xml.preference_profile_trusted, false);<NEW_LINE>break;<NEW_LINE>case "profileProtected":<NEW_LINE>setPreferencesFromResource(R.xml.preference_profile_protected, rootKey);<NEW_LINE>PreferenceManager.setDefaultValues(context, R.xml.preference_profile_protected, false);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} | R.xml.preference_profile_standard, false); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.