idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
274,462 | private void normalizeIntensities() {<NEW_LINE>normalizedXIntensities = new float[numberOfSnps];<NEW_LINE>normalizedYIntensities = new float[numberOfSnps];<NEW_LINE>for (int i = 0; i < rawXIntensities.length; i++) {<NEW_LINE><MASK><NEW_LINE>final int rawY = rawYIntensities[i];<NEW_LINE>final int normId;<NEW_LINE>int normIndex = -1;<NEW_LINE>if (allNormalizationIds.length > i) {<NEW_LINE>normId = allNormalizationIds[i];<NEW_LINE>normIndex = getAllNormIndex(normId);<NEW_LINE>}<NEW_LINE>if (normIndex != -1) {<NEW_LINE>final InfiniumTransformation xform = normalizationTransformations[normIndex];<NEW_LINE>final float tempX = rawX - xform.getOffsetX();<NEW_LINE>final float tempY = rawY - xform.getOffsetY();<NEW_LINE>final float theta = xform.getTheta();<NEW_LINE>double tempX2 = Math.cos(theta) * tempX + Math.sin(theta) * tempY;<NEW_LINE>double tempY2 = -Math.sin(theta) * tempX + Math.cos(theta) * tempY;<NEW_LINE>double tempX3 = tempX2 - xform.getShear() * tempY2;<NEW_LINE>if (tempX3 < 0) {<NEW_LINE>tempX3 = 0;<NEW_LINE>}<NEW_LINE>if (tempY2 < 0) {<NEW_LINE>tempY2 = 0;<NEW_LINE>}<NEW_LINE>normalizedXIntensities[i] = (float) (tempX3 / xform.getScaleX());<NEW_LINE>normalizedYIntensities[i] = (float) (tempY2 / xform.getScaleY());<NEW_LINE>} else {<NEW_LINE>normalizedXIntensities[i] = rawXIntensities[i];<NEW_LINE>normalizedYIntensities[i] = rawYIntensities[i];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | final int rawX = rawXIntensities[i]; |
1,253,749 | private boolean prepareDataCell(CrosstabCell data, int column, int availableHeight, int xOffset) throws JRException {<NEW_LINE>int rowY = rowYs.get(rowIdx);<NEW_LINE>JRFillCrosstabCell cell = crossCells[data.getRowTotalGroupIndex()][data.getColumnTotalGroupIndex()];<NEW_LINE>JRFillCellContents contents = cell == null ? null : cell.getFillContents();<NEW_LINE>if (contents == null || contents.getWidth() <= 0 || contents.getHeight() <= 0) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>boolean overflow = availableHeight < rowY + contents.getHeight();<NEW_LINE>if (!overflow) {<NEW_LINE>boolean leftEmpty = startColumnIndex != 0 && !isRepeatRowHeaders();<NEW_LINE>boolean topEmpty = startRowIndex != 0 && !isRepeatColumnHeaders();<NEW_LINE><MASK><NEW_LINE>setGroupVariables(rowGroups, data.getRowBucketValues());<NEW_LINE>setGroupVariables(columnGroups, data.getColumnBucketValues());<NEW_LINE>setMeasureVariables(data);<NEW_LINE>boolean firstOnRow = leftEmpty && column == startColumnIndex;<NEW_LINE>contents = contents.getBoxContents(firstOnRow && getRunDirectionValue() == RunDirectionEnum.LTR, firstOnRow && getRunDirectionValue() == RunDirectionEnum.RTL, topEmpty && rowIdx == 0);<NEW_LINE>contents = contents.getWorkingClone();<NEW_LINE>contents.evaluate(JRExpression.EVALUATION_DEFAULT);<NEW_LINE>contents.prepare(availableHeight - rowY);<NEW_LINE>if (interactive) {<NEW_LINE>contents.setPrintProperty(CrosstabInteractiveJsonHandler.PROPERTY_COLUMN_INDEX, Integer.toString(column));<NEW_LINE>contents.addHtmlClass("jrxtdatacell");<NEW_LINE>}<NEW_LINE>preparedRow.add(contents);<NEW_LINE>overflow = contents.willOverflow();<NEW_LINE>if (!overflow) {<NEW_LINE>contents.setX(columnXOffsets[column] - columnXOffsets[startColumnIndex] + xOffset);<NEW_LINE>contents.setY(rowY + yOffset);<NEW_LINE>// this test is probably not needed, but using it just to be safe<NEW_LINE>int // this test is probably not needed, but using it just to be safe<NEW_LINE>rowCellHeight = contents.isLegacyElementStretchEnabled() ? contents.getPrintHeight() : Math.max(contents.getPrintHeight(), contents.getHeight());<NEW_LINE>if (rowCellHeight > preparedRowHeight) {<NEW_LINE>preparedRowHeight = rowCellHeight;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return overflow;<NEW_LINE>} | setCountVars(rowIdx + startRowIndex, column); |
1,730,080 | public void afterLoadState() {<NEW_LINE>if (myProject.isDefault()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>myCacheRefreshTimer = UIUtil.createNamedTimer("TaskManager refresh", myConfig.updateInterval * 60 * 1000, new ActionListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void actionPerformed(@Nonnull ActionEvent e) {<NEW_LINE>if (myConfig.updateEnabled && !myUpdating) {<NEW_LINE>LOG.debug("Updating issues cache (every " + myConfig.updateInterval + " min)");<NEW_LINE>updateIssues(null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>myCacheRefreshTimer.setInitialDelay(0);<NEW_LINE>myStartupManager.registerPostStartupActivity((ui) -> myCacheRefreshTimer.start());<NEW_LINE>// make sure that the default task is exist<NEW_LINE>LocalTask defaultTask = findTask(LocalTaskImpl.DEFAULT_TASK_ID);<NEW_LINE>if (defaultTask == null) {<NEW_LINE>defaultTask = createDefaultTask();<NEW_LINE>addTask(defaultTask);<NEW_LINE>}<NEW_LINE>// search for active task<NEW_LINE>LocalTask activeTask = null;<NEW_LINE>final List<LocalTask> tasks = getLocalTasks();<NEW_LINE>Collections.sort(tasks, TASK_UPDATE_COMPARATOR);<NEW_LINE>for (LocalTask task : tasks) {<NEW_LINE>if (activeTask == null) {<NEW_LINE>if (task.isActive()) {<NEW_LINE>activeTask = task;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>task.setActive(false);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (activeTask == null) {<NEW_LINE>activeTask = defaultTask;<NEW_LINE>}<NEW_LINE>myActiveTask = activeTask;<NEW_LINE>doActivate(myActiveTask, false);<NEW_LINE>myDispatcher.<MASK><NEW_LINE>} | getMulticaster().taskActivated(myActiveTask); |
22,641 | public static void scale(String userName, String password, String appId, Integer instances) throws SaturnJobConsoleException {<NEW_LINE>JSONObject params = new JSONObject();<NEW_LINE>params.put("instances", instances);<NEW_LINE>String urlStr = SaturnEnvProperties.VIP_SATURN_DCOS_REST_URI + API_VERSION_DES + appId + "?force=true";<NEW_LINE>CloseableHttpClient httpClient = HttpClients.createDefault();<NEW_LINE>try {<NEW_LINE>HttpPut httpPut = new HttpPut(urlStr);<NEW_LINE>httpPut.setHeader(AUTHORIZATION_DES, BASIC_DES + Base64.encodeBase64String((userName + ":" + password).getBytes(UTF8_DES)));<NEW_LINE>httpPut.setHeader("Content-type", "application/json; charset=utf-8");<NEW_LINE>httpPut.setEntity(new StringEntity(params.toJSONString()));<NEW_LINE>CloseableHttpResponse httpResponse = httpClient.execute(httpPut);<NEW_LINE><MASK><NEW_LINE>if (statusLine != null) {<NEW_LINE>int statusCode = statusLine.getStatusCode();<NEW_LINE>String reasonPhrase = statusLine.getReasonPhrase();<NEW_LINE>if ((statusCode != 200) && (statusCode != 201)) {<NEW_LINE>HttpEntity entity = httpResponse.getEntity();<NEW_LINE>if (entity != null) {<NEW_LINE>String entityContent = getEntityContent(entity);<NEW_LINE>throw new SaturnJobConsoleException(entityContent);<NEW_LINE>} else {<NEW_LINE>throw new SaturnJobConsoleException("statusCode is " + statusCode + ", reasonPhrase is " + reasonPhrase);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new SaturnJobConsoleException("Not status returned, url is " + urlStr);<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>log.error(e.getMessage(), e);<NEW_LINE>throw new SaturnJobConsoleException(e);<NEW_LINE>} finally {<NEW_LINE>try {<NEW_LINE>httpClient.close();<NEW_LINE>} catch (IOException e) {<NEW_LINE>log.error(e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | StatusLine statusLine = httpResponse.getStatusLine(); |
468,970 | private Identity checkIdentity(Business business, PullResult result, Person person, Unit unit, User user) throws Exception {<NEW_LINE>EntityManagerContainer emc = business.entityManagerContainer();<NEW_LINE>EntityManager em = emc.get(Identity.class);<NEW_LINE>CriteriaBuilder cb = em.getCriteriaBuilder();<NEW_LINE>CriteriaQuery<Identity> cq = cb.createQuery(Identity.class);<NEW_LINE>Root<Identity> root = cq.from(Identity.class);<NEW_LINE>Predicate p = cb.equal(root.get(Identity_.person), person.getId());<NEW_LINE>p = cb.and(p, cb.equal(root.get(Identity_.unit), unit.getId()));<NEW_LINE>List<Identity> os = em.createQuery(cq.select(root).where(p)).setMaxResults(1).getResultList();<NEW_LINE>Identity identity = null;<NEW_LINE>Long order = null;<NEW_LINE>if (StringUtils.isNotEmpty(user.getOrderInDepts())) {<NEW_LINE>Map<Long, Long> map = new HashMap<Long, Long>();<NEW_LINE>map = XGsonBuilder.instance().fromJson(user.getOrderInDepts(), map.getClass());<NEW_LINE>for (Entry<Long, Long> en : map.entrySet()) {<NEW_LINE>if (Objects.equals(Long.parseLong(unit.getDingdingId()), en.getKey())) {<NEW_LINE>order = en.getValue();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (os.size() == 0) {<NEW_LINE>identity = this.createIdentity(business, result, person, unit, user, order);<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>identity = this.updateIdentity(business, result, unit, identity, user, order);<NEW_LINE>}<NEW_LINE>return identity;<NEW_LINE>} | identity = os.get(0); |
777,418 | // // Component size ////<NEW_LINE>@Override<NEW_LINE>public void paintComponent(Graphics g) {<NEW_LINE>Graphics2D g2 = (Graphics2D) g;<NEW_LINE>// g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);<NEW_LINE>Rectangle r = getBounds();<NEW_LINE>int centerWidth = r.width - draggerLeftWidth - draggerRightWidth;<NEW_LINE>g2.drawImage(draggerLeft, 0, 0, null);<NEW_LINE>g2.drawImage(draggerRight, r.width - draggerRightWidth, 0, null);<NEW_LINE>g2.drawImage(draggerBackground, draggerLeftWidth, 0, centerWidth, draggerHeight, null);<NEW_LINE>g2.setFont(Theme.SMALL_BOLD_FONT);<NEW_LINE>if (isEnabled()) {<NEW_LINE>g2.setColor(Theme.TEXT_NORMAL_COLOR);<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>SwingUtils.drawCenteredShadowText(g2, valueAsString(), r.width / 2, 14, Theme.DRAGGABLE_NUMBER_HIGHLIGHT_COLOR);<NEW_LINE>} | g2.setColor(Theme.TEXT_DISABLED_COLOR); |
523,881 | public void serialize(ByteBuf buf) {<NEW_LINE>super.serialize(buf);<NEW_LINE>long startCol = splitContext.getPartKey().getStartCol();<NEW_LINE>if (isUseIntKey()) {<NEW_LINE>if (splitContext.isEnableFilter()) {<NEW_LINE>long filterValue = (long) splitContext.getFilterThreshold();<NEW_LINE>int position = buf.writerIndex();<NEW_LINE>buf.writeInt(0);<NEW_LINE>int needUpdateItemNum = 0;<NEW_LINE>for (int i = start; i < end; i++) {<NEW_LINE>if (Math.abs(values[i]) > filterValue) {<NEW_LINE>buf.writeInt((int) (offsets[i] - startCol));<NEW_LINE>buf.writeLong(values[i]);<NEW_LINE>needUpdateItemNum++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>buf.setInt(position, needUpdateItemNum);<NEW_LINE>} else {<NEW_LINE>buf.writeInt(end - start);<NEW_LINE>for (int i = start; i < end; i++) {<NEW_LINE>buf.writeInt((int) (offsets[i] - startCol));<NEW_LINE>buf.writeLong(values[i]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (splitContext.isEnableFilter()) {<NEW_LINE>long filterValue = (long) splitContext.getFilterThreshold();<NEW_LINE>int position = buf.writerIndex();<NEW_LINE>buf.writeInt(0);<NEW_LINE>int needUpdateItemNum = 0;<NEW_LINE>for (int i = start; i < end; i++) {<NEW_LINE>if (Math.abs(values[i]) > filterValue) {<NEW_LINE>buf.writeLong(offsets[i] - startCol);<NEW_LINE>buf.writeLong(values[i]);<NEW_LINE>needUpdateItemNum++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>buf.writeInt(end - start);<NEW_LINE>for (int i = start; i < end; i++) {<NEW_LINE>buf.writeLong(offsets[i] - startCol);<NEW_LINE>buf.writeLong(values[i]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | buf.setInt(position, needUpdateItemNum); |
1,256,451 | private // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents<NEW_LINE>void initComponents() {<NEW_LINE>java.awt.GridBagConstraints gridBagConstraints;<NEW_LINE>jLabelName = new javax.swing.JLabel();<NEW_LINE>jTextFieldName = new javax.swing.JTextField();<NEW_LINE>jLabelJarFiles = new javax.swing.JLabel();<NEW_LINE>jScrollPane1 = new javax.swing.JScrollPane();<NEW_LINE>jListArtifacts = new javax.swing.JList();<NEW_LINE>setLayout(new java.awt.GridBagLayout());<NEW_LINE>jLabelName.setLabelFor(jTextFieldName);<NEW_LINE>// NOI18N<NEW_LINE>org.openide.awt.Mnemonics.setLocalizedText(jLabelName, org.openide.util.NbBundle.getMessage(AntArtifactChooser.class, "LBL_AACH_ProjectName_JLabel"));<NEW_LINE>gridBagConstraints = new java.awt.GridBagConstraints();<NEW_LINE>gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;<NEW_LINE>gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;<NEW_LINE>gridBagConstraints.insets = new java.awt.Insets(0, 12, 2, 0);<NEW_LINE>add(jLabelName, gridBagConstraints);<NEW_LINE>jTextFieldName.setEditable(false);<NEW_LINE>gridBagConstraints = new java.awt.GridBagConstraints();<NEW_LINE>gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;<NEW_LINE>gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;<NEW_LINE>gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;<NEW_LINE>gridBagConstraints.weightx = 1.0;<NEW_LINE>gridBagConstraints.insets = new java.awt.Insets(0, 12, 6, 0);<NEW_LINE>add(jTextFieldName, gridBagConstraints);<NEW_LINE>// NOI18N<NEW_LINE>jTextFieldName.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage<MASK><NEW_LINE>jLabelJarFiles.setLabelFor(jListArtifacts);<NEW_LINE>// NOI18N<NEW_LINE>org.openide.awt.Mnemonics.setLocalizedText(jLabelJarFiles, org.openide.util.NbBundle.getMessage(AntArtifactChooser.class, "LBL_AACH_ProjectJarFiles_JLabel"));<NEW_LINE>gridBagConstraints = new java.awt.GridBagConstraints();<NEW_LINE>gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;<NEW_LINE>gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;<NEW_LINE>gridBagConstraints.insets = new java.awt.Insets(0, 12, 2, 0);<NEW_LINE>add(jLabelJarFiles, gridBagConstraints);<NEW_LINE>jScrollPane1.setViewportView(jListArtifacts);<NEW_LINE>// NOI18N<NEW_LINE>jListArtifacts.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(AntArtifactChooser.class, "LBL_AACH_ProjectJarFiles_JLabel"));<NEW_LINE>gridBagConstraints = new java.awt.GridBagConstraints();<NEW_LINE>gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;<NEW_LINE>gridBagConstraints.gridheight = java.awt.GridBagConstraints.REMAINDER;<NEW_LINE>gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;<NEW_LINE>gridBagConstraints.weightx = 1.0;<NEW_LINE>gridBagConstraints.weighty = 1.0;<NEW_LINE>gridBagConstraints.insets = new java.awt.Insets(0, 12, 0, 0);<NEW_LINE>add(jScrollPane1, gridBagConstraints);<NEW_LINE>} | (AntArtifactChooser.class, "LBL_AACH_ProjectName_JLabel")); |
1,253,943 | public AddRemoveCount synchronizeSearchParamsToDatabase(ResourceIndexedSearchParams theParams, ResourceTable theEntity, ResourceIndexedSearchParams existingParams) {<NEW_LINE>AddRemoveCount retVal = new AddRemoveCount();<NEW_LINE>synchronize(theEntity, retVal, theParams.myStringParams, existingParams.myStringParams);<NEW_LINE>synchronize(theEntity, retVal, theParams.myTokenParams, existingParams.myTokenParams);<NEW_LINE>synchronize(theEntity, retVal, theParams.myNumberParams, existingParams.myNumberParams);<NEW_LINE>synchronize(theEntity, retVal, theParams.myQuantityParams, existingParams.myQuantityParams);<NEW_LINE>synchronize(theEntity, retVal, <MASK><NEW_LINE>synchronize(theEntity, retVal, theParams.myDateParams, existingParams.myDateParams);<NEW_LINE>synchronize(theEntity, retVal, theParams.myUriParams, existingParams.myUriParams);<NEW_LINE>synchronize(theEntity, retVal, theParams.myCoordsParams, existingParams.myCoordsParams);<NEW_LINE>synchronize(theEntity, retVal, theParams.myLinks, existingParams.myLinks);<NEW_LINE>synchronize(theEntity, retVal, theParams.myComboTokenNonUnique, existingParams.myComboTokenNonUnique);<NEW_LINE>// make sure links are indexed<NEW_LINE>theEntity.setResourceLinks(theParams.myLinks);<NEW_LINE>return retVal;<NEW_LINE>} | theParams.myQuantityNormalizedParams, existingParams.myQuantityNormalizedParams); |
572,368 | private ExceptionResponse summarizeException(ExceptionResponse response1) {<NEW_LINE>Map<String, ExceptionDatum> exceptionSummary = new HashMap<>();<NEW_LINE>for (ExceptionDatum edp : response1.getExceptionDatapointList()) {<NEW_LINE>// Get classname by splitting on first colon<NEW_LINE>int pos = edp.getStackTrace().indexOf(':');<NEW_LINE>if (pos >= 0) {<NEW_LINE>String className = edp.getStackTrace().substring(0, pos);<NEW_LINE>if (!exceptionSummary.containsKey(className)) {<NEW_LINE>exceptionSummary.put(className, new ExceptionDatum(edp.getComponentName(), edp.getInstanceId(), edp.getHostname(), className, edp.getLastTime(), edp.getFirstTime(), edp.getCount(), edp.getLogging()));<NEW_LINE>} else {<NEW_LINE>ExceptionDatum edp3 = exceptionSummary.get(className);<NEW_LINE>// update count and time<NEW_LINE>int count = edp3.getCount() + edp.getCount();<NEW_LINE>String firstTime = edp3.getFirstTime();<NEW_LINE>// should assure the time ?<NEW_LINE>String lastTime = edp.getLastTime();<NEW_LINE>// put it back in summary<NEW_LINE>exceptionSummary.put(className, new ExceptionDatum(edp3.getComponentName(), edp3.getInstanceId(), edp3.getHostname(), edp3.getStackTrace(), lastTime, firstTime, count<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ExceptionResponse ret = new ExceptionResponse(exceptionSummary.values());<NEW_LINE>return ret;<NEW_LINE>} | , edp3.getLogging())); |
1,731,035 | public static void reloadData(@NonNull OsmandApplication app, @NonNull FragmentActivity activity) {<NEW_LINE>final WeakReference<FragmentActivity> activityRef = new WeakReference<>(activity);<NEW_LINE>app.getResourceManager().reloadIndexesAsync(IProgress.EMPTY_PROGRESS, new ReloadIndexesListener() {<NEW_LINE><NEW_LINE>private ProgressImplementation progress;<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void reloadIndexesStarted() {<NEW_LINE>FragmentActivity activity = activityRef.get();<NEW_LINE>if (activity != null) {<NEW_LINE>progress = ProgressImplementation.createProgressDialog(activity, app.getString(R.string.loading_data), app.getString(R.string<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void reloadIndexesFinished(List<String> warnings) {<NEW_LINE>try {<NEW_LINE>if (progress != null && progress.getDialog().isShowing()) {<NEW_LINE>progress.getDialog().dismiss();<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>// ignored<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | .loading_data), ProgressDialog.STYLE_HORIZONTAL); |
1,578,366 | public void afterDeleteOperations(final OIdentifiable id) {<NEW_LINE>if (id instanceof ODocument) {<NEW_LINE>ODocument doc = (ODocument) id;<NEW_LINE>OImmutableClass clazz = ODocumentInternal.getImmutableSchemaClass(this, doc);<NEW_LINE>if (clazz != null) {<NEW_LINE>OClassIndexManager.checkIndexesAfterDelete(doc, this);<NEW_LINE>if (clazz.isFunction()) {<NEW_LINE>this.getSharedContext().<MASK><NEW_LINE>sharedContext.getOrientDB().getScriptManager().close(this.getName());<NEW_LINE>}<NEW_LINE>if (clazz.isSequence()) {<NEW_LINE>((OSequenceLibraryProxy) getMetadata().getSequenceLibrary()).getDelegate().onSequenceDropped(this, doc);<NEW_LINE>}<NEW_LINE>if (clazz.isScheduler()) {<NEW_LINE>final String eventName = doc.field(OScheduledEvent.PROP_NAME);<NEW_LINE>getSharedContext().getScheduler().removeEventInternal(eventName);<NEW_LINE>}<NEW_LINE>if (clazz.isTriggered()) {<NEW_LINE>OClassTrigger.onRecordAfterDelete(doc, this);<NEW_LINE>}<NEW_LINE>getSharedContext().getViewManager().recordDeleted(clazz, doc, this);<NEW_LINE>}<NEW_LINE>OLiveQueryHook.addOp(doc, ORecordOperation.DELETED, this);<NEW_LINE>OLiveQueryHookV2.addOp(doc, ORecordOperation.DELETED, this);<NEW_LINE>}<NEW_LINE>callbackHooks(ORecordHook.TYPE.AFTER_DELETE, id);<NEW_LINE>} | getFunctionLibrary().droppedFunction(doc); |
44,232 | final DBInstance executeModifyDBInstance(ModifyDBInstanceRequest modifyDBInstanceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(modifyDBInstanceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ModifyDBInstanceRequest> request = null;<NEW_LINE>Response<DBInstance> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ModifyDBInstanceRequestMarshaller().marshall(super.beforeMarshalling(modifyDBInstanceRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Neptune");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ModifyDBInstance");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DBInstance> responseHandler = new StaxResponseHandler<DBInstance>(new DBInstanceStaxUnmarshaller());<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.CLIENT_ENDPOINT, endpoint); |
827,755 | public String deleteBatchLog(DeletePerformanceRequest request) {<NEW_LINE>ServiceUtils.getSelectAllIds(request, request.getCondition(), (query) -> getLoadTestIds(request.getProjectId()));<NEW_LINE>List<String> loadTestIds = request.getIds();<NEW_LINE>LoadTestExample example = new LoadTestExample();<NEW_LINE>example.<MASK><NEW_LINE>List<LoadTest> tests = loadTestMapper.selectByExample(example);<NEW_LINE>if (org.apache.commons.collections.CollectionUtils.isNotEmpty(tests)) {<NEW_LINE>List<String> names = tests.stream().map(LoadTest::getName).collect(Collectors.toList());<NEW_LINE>OperatingLogDetails details = new OperatingLogDetails(JSON.toJSONString(loadTestIds), tests.get(0).getProjectId(), String.join(",", names), tests.get(0).getCreateUser(), new LinkedList<>());<NEW_LINE>return JSON.toJSONString(details);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | createCriteria().andIdIn(loadTestIds); |
490,348 | public static boolean verifyTopology(TopologyAPI.Topology topology) {<NEW_LINE>if (!topology.hasName() || topology.getName().isEmpty()) {<NEW_LINE>LOG.severe("Missing topology name");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (topology.getName().contains(".") || topology.getName().contains("/")) {<NEW_LINE>LOG.severe("Invalid topology name. Topology name shouldn't have . or /");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// Only verify RAM map string well-formed.<NEW_LINE>getComponentRamMapConfig(topology);<NEW_LINE>// Verify all bolts input streams exist. First get all output streams.<NEW_LINE>Set<String> outputStreams = new HashSet<>();<NEW_LINE>for (TopologyAPI.Spout spout : topology.getSpoutsList()) {<NEW_LINE>for (TopologyAPI.OutputStream stream : spout.getOutputsList()) {<NEW_LINE>outputStreams.add(stream.getStream().getComponentName() + "/" + stream.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (TopologyAPI.Bolt bolt : topology.getBoltsList()) {<NEW_LINE>for (TopologyAPI.OutputStream stream : bolt.getOutputsList()) {<NEW_LINE>outputStreams.add(stream.getStream().getComponentName() + "/" + stream.getStream().getId());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Match output streams with input streams.<NEW_LINE>for (TopologyAPI.Bolt bolt : topology.getBoltsList()) {<NEW_LINE>for (TopologyAPI.InputStream stream : bolt.getInputsList()) {<NEW_LINE>String key = stream.getStream().getComponentName() + "/" + stream.getStream().getId();<NEW_LINE>if (!outputStreams.contains(key)) {<NEW_LINE>LOG.severe("Invalid input stream " + key + " existing streams are " + outputStreams);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// TODO(nbhagat): Should we enforce all output stream must be consumed?<NEW_LINE>return true;<NEW_LINE>} | getStream().getId()); |
1,379,023 | protected Composite createDialogArea(@NotNull Composite parent) {<NEW_LINE>Composite <MASK><NEW_LINE>SashForm sash = new SashForm(dialogArea, SWT.HORIZONTAL);<NEW_LINE>sash.setLayoutData(new GridData(GridData.FILL_BOTH));<NEW_LINE>createNodesTable(sash);<NEW_LINE>propertyEditor = new PropertyTreeViewer(sash, SWT.BORDER);<NEW_LINE>ResultSetDataContainerOptions options = new ResultSetDataContainerOptions();<NEW_LINE>ResultSetDataContainer dataContainer = new ResultSetDataContainer(resultSetController, options);<NEW_LINE>List<DataTransferProcessorDescriptor> model = DataTransferRegistry.getInstance().getAvailableConsumers(Collections.singleton(dataContainer)).stream().flatMap(node -> Arrays.stream(node.getProcessors())).filter(processor -> !processor.isBinaryFormat()).sorted(Comparator.comparing(DataTransferProcessorDescriptor::getName)).collect(Collectors.toList());<NEW_LINE>if (!model.isEmpty()) {<NEW_LINE>processorsTable.setInput(model);<NEW_LINE>selectedProcessor = model.get(0);<NEW_LINE>processorsTable.setSelection(new StructuredSelection(selectedProcessor));<NEW_LINE>showPropertiesForSelectedProcessor();<NEW_LINE>} else {<NEW_LINE>log.debug("No appropriate descriptor found, nothing to add to the configure page");<NEW_LINE>}<NEW_LINE>UIUtils.maxTableColumnsWidth(processorsTable.getTable());<NEW_LINE>sash.setWeights(50, 50);<NEW_LINE>return dialogArea;<NEW_LINE>} | dialogArea = super.createDialogArea(parent); |
1,418,359 | final ListComponentBuildVersionsResult executeListComponentBuildVersions(ListComponentBuildVersionsRequest listComponentBuildVersionsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listComponentBuildVersionsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListComponentBuildVersionsRequest> request = null;<NEW_LINE>Response<ListComponentBuildVersionsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListComponentBuildVersionsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listComponentBuildVersionsRequest));<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, "imagebuilder");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListComponentBuildVersions");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListComponentBuildVersionsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListComponentBuildVersionsResultJsonUnmarshaller());<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()); |
853,006 | public void execute(String shardingNode, Set<String> tables) {<NEW_LINE>StringBuilder sbSql = new StringBuilder();<NEW_LINE>for (String table : tables) {<NEW_LINE>sbSql.append(SQL_SHOW_CREATE_TABLE.replace("{0}", table));<NEW_LINE>}<NEW_LINE>ShardingNode dn = DbleServer.getInstance().getConfig().getShardingNodes().get(shardingNode);<NEW_LINE>PhysicalDbInstance ds = dn.getDbGroup().getWriteDbInstance();<NEW_LINE>if (ds.isAlive()) {<NEW_LINE>logger.info("dbInstance is alive start sqljob for shardingNode:" + shardingNode);<NEW_LINE>MultiRowSQLQueryResultHandler resultHandler = new MultiRowSQLQueryResultHandler(MYSQL_SHOW_CREATE_TABLE_COLS, new TableStructureListener<MASK><NEW_LINE>MultiTablesMetaJob sqlJob = new MultiTablesMetaJob(sbSql.toString(), dn.getDatabase(), resultHandler, ds, logger.isReload());<NEW_LINE>sqlJob.run();<NEW_LINE>} else {<NEW_LINE>logger.info("dbInstance is not alive start sqljob for shardingNode:" + shardingNode);<NEW_LINE>MultiRowSQLQueryResultHandler resultHandler = new MultiRowSQLQueryResultHandler(MYSQL_SHOW_CREATE_TABLE_COLS, new TableStructureListener(shardingNode, tables, null));<NEW_LINE>MultiTablesMetaJob sqlJob = new MultiTablesMetaJob(sbSql.toString(), shardingNode, resultHandler, false, logger.isReload());<NEW_LINE>sqlJob.run();<NEW_LINE>}<NEW_LINE>} | (shardingNode, tables, ds)); |
626,565 | protected void classInstanceCreation(boolean hasClassBody) {<NEW_LINE>// ClassInstanceCreationExpression ::= 'new' ClassType '(' ArgumentListopt ')' ClassBodyopt<NEW_LINE>// ClassBodyopt produces a null item on the astStak if it produces NO class body<NEW_LINE>// An empty class body produces a 0 on the length stack.....<NEW_LINE>if ((this.astLengthStack[this.astLengthPtr] == 1) && (this.astStack[this.astPtr] == null)) {<NEW_LINE>int index;<NEW_LINE>if ((index = this.indexOfAssistIdentifier()) < 0) {<NEW_LINE>super.classInstanceCreation(hasClassBody);<NEW_LINE>return;<NEW_LINE>} else if (this.identifierLengthPtr > -1 && (this.identifierLengthStack[this.identifierLengthPtr] - 1) != index) {<NEW_LINE>super.classInstanceCreation(hasClassBody);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>QualifiedAllocationExpression alloc;<NEW_LINE>this.astPtr--;<NEW_LINE>this.astLengthPtr--;<NEW_LINE>alloc = new SelectionOnQualifiedAllocationExpression();<NEW_LINE>// the position has been stored explicitly<NEW_LINE>alloc.sourceEnd = this.endPosition;<NEW_LINE>int length;<NEW_LINE>if ((length = this.expressionLengthStack[this.expressionLengthPtr--]) != 0) {<NEW_LINE>this.expressionPtr -= length;<NEW_LINE>System.arraycopy(this.expressionStack, this.expressionPtr + 1, alloc.arguments = new Expression[length], 0, length);<NEW_LINE>}<NEW_LINE>// trick to avoid creating a selection on type reference<NEW_LINE><MASK><NEW_LINE>setAssistIdentifier(null);<NEW_LINE>alloc.type = getTypeReference(0);<NEW_LINE>checkForDiamond(alloc.type);<NEW_LINE>setAssistIdentifier(oldIdent);<NEW_LINE>// the default constructor with the correct number of argument<NEW_LINE>// will be created and added by the TC (see createsInternalConstructorWithBinding)<NEW_LINE>alloc.sourceStart = this.intStack[this.intPtr--];<NEW_LINE>pushOnExpressionStack(alloc);<NEW_LINE>this.assistNode = alloc;<NEW_LINE>this.lastCheckPoint = alloc.sourceEnd + 1;<NEW_LINE>if (!this.diet) {<NEW_LINE>// force to restart in recovery mode<NEW_LINE>this.restartRecovery = true;<NEW_LINE>this.lastIgnoredToken = -1;<NEW_LINE>}<NEW_LINE>this.isOrphanCompletionNode = true;<NEW_LINE>} else {<NEW_LINE>super.classInstanceCreation(hasClassBody);<NEW_LINE>}<NEW_LINE>} | char[] oldIdent = assistIdentifier(); |
545,302 | public static void main(String[] args) {<NEW_LINE>setup();<NEW_LINE>GeneralRocketSaver saver = new GeneralRocketSaver();<NEW_LINE>for (String inputFile : args) {<NEW_LINE>System.out.println("Converting " + inputFile + "...");<NEW_LINE>if (!inputFile.matches(".*\\.[rR][kK][tT]$")) {<NEW_LINE>System.err.println("ERROR: File '" + inputFile + "' does not end in .rkt, skipping.");<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>String outputFile = inputFile.replaceAll("\\.[rR][kK][tT]$", ".ork");<NEW_LINE>File input = new File(inputFile);<NEW_LINE>File output = new File(outputFile);<NEW_LINE>if (!input.isFile()) {<NEW_LINE>System.err.println("ERROR: File '" + inputFile + "' does not exist, skipping.");<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (output.exists()) {<NEW_LINE>System.err.println("ERROR: File '" + outputFile + "' already exists, skipping.");<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>StorageOptions opts = new StorageOptions();<NEW_LINE>opts.<MASK><NEW_LINE>opts.setSimulationTimeSkip(StorageOptions.SIMULATION_DATA_NONE);<NEW_LINE>opts.setExplicitlySet(true);<NEW_LINE>GeneralRocketLoader loader = new GeneralRocketLoader(input);<NEW_LINE>OpenRocketDocument document = loader.load();<NEW_LINE>saver.save(output, document, opts);<NEW_LINE>} catch (RocketLoadException e) {<NEW_LINE>System.err.println("ERROR: Error loading '" + inputFile + "': " + e.getMessage());<NEW_LINE>} catch (IOException e) {<NEW_LINE>System.err.println("ERROR: Error saving '" + outputFile + "': " + e.getMessage());<NEW_LINE>} catch (DecalNotFoundException decex) {<NEW_LINE>DecalNotFoundDialog.showDialog(null, decex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | setFileType(StorageOptions.FileType.OPENROCKET); |
1,027,539 | public static <//<NEW_LINE>//<NEW_LINE>T> //<NEW_LINE>T //<NEW_LINE>parseObject(//<NEW_LINE>InputStream is, //<NEW_LINE>Charset charset, //<NEW_LINE>Type type, //<NEW_LINE>ParserConfig config, //<NEW_LINE>ParseProcess processor, int featureValues, Feature... features) throws IOException {<NEW_LINE>if (charset == null) {<NEW_LINE>charset = IOUtils.UTF8;<NEW_LINE>}<NEW_LINE>byte[] bytes = allocateBytes(1024 * 64);<NEW_LINE>int offset = 0;<NEW_LINE>for (; ; ) {<NEW_LINE>int readCount = is.read(bytes, offset, bytes.length - offset);<NEW_LINE>if (readCount == -1) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>offset += readCount;<NEW_LINE>if (offset == bytes.length) {<NEW_LINE>byte[] newBytes = new byte[<MASK><NEW_LINE>System.arraycopy(bytes, 0, newBytes, 0, bytes.length);<NEW_LINE>bytes = newBytes;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return (T) parseObject(bytes, 0, offset, charset, type, config, processor, featureValues, features);<NEW_LINE>} | bytes.length * 3 / 2]; |
1,030,318 | public double tableCardinality(RelOptTable table) {<NEW_LINE>final JdbcTable jdbcTable = table.unwrap(JdbcTable.class);<NEW_LINE>return withBuilder(jdbcTable.jdbcSchema, (cluster, relOptSchema, jdbcSchema, relBuilder) -> {<NEW_LINE>// Generate:<NEW_LINE>// SELECT COUNT(*) FROM `EMP`<NEW_LINE>relBuilder.push(table.toRel(ViewExpanders.simpleContext(cluster))).aggregate(relBuilder.groupKey(<MASK><NEW_LINE>final String sql = toSql(relBuilder.build(), jdbcSchema.dialect);<NEW_LINE>final DataSource dataSource = jdbcSchema.getDataSource();<NEW_LINE>try (Connection connection = dataSource.getConnection();<NEW_LINE>Statement statement = connection.createStatement();<NEW_LINE>ResultSet resultSet = statement.executeQuery(sql)) {<NEW_LINE>if (!resultSet.next()) {<NEW_LINE>throw new AssertionError("expected exactly 1 row: " + sql);<NEW_LINE>}<NEW_LINE>final double cardinality = resultSet.getDouble(1);<NEW_LINE>if (resultSet.next()) {<NEW_LINE>throw new AssertionError("expected exactly 1 row: " + sql);<NEW_LINE>}<NEW_LINE>return cardinality;<NEW_LINE>} catch (SQLException e) {<NEW_LINE>throw handle(e, sql);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | ), relBuilder.count()); |
142,482 | public void _delete() {<NEW_LINE>String dbName = JPA.getDBName(this.getClass());<NEW_LINE>try {<NEW_LINE>avoidCascadeSaveLoops.set(<MASK><NEW_LINE>try {<NEW_LINE>saveAndCascade(true);<NEW_LINE>} finally {<NEW_LINE>avoidCascadeSaveLoops.get().clear();<NEW_LINE>}<NEW_LINE>em(dbName).remove(this);<NEW_LINE>try {<NEW_LINE>em(dbName).flush();<NEW_LINE>} catch (PersistenceException e) {<NEW_LINE>if (e.getCause() instanceof GenericJDBCException) {<NEW_LINE>throw new PersistenceException(((GenericJDBCException) e.getCause()).getSQL(), e);<NEW_LINE>} else {<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>avoidCascadeSaveLoops.set(new HashSet<JPABase>());<NEW_LINE>try {<NEW_LINE>saveAndCascade(false);<NEW_LINE>} finally {<NEW_LINE>avoidCascadeSaveLoops.get().clear();<NEW_LINE>}<NEW_LINE>PlayPlugin.postEvent("JPASupport.objectDeleted", this);<NEW_LINE>} catch (PersistenceException e) {<NEW_LINE>throw e;<NEW_LINE>} catch (Throwable e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>} | new HashSet<JPABase>()); |
809,762 | // solve() method will act as solving the problem<NEW_LINE>int solve(int[] price, int[] size, int m, int n) {<NEW_LINE>// Create 2-D array to store the value of profit<NEW_LINE>int[][] dp = new int[m + 1][n + 1];<NEW_LINE>for (int i = 0; i < m + 1; i++) {<NEW_LINE>for (int j = 0; j < n + 1; j++) {<NEW_LINE>// if size = 0 or there is 0 value for the size<NEW_LINE>if (i == 0 || j == 0) {<NEW_LINE>dp[i][j] = 0;<NEW_LINE>} else /* if size is less than the current max size then<NEW_LINE>get the max price from size or neglect if not needed<NEW_LINE>*/<NEW_LINE>if (size[i - 1] <= j) {<NEW_LINE>dp[i][j] = Math.max(price[i - 1] + dp[i][j - size[i - 1]], dp[<MASK><NEW_LINE>} else // if size is greater than current max size , no value is taken from price array<NEW_LINE>{<NEW_LINE>dp[i][j] = dp[i - 1][j];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return dp[m][n];<NEW_LINE>} | i - 1][j]); |
1,542,479 | final public synchronized void updateApps(RemoteBootAppData[] appData) {<NEW_LINE>logger.info("updating settings for remote processses to track - start");<NEW_LINE>// remove outdated remote apps<NEW_LINE>Set<RemoteBootAppData> newAppData = new HashSet<>(Arrays.asList(appData));<NEW_LINE>Iterator<Entry<RemoteBootAppData, String>> entries = remoteAppInstances<MASK><NEW_LINE>while (entries.hasNext()) {<NEW_LINE>Entry<RemoteBootAppData, String> entry = entries.next();<NEW_LINE>RemoteBootAppData key = entry.getKey();<NEW_LINE>if (!newAppData.contains(key)) {<NEW_LINE>logger.info("Removing RemoteSpringBootApp: " + key);<NEW_LINE>entries.remove();<NEW_LINE>// create meaningful process key here<NEW_LINE>String processKey = entry.getValue();<NEW_LINE>processConnectorService.disconnectProcess(processKey);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Add new apps<NEW_LINE>for (RemoteBootAppData data : newAppData) {<NEW_LINE>remoteAppInstances.computeIfAbsent(data, (_appData) -> {<NEW_LINE>logger.info("Creating RemoteStringBootApp: " + _appData);<NEW_LINE>String processKey = getProcessKey(_appData);<NEW_LINE>connectProcess(_appData);<NEW_LINE>return processKey;<NEW_LINE>});<NEW_LINE>}<NEW_LINE>logger.info("updating settings for remote processses to track - done");<NEW_LINE>} | .entrySet().iterator(); |
1,180,282 | final DeleteDomainAssociationResult executeDeleteDomainAssociation(DeleteDomainAssociationRequest deleteDomainAssociationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteDomainAssociationRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteDomainAssociationRequest> request = null;<NEW_LINE>Response<DeleteDomainAssociationResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteDomainAssociationRequestProtocolMarshaller(protocolFactory).marshall<MASK><NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Amplify");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteDomainAssociation");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteDomainAssociationResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteDomainAssociationResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | (super.beforeMarshalling(deleteDomainAssociationRequest)); |
1,244,475 | protected int indexOfKey(int key) {<NEW_LINE>final int length = table.length;<NEW_LINE>final int hash = <MASK><NEW_LINE>int i = hash % length;<NEW_LINE>// double hashing, see<NEW_LINE>int decrement = hash % (length - 2);<NEW_LINE>// http://www.eece.unm.edu/faculty/heileman/hash/node4.html<NEW_LINE>// int decrement = (hash / length) % length;<NEW_LINE>if (decrement == 0) {<NEW_LINE>decrement = 1;<NEW_LINE>}<NEW_LINE>// stop if we find a free slot, or if we find the key itself.<NEW_LINE>// do skip over removed slots (yes, open addressing is like that...)<NEW_LINE>while (state[i] != FREE && (state[i] == REMOVED || table[i] != key)) {<NEW_LINE>i -= decrement;<NEW_LINE>// hashCollisions++;<NEW_LINE>if (i < 0) {<NEW_LINE>i += length;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (state[i] == FREE) {<NEW_LINE>return -1;<NEW_LINE>}<NEW_LINE>// not found<NEW_LINE>// found, return index where key is contained<NEW_LINE>return i;<NEW_LINE>} | HashFunctions.hash(key) & 0x7FFFFFFF; |
1,143,100 | final DeletePlatformVersionResult executeDeletePlatformVersion(DeletePlatformVersionRequest deletePlatformVersionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deletePlatformVersionRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeletePlatformVersionRequest> request = null;<NEW_LINE>Response<DeletePlatformVersionResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeletePlatformVersionRequestMarshaller().marshall(super.beforeMarshalling(deletePlatformVersionRequest));<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, "Elastic Beanstalk");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeletePlatformVersion");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DeletePlatformVersionResult> responseHandler = new StaxResponseHandler<DeletePlatformVersionResult>(new DeletePlatformVersionResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); |
1,681,291 | public boolean isTemporaryPreviewAvailable(String fileSystemId, String mimeType) {<NEW_LINE>if (temporaryThumbnailsMap.get(fileSystemId) != null && !temporaryThumbnailsMap.get(fileSystemId).isEmpty()) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if ("".equals(temporaryThumbnailsMap.get(fileSystemId))) {<NEW_LINE>// we've already looked once - and there's no thumbnail.<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>String filesRootDirectory = System.getProperty("dataverse.files.directory");<NEW_LINE>if (filesRootDirectory == null || filesRootDirectory.isEmpty()) {<NEW_LINE>filesRootDirectory = "/tmp/files";<NEW_LINE>}<NEW_LINE>String fileSystemName = filesRootDirectory + "/temp/" + fileSystemId;<NEW_LINE>String imageThumbFileName = null;<NEW_LINE>// ATTENTION! TODO: the current version of the method below may not be checking if files are already cached!<NEW_LINE>if ("application/pdf".equals(mimeType)) {<NEW_LINE>imageThumbFileName = ImageThumbConverter.generatePDFThumbnailFromFile(fileSystemName, ImageThumbConverter.DEFAULT_THUMBNAIL_SIZE);<NEW_LINE>} else if (mimeType != null && mimeType.startsWith("image/")) {<NEW_LINE>imageThumbFileName = ImageThumbConverter.generateImageThumbnailFromFile(fileSystemName, ImageThumbConverter.DEFAULT_THUMBNAIL_SIZE);<NEW_LINE>}<NEW_LINE>if (imageThumbFileName != null) {<NEW_LINE>File imageThumbFile = new File(imageThumbFileName);<NEW_LINE>if (imageThumbFile.exists()) {<NEW_LINE>String previewAsBase64 = ImageThumbConverter.getImageAsBase64FromFile(imageThumbFile);<NEW_LINE>if (previewAsBase64 != null) {<NEW_LINE><MASK><NEW_LINE>return true;<NEW_LINE>} else {<NEW_LINE>temporaryThumbnailsMap.put(fileSystemId, "");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | temporaryThumbnailsMap.put(fileSystemId, previewAsBase64); |
167,818 | public final void keyword_when() throws RecognitionException, TokenStreamException {<NEW_LINE>returnAST = null;<NEW_LINE>ASTPair currentAST = new ASTPair();<NEW_LINE>AST keyword_when_AST = null;<NEW_LINE>AST tmp375_AST = null;<NEW_LINE>tmp375_AST = astFactory.create(LT(1));<NEW_LINE>astFactory.addASTChild(currentAST, tmp375_AST);<NEW_LINE>match(LITERAL_when);<NEW_LINE>{<NEW_LINE>switch(LA(1)) {<NEW_LINE>case LINE_BREAK:<NEW_LINE>{<NEW_LINE>match(LINE_BREAK);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case REST_ARG_PREFIX:<NEW_LINE>case LPAREN_WITH_NO_LEADING_SPACE:<NEW_LINE>case LPAREN:<NEW_LINE>case IDENTIFIER:<NEW_LINE>case CONSTANT:<NEW_LINE>case FUNCTION:<NEW_LINE>case GLOBAL_VARIABLE:<NEW_LINE>case COLON_WITH_NO_FOLLOWING_SPACE:<NEW_LINE>case INSTANCE_VARIABLE:<NEW_LINE>case CLASS_VARIABLE:<NEW_LINE>case UNARY_PLUS_MINUS_METHOD_NAME:<NEW_LINE>case LITERAL_not:<NEW_LINE>case BNOT:<NEW_LINE>case NOT:<NEW_LINE>case LITERAL_return:<NEW_LINE>case LITERAL_break:<NEW_LINE>case LITERAL_next:<NEW_LINE>case EMPTY_ARRAY_ACCESS:<NEW_LINE>case UNARY_PLUS:<NEW_LINE>case UNARY_MINUS:<NEW_LINE>case LITERAL_nil:<NEW_LINE>case LITERAL_true:<NEW_LINE>case LITERAL_false:<NEW_LINE>case LITERAL___FILE__:<NEW_LINE>case LITERAL___LINE__:<NEW_LINE>case DOUBLE_QUOTE_STRING:<NEW_LINE>case SINGLE_QUOTE_STRING:<NEW_LINE>case STRING_BEFORE_EXPRESSION_SUBSTITUTION:<NEW_LINE>case REGEX:<NEW_LINE>case REGEX_BEFORE_EXPRESSION_SUBSTITUTION:<NEW_LINE>case COMMAND_OUTPUT:<NEW_LINE>case COMMAND_OUTPUT_BEFORE_EXPRESSION_SUBSTITUTION:<NEW_LINE>case HERE_DOC_BEGIN:<NEW_LINE>case W_ARRAY:<NEW_LINE>case INTEGER:<NEW_LINE>case HEX:<NEW_LINE>case BINARY:<NEW_LINE>case OCTAL:<NEW_LINE>case FLOAT:<NEW_LINE>case ASCII_VALUE:<NEW_LINE>case LITERAL_self:<NEW_LINE>case LITERAL_super:<NEW_LINE>case LEADING_COLON2:<NEW_LINE>case LITERAL_retry:<NEW_LINE>case LITERAL_yield:<NEW_LINE>case LITERAL_redo:<NEW_LINE>case EMPTY_ARRAY:<NEW_LINE>case LBRACK:<NEW_LINE>case LCURLY_HASH:<NEW_LINE>case LITERAL_begin:<NEW_LINE>case LITERAL_if:<NEW_LINE>case LITERAL_unless:<NEW_LINE>case LITERAL_case:<NEW_LINE>case LITERAL_for:<NEW_LINE>case LITERAL_while:<NEW_LINE>case LITERAL_until:<NEW_LINE>case LITERAL_module:<NEW_LINE>case LITERAL_class:<NEW_LINE>case LITERAL_def:<NEW_LINE>case 155:<NEW_LINE>{<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>default:<NEW_LINE>{<NEW_LINE>throw new NoViableAltException(LT<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>keyword_when_AST = (AST) currentAST.root;<NEW_LINE>returnAST = keyword_when_AST;<NEW_LINE>} | (1), getFilename()); |
691,937 | public void updateDownloadShares(UpdateDownloadSharesBulkRequest body, String xSdsAuthToken) throws ApiException {<NEW_LINE>Object localVarPostBody = body;<NEW_LINE>// verify the required parameter 'body' is set<NEW_LINE>if (body == null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/v4/shares/downloads";<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>if (xSdsAuthToken != null)<NEW_LINE>localVarHeaderParams.put("X-Sds-Auth-Token", apiClient.parameterToString(xSdsAuthToken));<NEW_LINE>final String[] localVarAccepts = { "*/*" };<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[] { "oauth2" };<NEW_LINE>apiClient.invokeAPI(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);<NEW_LINE>} | throw new ApiException(400, "Missing the required parameter 'body' when calling updateDownloadShares"); |
553,859 | public void closeAllConsumersForDelete(DestinationHandler destinationBeingDeleted) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.entry(tc, "closeAllConsumersForDelete", destinationBeingDeleted);<NEW_LINE>Iterator<DispatchableKey> itr = null;<NEW_LINE>Iterator<DispatchableKey> clonedItr = null;<NEW_LINE>// The consumerPoints list is cloned for the notifyException<NEW_LINE>// call.<NEW_LINE>synchronized (consumerPoints) {<NEW_LINE>// since the close of the underlying session causes the consumer point to<NEW_LINE>// be removed from the list we have to take a clone of the list<NEW_LINE>clonedItr = ((LinkedList<DispatchableKey>) consumerPoints.clone()).iterator();<NEW_LINE>itr = ((LinkedList<DispatchableKey>) consumerPoints.clone()).iterator();<NEW_LINE>}<NEW_LINE>// Defect 360452<NEW_LINE>// Iterate twice to avoid deadlock. First iteration to mark<NEW_LINE>// as not ready. This ensure no messages on the destination<NEW_LINE>// will arrive at the consumers.<NEW_LINE>synchronized (_baseDestHandler.getReadyConsumerPointLock()) {<NEW_LINE>while (itr.hasNext()) {<NEW_LINE>DispatchableKey consumerKey = itr.next();<NEW_LINE>// If we're making the consumer notReady then we must also remove<NEW_LINE>// them from the list of ready consumers that we hold<NEW_LINE>if (consumerKey.isKeyReady())<NEW_LINE>removeReadyConsumer(consumerKey.getParent(), consumerKey.isSpecific());<NEW_LINE>consumerKey.markNotReady();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Second iteration to close sessions outside of readyConsumerPointLock<NEW_LINE>// to avoid deadlock with receive.<NEW_LINE>while (clonedItr.hasNext()) {<NEW_LINE><MASK><NEW_LINE>consumerKey.getConsumerPoint().implicitClose(destinationBeingDeleted.getUuid(), null, _messageProcessor.getMessagingEngineUuid());<NEW_LINE>}<NEW_LINE>// Close any browsers<NEW_LINE>closeBrowsersDestinationDeleted(destinationBeingDeleted);<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.exit(tc, "closeAllConsumersForDelete");<NEW_LINE>} | DispatchableKey consumerKey = clonedItr.next(); |
320,066 | private static void bindFloat(Connection conn) throws SQLException {<NEW_LINE>String sql = "insert into ? using stable2 tags(?,?) values(?,?,?)";<NEW_LINE>TSDBPreparedStatement pstmt = conn.prepareStatement(sql).unwrap(TSDBPreparedStatement.class);<NEW_LINE>for (int i = 1; i <= numOfSubTable; i++) {<NEW_LINE>// set table name<NEW_LINE>pstmt.setTableName("t2_" + i);<NEW_LINE>// set tags<NEW_LINE>pstmt.setTagFloat(0, random.nextFloat());<NEW_LINE>pstmt.setTagDouble(1, random.nextDouble());<NEW_LINE>// set columns<NEW_LINE>ArrayList<Long> tsList = new ArrayList<>();<NEW_LINE>long current = System.currentTimeMillis();<NEW_LINE>for (int j = 0; j < numOfRow; j++) tsList.add(current + j);<NEW_LINE>pstmt.setTimestamp(0, tsList);<NEW_LINE>ArrayList<Float> f1List = new ArrayList<>();<NEW_LINE>for (int j = 0; j < numOfRow; j++) f1List.add(random.nextFloat());<NEW_LINE><MASK><NEW_LINE>ArrayList<Double> f2List = new ArrayList<>();<NEW_LINE>for (int j = 0; j < numOfRow; j++) f2List.add(random.nextDouble());<NEW_LINE>pstmt.setDouble(2, f2List);<NEW_LINE>// add column<NEW_LINE>pstmt.columnDataAddBatch();<NEW_LINE>}<NEW_LINE>// execute<NEW_LINE>pstmt.columnDataExecuteBatch();<NEW_LINE>// close if no try-with-catch statement is used<NEW_LINE>pstmt.close();<NEW_LINE>} | pstmt.setFloat(1, f1List); |
1,275,857 | public static void main(String[] args) {<NEW_LINE>PingClientConfig config = parseArgs(args);<NEW_LINE>boolean useHeader = "header".equals(config.getTransport());<NEW_LINE>final RpcClientFactory clientFactory = useHeader ? new LegacyRpcClientFactory(new ThriftClientConfig().setDisableSSL(true)) : new RSocketRpcClientFactory(new ThriftClientConfig().setDisableSSL(true));<NEW_LINE>SocketAddress address = InetSocketAddress.createUnresolved(config.getHost(), config.getPort());<NEW_LINE>// NOTE: the follow code can be simplified after a better api is introduced<NEW_LINE>final PingService client = PingService.createBlockingClient(clientFactory, address, ProtocolId.BINARY, ImmutableMap.of("key1", "val1"), ImmutableMap.of("pkey1", "pval1"));<NEW_LINE>// Create request object<NEW_LINE>PingRequest request = new PingRequest("Foo");<NEW_LINE>try {<NEW_LINE>// Send request<NEW_LINE>if ("ping".equals(config.getMethod())) {<NEW_LINE>PingResponse response = client.ping(request);<NEW_LINE>LOG.info("Response: " + response.getResponse());<NEW_LINE>} else if ("pingException".equals(config.getMethod())) {<NEW_LINE>PingResponse <MASK><NEW_LINE>LOG.info("Response: " + response.getResponse());<NEW_LINE>} else if ("pingVoid".equals(config.getMethod())) {<NEW_LINE>client.pingVoid(request);<NEW_LINE>}<NEW_LINE>} catch (Exception ex) {<NEW_LINE>LOG.error("Exception: " + ex);<NEW_LINE>}<NEW_LINE>} | response = client.ping(request); |
119,683 | private LensSupport<LensGraphMouse> createMagnifier() {<NEW_LINE>Lens lens = Lens.builder().lensShape(Lens.Shape.RECTANGLE).magnification(3.f).build();<NEW_LINE>lens.setMagnification(2.f);<NEW_LINE>LensMagnificationGraphMousePlugin magnificationPlugin = new LensMagnificationGraphMousePlugin(1.f, 60.f, .2f) {<NEW_LINE><NEW_LINE>// Override to address a bug when using a high resolution mouse wheel.<NEW_LINE>// May be removed when jungrapht-visualization version is updated<NEW_LINE>@Override<NEW_LINE>public void mouseWheelMoved(MouseWheelEvent e) {<NEW_LINE>if (e.getWheelRotation() != 0) {<NEW_LINE>super.mouseWheelMoved(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>MutableTransformer transformer = viewer.getRenderContext().getMultiLayerTransformer().getTransformer(VIEW);<NEW_LINE>MagnifyShapeTransformer shapeTransformer = // this lens' delegate is the viewer's VIEW layer, abandoned above<NEW_LINE>MagnifyShapeTransformer.builder(lens).delegate(transformer).build();<NEW_LINE>LensGraphMouse lensGraphMouse = DefaultLensGraphMouse.builder().<MASK><NEW_LINE>return MagnifyImageLensSupport.builder(viewer).lensTransformer(shapeTransformer).lensGraphMouse(lensGraphMouse).build();<NEW_LINE>} | magnificationPlugin(magnificationPlugin).build(); |
1,140,004 | public void visitPhpFunctionCall(@NotNull FunctionReference reference) {<NEW_LINE>final String functionName = reference.getName();<NEW_LINE>if (functionName != null) {<NEW_LINE>if (relevantAliases.containsKey(functionName) && this.isFromRootNamespace(reference)) {<NEW_LINE>final PsiElement target = NamedElementUtil.getNameIdentifier(reference);<NEW_LINE>if (target != null) {<NEW_LINE>final String <MASK><NEW_LINE>holder.registerProblem(target, String.format(MessagesPresentationUtil.prefixWithEa(messagePattern), functionName, original), ProblemHighlightType.LIKE_DEPRECATED, new TheLocalFix(original));<NEW_LINE>}<NEW_LINE>} else if (deprecatedAliases.containsKey(functionName) && this.isFromRootNamespace(reference)) {<NEW_LINE>final PsiElement target = NamedElementUtil.getNameIdentifier(reference);<NEW_LINE>if (target != null) {<NEW_LINE>holder.registerProblem(target, MessagesPresentationUtil.prefixWithEa(deprecatedAliases.get(functionName)));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | original = relevantAliases.get(functionName); |
1,496,881 | private // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents<NEW_LINE>void initComponents() {<NEW_LINE>java.awt.GridBagConstraints gridBagConstraints;<NEW_LINE>painelRolagem = <MASK><NEW_LINE>console = new javax.swing.JTextArea();<NEW_LINE>setFocusable(false);<NEW_LINE>setOpaque(false);<NEW_LINE>setLayout(new java.awt.GridBagLayout());<NEW_LINE>painelRolagem.setBackground(new java.awt.Color(255, 255, 0));<NEW_LINE>painelRolagem.setBorder(null);<NEW_LINE>// NOI18N<NEW_LINE>painelRolagem.setName("scrollPanelConsole");<NEW_LINE>painelRolagem.setOpaque(false);<NEW_LINE>console.setEditable(false);<NEW_LINE>console.setBackground(new java.awt.Color(230, 230, 230));<NEW_LINE>console.setColumns(20);<NEW_LINE>console.setBorder(javax.swing.BorderFactory.createEmptyBorder(5, 5, 5, 5));<NEW_LINE>// NOI18N<NEW_LINE>console.setName("textAreaConsole");<NEW_LINE>console.setOpaque(false);<NEW_LINE>painelRolagem.setViewportView(console);<NEW_LINE>gridBagConstraints = new java.awt.GridBagConstraints();<NEW_LINE>gridBagConstraints.gridx = 0;<NEW_LINE>gridBagConstraints.gridy = 0;<NEW_LINE>gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;<NEW_LINE>gridBagConstraints.weightx = 1.0;<NEW_LINE>gridBagConstraints.weighty = 1.0;<NEW_LINE>gridBagConstraints.insets = new java.awt.Insets(10, 5, 10, 5);<NEW_LINE>add(painelRolagem, gridBagConstraints);<NEW_LINE>} | new javax.swing.JScrollPane(); |
56,678 | public void testRxFlowableInvoker_get3WithGenericType(Map<String, String> param, StringBuilder ret) {<NEW_LINE>String serverIP = param.get("serverIP");<NEW_LINE>String serverPort = param.get("serverPort");<NEW_LINE>final String threadName = "jaxrs21Thread";<NEW_LINE>ThreadFactory jaxrs21ThreadFactory = Executors.defaultThreadFactory();<NEW_LINE>Thread jaxrs21Thread = jaxrs21ThreadFactory.newThread(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>String runThreadName = Thread.currentThread().getName();<NEW_LINE>if (!(runThreadName.equals(threadName))) {<NEW_LINE>throw new RuntimeException("testRxFlowable_get3WithGenericType: incorrect thread name");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>jaxrs21Thread.setName(threadName);<NEW_LINE>ExecutorService <MASK><NEW_LINE>ClientBuilder cb = ClientBuilder.newBuilder().executorService(executorService);<NEW_LINE>Client c = cb.build();<NEW_LINE>c.register(RxFlowableInvokerProvider.class);<NEW_LINE>WebTarget t = c.target("http://" + serverIP + ":" + serverPort + "/jaxrs21bookstore/JAXRS21bookstore2/rxget3");<NEW_LINE>Builder builder = t.request();<NEW_LINE>builder.accept("application/xml");<NEW_LINE>GenericType<List<JAXRS21Book>> genericResponseType = new GenericType<List<JAXRS21Book>>() {<NEW_LINE>};<NEW_LINE>Flowable<List<JAXRS21Book>> flowable = builder.rx(RxFlowableInvoker.class).get(genericResponseType);<NEW_LINE>final Holder<List<JAXRS21Book>> holder = new Holder<List<JAXRS21Book>>();<NEW_LINE>final CountDownLatch countDownLatch = new CountDownLatch(1);<NEW_LINE>flowable.subscribe(v -> {<NEW_LINE>// OnNext<NEW_LINE>holder.value = v;<NEW_LINE>countDownLatch.countDown();<NEW_LINE>}, throwable -> {<NEW_LINE>// OnError<NEW_LINE>throw new RuntimeException("testRxFlowable_get3WithGenericType: onError " + throwable.getStackTrace());<NEW_LINE>});<NEW_LINE>try {<NEW_LINE>if (!(countDownLatch.await(complexTimeout, TimeUnit.SECONDS))) {<NEW_LINE>throw new RuntimeException("testRxFlowable_get3WithGenericType: Response took too long. Waited " + complexTimeout);<NEW_LINE>}<NEW_LINE>} catch (InterruptedException ex) {<NEW_LINE>ex.printStackTrace();<NEW_LINE>}<NEW_LINE>List<JAXRS21Book> response = holder.value;<NEW_LINE>ret.append(response != null);<NEW_LINE>c.close();<NEW_LINE>} | executorService = Executors.newSingleThreadExecutor(jaxrs21ThreadFactory); |
1,249,045 | public DescribeAvailabilityZonesResult unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>DescribeAvailabilityZonesResult describeAvailabilityZonesResult = new DescribeAvailabilityZonesResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>if (context.isStartOfDocument())<NEW_LINE>targetDepth += 1;<NEW_LINE>while (true) {<NEW_LINE>int xmlEvent = context.nextEvent();<NEW_LINE>if (xmlEvent == XmlPullParser.END_DOCUMENT)<NEW_LINE>return describeAvailabilityZonesResult;<NEW_LINE>if (xmlEvent == XmlPullParser.START_TAG) {<NEW_LINE>if (context.testExpression("availabilityZoneInfo/item", targetDepth)) {<NEW_LINE>describeAvailabilityZonesResult.getAvailabilityZones().add(AvailabilityZoneStaxUnmarshaller.getInstance<MASK><NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent == XmlPullParser.END_TAG) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>return describeAvailabilityZonesResult;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ().unmarshall(context)); |
62,427 | private boolean circuit(V v, int depth, TaskMonitor monitor) throws CancelledException {<NEW_LINE>monitor.checkCanceled();<NEW_LINE>// TODO<NEW_LINE>// Sigh. We are greatly limited in the size of paths we can processes due to the<NEW_LINE>// recursive nature of this algorithm. This should be changed to be non-recursive.<NEW_LINE>if (depth > JAVA_STACK_DEPTH_LIMIT) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>boolean foundCircuit = false;<NEW_LINE>blockedSet.add(v);<NEW_LINE>stack.push(v);<NEW_LINE>Collection<E> outEdges = subGraph.getOutEdges(v);<NEW_LINE>for (E e : outEdges) {<NEW_LINE>V u = e.getEnd();<NEW_LINE>if (u.equals(startVertex)) {<NEW_LINE>outputCircuit();<NEW_LINE>foundCircuit = true;<NEW_LINE>} else if (!blockedSet.contains(u)) {<NEW_LINE>foundCircuit |= circuit(u, depth + 1, monitor);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (foundCircuit) {<NEW_LINE>unblock(v);<NEW_LINE>} else {<NEW_LINE>for (E e : outEdges) {<NEW_LINE><MASK><NEW_LINE>addBackEdge(u, v);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>stack.pop();<NEW_LINE>return foundCircuit;<NEW_LINE>} | V u = e.getEnd(); |
976,475 | public Response create(@Context SecurityContext sc, @ApiParam(value = "Tag object", required = true) @Valid TagBean tag) throws Exception {<NEW_LINE>String operator = sc<MASK><NEW_LINE>TagBean retEntity = new TagBean();<NEW_LINE>if (handlers.containsKey(tag.getTarget_type())) {<NEW_LINE>LOG.debug("Found handler for target type {}", tag.getTarget_type().toString());<NEW_LINE>retEntity = handlers.get(tag.getTarget_type()).createTag(tag, operator);<NEW_LINE>} else {<NEW_LINE>LOG.debug("No handler found for target type {}. Use default", tag.getTarget_type().toString());<NEW_LINE>// Default logic. Ideally each type should write its own handler.<NEW_LINE>// At current time, ignore the target id object existence test. The<NEW_LINE>// handler should do that.<NEW_LINE>tag.setId(CommonUtils.getBase64UUID());<NEW_LINE>tag.setOperator(operator);<NEW_LINE>tag.setCreated_date(System.currentTimeMillis());<NEW_LINE>tagDAO.insert(tag);<NEW_LINE>LOG.info("{} successfully created tag {}", operator, tag.getId());<NEW_LINE>retEntity = tagDAO.getById(tag.getId());<NEW_LINE>}<NEW_LINE>UriBuilder ub = uriInfo.getAbsolutePathBuilder();<NEW_LINE>URI buildUri = ub.path(retEntity.getId()).build();<NEW_LINE>return Response.created(buildUri).entity(retEntity).build();<NEW_LINE>} | .getUserPrincipal().getName(); |
1,380,424 | private void table1Select() {<NEW_LINE>String[] vorlage = new String[ListePsetVorlagen.PGR_MAX_ELEM];<NEW_LINE>for (int i = 0; i < ListePsetVorlagen.PGR_MAX_ELEM; i++) {<NEW_LINE>vorlage[i] = "";<NEW_LINE>}<NEW_LINE>int selectedTableRow = jTableVorlagen.getSelectedRow();<NEW_LINE>if (selectedTableRow >= 0) {<NEW_LINE>int selectedModelRow = jTableVorlagen.convertRowIndexToModel(selectedTableRow);<NEW_LINE>for (int i = 0; i < ListePsetVorlagen.PGR_MAX_ELEM; ++i) {<NEW_LINE>vorlage[i] = jTableVorlagen.getModel().getValueAt(selectedModelRow, i).toString();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>jTextFieldName.setText(vorlage[ListePsetVorlagen.PGR_NAME_NR]);<NEW_LINE>jTextFieldBs.setText(vorlage[ListePsetVorlagen.PGR_BS_NR]);<NEW_LINE>jTextFieldUrl.setText<MASK><NEW_LINE>jTextAreaBeschreibung.setText(vorlage[ListePsetVorlagen.PGR_BESCHREIBUNG_NR]);<NEW_LINE>} | (vorlage[ListePsetVorlagen.PGR_URL_NR]); |
975,204 | /*package*/<NEW_LINE>String generateAuthorizationHeader(String method, String url, HttpParameter[] params, String nonce, String timestamp, OAuthToken otoken) {<NEW_LINE>if (null == params) {<NEW_LINE>params = new HttpParameter[0];<NEW_LINE>}<NEW_LINE>List<HttpParameter> oauthHeaderParams = new ArrayList<HttpParameter>(5);<NEW_LINE>oauthHeaderParams.add(new HttpParameter("oauth_consumer_key", consumerKey));<NEW_LINE>oauthHeaderParams.add(OAUTH_SIGNATURE_METHOD);<NEW_LINE>oauthHeaderParams.add(new HttpParameter("oauth_timestamp", timestamp));<NEW_LINE>oauthHeaderParams.add(<MASK><NEW_LINE>oauthHeaderParams.add(new HttpParameter("oauth_version", "1.0"));<NEW_LINE>if (otoken != null) {<NEW_LINE>oauthHeaderParams.add(new HttpParameter("oauth_token", otoken.getToken()));<NEW_LINE>}<NEW_LINE>List<HttpParameter> signatureBaseParams = new ArrayList<HttpParameter>(oauthHeaderParams.size() + params.length);<NEW_LINE>signatureBaseParams.addAll(oauthHeaderParams);<NEW_LINE>if (!HttpParameter.containsFile(params)) {<NEW_LINE>signatureBaseParams.addAll(toParamList(params));<NEW_LINE>}<NEW_LINE>parseGetParameters(url, signatureBaseParams);<NEW_LINE>StringBuilder base = new StringBuilder(method).append("&").append(HttpParameter.encode(constructRequestURL(url))).append("&");<NEW_LINE>base.append(HttpParameter.encode(normalizeRequestParameters(signatureBaseParams)));<NEW_LINE>String oauthBaseString = base.toString();<NEW_LINE>logger.debug("OAuth base string: ", oauthBaseString);<NEW_LINE>String signature = generateSignature(oauthBaseString, otoken);<NEW_LINE>logger.debug("OAuth signature: ", signature);<NEW_LINE>oauthHeaderParams.add(new HttpParameter("oauth_signature", signature));<NEW_LINE>// http://oauth.net/core/1.0/#rfc.section.9.1.1<NEW_LINE>if (realm != null) {<NEW_LINE>oauthHeaderParams.add(new HttpParameter("realm", realm));<NEW_LINE>}<NEW_LINE>return "OAuth " + encodeParameters(oauthHeaderParams, ",", true);<NEW_LINE>} | new HttpParameter("oauth_nonce", nonce)); |
368,825 | private void closeInvalidZkClient(Map<String, ZkCluster> newClusterMap) {<NEW_LINE>Iterator<Entry<String, ZkCluster>> iterator = zkClusterMap.entrySet().iterator();<NEW_LINE>while (iterator.hasNext()) {<NEW_LINE>Entry<String, ZkCluster> next = iterator.next();<NEW_LINE>String zkClusterKey = next.getKey();<NEW_LINE>ZkCluster zkCluster = next.getValue();<NEW_LINE>if (!newClusterMap.containsKey(zkClusterKey)) {<NEW_LINE>iterator.remove();<NEW_LINE>closeZkCluster(zkCluster);<NEW_LINE>} else {<NEW_LINE>ZkCluster newZkCluster = newClusterMap.get(zkClusterKey);<NEW_LINE>if (zkCluster.equals(newZkCluster)) {<NEW_LINE>newClusterMap.put(zkClusterKey, zkCluster);<NEW_LINE>} else if (zkCluster.equalsNoNeedReconnect(newZkCluster)) {<NEW_LINE>zkCluster.setDescription(newZkCluster.getDescription());<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>iterator.remove();<NEW_LINE>closeZkCluster(zkCluster);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | newClusterMap.put(zkClusterKey, zkCluster); |
1,844,282 | private Addon fromAddonEntry(AddonEntryDTO addonEntry) {<NEW_LINE>String fullId = ADDON_ID_PREFIX + addonEntry.id;<NEW_LINE>boolean installed = addonHandlers.stream().anyMatch(handler -> handler.supports(addonEntry.type, addonEntry.contentType) && handler.isInstalled(fullId));<NEW_LINE>Map<String, Object> properties = new HashMap<>();<NEW_LINE>if (addonEntry.url.endsWith(".jar")) {<NEW_LINE>properties.put("jar_download_url", addonEntry.url);<NEW_LINE>} else if (addonEntry.url.endsWith(".kar")) {<NEW_LINE>properties.put("kar_download_url", addonEntry.url);<NEW_LINE>} else if (addonEntry.url.endsWith(".json")) {<NEW_LINE>properties.<MASK><NEW_LINE>} else if (addonEntry.url.endsWith(".yaml")) {<NEW_LINE>properties.put("yaml_download_url", addonEntry.url);<NEW_LINE>}<NEW_LINE>boolean compatible = true;<NEW_LINE>try {<NEW_LINE>compatible = coreVersion.inRange(addonEntry.compatibleVersions);<NEW_LINE>} catch (IllegalArgumentException e) {<NEW_LINE>logger.debug("Failed to determine compatibility for addon {}: {}", addonEntry.id, e.getMessage());<NEW_LINE>}<NEW_LINE>return Addon.create(fullId).withType(addonEntry.type).withInstalled(installed).withDetailedDescription(addonEntry.description).withContentType(addonEntry.contentType).withAuthor(addonEntry.author).withVersion(addonEntry.version).withLabel(addonEntry.title).withCompatible(compatible).withMaturity(addonEntry.maturity).withProperties(properties).withLink(addonEntry.link).withImageLink(addonEntry.imageUrl).withConfigDescriptionURI(addonEntry.configDescriptionURI).withLoggerPackages(addonEntry.loggerPackages).build();<NEW_LINE>} | put("json_download_url", addonEntry.url); |
1,320,814 | public static GetPatentPlanDetailListResponse unmarshall(GetPatentPlanDetailListResponse getPatentPlanDetailListResponse, UnmarshallerContext _ctx) {<NEW_LINE>getPatentPlanDetailListResponse.setRequestId(_ctx.stringValue("GetPatentPlanDetailListResponse.RequestId"));<NEW_LINE>getPatentPlanDetailListResponse.setPageNum(_ctx.integerValue("GetPatentPlanDetailListResponse.PageNum"));<NEW_LINE>getPatentPlanDetailListResponse.setSuccess(_ctx.booleanValue("GetPatentPlanDetailListResponse.Success"));<NEW_LINE>getPatentPlanDetailListResponse.setTotalItemNum(_ctx.integerValue("GetPatentPlanDetailListResponse.TotalItemNum"));<NEW_LINE>getPatentPlanDetailListResponse.setPageSize(_ctx.integerValue("GetPatentPlanDetailListResponse.PageSize"));<NEW_LINE>getPatentPlanDetailListResponse.setTotalPageNum(_ctx.integerValue("GetPatentPlanDetailListResponse.TotalPageNum"));<NEW_LINE>List<DataItem> data = new ArrayList<DataItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("GetPatentPlanDetailListResponse.Data.Length"); i++) {<NEW_LINE>DataItem dataItem = new DataItem();<NEW_LINE>dataItem.setType(_ctx.integerValue("GetPatentPlanDetailListResponse.Data[" + i + "].Type"));<NEW_LINE>dataItem.setOwner(_ctx.stringValue("GetPatentPlanDetailListResponse.Data[" + i + "].Owner"));<NEW_LINE>dataItem.setPaidDate(_ctx.stringValue("GetPatentPlanDetailListResponse.Data[" + i + "].PaidDate"));<NEW_LINE>dataItem.setEndPayDate(_ctx.stringValue("GetPatentPlanDetailListResponse.Data[" + i + "].EndPayDate"));<NEW_LINE>dataItem.setPlanPayDate(_ctx.stringValue("GetPatentPlanDetailListResponse.Data[" + i + "].PlanPayDate"));<NEW_LINE>dataItem.setSoldStatus(_ctx.integerValue("GetPatentPlanDetailListResponse.Data[" + i + "].SoldStatus"));<NEW_LINE>dataItem.setApplyNumber(_ctx.stringValue("GetPatentPlanDetailListResponse.Data[" + i + "].ApplyNumber"));<NEW_LINE>dataItem.setGmtExpireDate(_ctx.stringValue("GetPatentPlanDetailListResponse.Data[" + i + "].GmtExpireDate"));<NEW_LINE>dataItem.setBizId(_ctx.stringValue("GetPatentPlanDetailListResponse.Data[" + i + "].BizId"));<NEW_LINE>dataItem.setLabel(_ctx.integerValue("GetPatentPlanDetailListResponse.Data[" + i + "].Label"));<NEW_LINE>dataItem.setPlanId(_ctx.longValue("GetPatentPlanDetailListResponse.Data[" + i + "].PlanId"));<NEW_LINE>dataItem.setYear(_ctx.integerValue("GetPatentPlanDetailListResponse.Data[" + i + "].Year"));<NEW_LINE>dataItem.setPlanDetailId(_ctx.longValue<MASK><NEW_LINE>dataItem.setPayStatus(_ctx.integerValue("GetPatentPlanDetailListResponse.Data[" + i + "].PayStatus"));<NEW_LINE>dataItem.setPatentStatus(_ctx.stringValue("GetPatentPlanDetailListResponse.Data[" + i + "].PatentStatus"));<NEW_LINE>dataItem.setAgency(_ctx.stringValue("GetPatentPlanDetailListResponse.Data[" + i + "].Agency"));<NEW_LINE>dataItem.setDiscount(_ctx.integerValue("GetPatentPlanDetailListResponse.Data[" + i + "].Discount"));<NEW_LINE>dataItem.setUidAgreement(_ctx.booleanValue("GetPatentPlanDetailListResponse.Data[" + i + "].UidAgreement"));<NEW_LINE>dataItem.setPatentDiscard(_ctx.booleanValue("GetPatentPlanDetailListResponse.Data[" + i + "].PatentDiscard"));<NEW_LINE>dataItem.setName(_ctx.stringValue("GetPatentPlanDetailListResponse.Data[" + i + "].Name"));<NEW_LINE>dataItem.setUpdateTime(_ctx.longValue("GetPatentPlanDetailListResponse.Data[" + i + "].UpdateTime"));<NEW_LINE>dataItem.setPlanFee(_ctx.integerValue("GetPatentPlanDetailListResponse.Data[" + i + "].PlanFee"));<NEW_LINE>data.add(dataItem);<NEW_LINE>}<NEW_LINE>getPatentPlanDetailListResponse.setData(data);<NEW_LINE>return getPatentPlanDetailListResponse;<NEW_LINE>} | ("GetPatentPlanDetailListResponse.Data[" + i + "].PlanDetailId")); |
455,489 | ActionResult<List<Wo>> execute(EffectivePerson effectivePerson, String applicationId) throws Exception {<NEW_LINE>ActionResult<List<Wo>> result = new ActionResult<>();<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE><MASK><NEW_LINE>Application application = emc.find(applicationId, Application.class, ExceptionWhen.not_found);<NEW_LINE>if (null == application) {<NEW_LINE>throw new ExceptionApplicationNotExist(applicationId);<NEW_LINE>}<NEW_LINE>if (!business.editable(effectivePerson, application)) {<NEW_LINE>throw new ExceptionApplicationAccessDenied(effectivePerson.getDistinguishedName(), application.getName(), application.getId());<NEW_LINE>}<NEW_LINE>List<Process> listProcess = new ArrayList<>();<NEW_LINE>List<String> editions = business.process().listProcessDisableEdition(applicationId);<NEW_LINE>for (String edition : editions) {<NEW_LINE>listProcess.add(business.process().listProcessEditionObject(applicationId, edition).get(0));<NEW_LINE>}<NEW_LINE>List<Wo> wos = Wo.copier.copy(listProcess);<NEW_LINE>wos = business.process().sort(wos);<NEW_LINE>result.setData(wos);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>} | Business business = new Business(emc); |
1,724,188 | private QueryResults<BackendEntry> queryByName(ConditionQuery query) {<NEW_LINE>if (!this.needIndexForName()) {<NEW_LINE>return super.query(query);<NEW_LINE>}<NEW_LINE>IndexLabel il = IndexLabel.label(query.resultType());<NEW_LINE>String name = (String) query.condition(HugeKeys.NAME);<NEW_LINE>E.checkState(name != null, "The name in condition can't be null " + "when querying schema by name");<NEW_LINE>ConditionQuery indexQuery;<NEW_LINE>indexQuery = new <MASK><NEW_LINE>indexQuery.eq(HugeKeys.FIELD_VALUES, name);<NEW_LINE>indexQuery.eq(HugeKeys.INDEX_LABEL_ID, il.id());<NEW_LINE>IdQuery idQuery = new IdQuery(query.resultType(), query);<NEW_LINE>Iterator<BackendEntry> entries = super.query(indexQuery).iterator();<NEW_LINE>try {<NEW_LINE>while (entries.hasNext()) {<NEW_LINE>HugeIndex index = this.serializer.readIndex(graph(), indexQuery, entries.next());<NEW_LINE>idQuery.query(index.elementIds());<NEW_LINE>Query.checkForceCapacity(idQuery.idsSize());<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>CloseableIterator.closeIterator(entries);<NEW_LINE>}<NEW_LINE>if (idQuery.ids().isEmpty()) {<NEW_LINE>return QueryResults.empty();<NEW_LINE>}<NEW_LINE>assert idQuery.idsSize() == 1 : idQuery.ids();<NEW_LINE>if (idQuery.idsSize() > 1) {<NEW_LINE>LOG.warn("Multiple ids are found with same name '{}': {}", name, idQuery.ids());<NEW_LINE>}<NEW_LINE>return super.query(idQuery);<NEW_LINE>} | ConditionQuery(HugeType.SECONDARY_INDEX, query); |
1,029,352 | public DestinationFileWriter create(final S3DestinationConfig config, final AmazonS3 s3Client, final ConfiguredAirbyteStream configuredStream, final Timestamp uploadTimestamp) throws Exception {<NEW_LINE>final S3Format format = config.getFormatConfig().getFormat();<NEW_LINE>if (format == S3Format.AVRO || format == S3Format.PARQUET) {<NEW_LINE>final AirbyteStream stream = configuredStream.getStream();<NEW_LINE>LOGGER.info("Json schema for stream {}: {}", stream.getName(), stream.getJsonSchema());<NEW_LINE><MASK><NEW_LINE>final Schema avroSchema = schemaConverter.getAvroSchema(stream.getJsonSchema(), stream.getName(), stream.getNamespace());<NEW_LINE>LOGGER.info("Avro schema for stream {}: {}", stream.getName(), avroSchema.toString(false));<NEW_LINE>if (format == S3Format.AVRO) {<NEW_LINE>return new S3AvroWriter(config, s3Client, configuredStream, uploadTimestamp, avroSchema, AvroConstants.JSON_CONVERTER);<NEW_LINE>} else {<NEW_LINE>return new S3ParquetWriter(config, s3Client, configuredStream, uploadTimestamp, avroSchema, AvroConstants.JSON_CONVERTER);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (format == S3Format.CSV) {<NEW_LINE>return new S3CsvWriter.Builder(config, s3Client, configuredStream, uploadTimestamp).build();<NEW_LINE>}<NEW_LINE>if (format == S3Format.JSONL) {<NEW_LINE>return new S3JsonlWriter(config, s3Client, configuredStream, uploadTimestamp);<NEW_LINE>}<NEW_LINE>throw new RuntimeException("Unexpected S3 destination format: " + format);<NEW_LINE>} | final JsonToAvroSchemaConverter schemaConverter = new JsonToAvroSchemaConverter(); |
146,059 | public void update() {<NEW_LINE>while (unprocessedMethods.hasNext()) {<NEW_LINE>MethodOrMethodContext m = unprocessedMethods.next();<NEW_LINE>Filter filter = new Filter(new EdgePredicate() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean want(Edge e) {<NEW_LINE>if (e.kind() == Kind.CLINIT)<NEW_LINE>return false;<NEW_LINE>else if (e.kind() == Kind.VIRTUAL) {<NEW_LINE>// We only filter calls to this.*<NEW_LINE>if (!e.src().isStatic() && e.srcStmt().getInvokeExpr() instanceof InstanceInvokeExpr) {<NEW_LINE>SootMethod refMethod = e.srcStmt()<MASK><NEW_LINE>InstanceInvokeExpr iinv = (InstanceInvokeExpr) e.srcStmt().getInvokeExpr();<NEW_LINE>if (iinv.getBase() == e.src().getActiveBody().getThisLocal()) {<NEW_LINE>// If our parent class P has an abstract<NEW_LINE>// method foo() and the lifecycle<NEW_LINE>// class L overrides foo(), make sure that<NEW_LINE>// all calls to P.foo() in the<NEW_LINE>// context of L only go to L.foo().<NEW_LINE>SootClass calleeClass = refMethod.getDeclaringClass();<NEW_LINE>if (Scene.v().getFastHierarchy().isSubclass(originalComponent, calleeClass)) {<NEW_LINE>SootClass targetClass = e.getTgt().method().getDeclaringClass();<NEW_LINE>return targetClass == originalComponent || Scene.v().getFastHierarchy().isSubclass(targetClass, originalComponent);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// We do not expect callback registrations in<NEW_LINE>// any<NEW_LINE>// calls to system classes<NEW_LINE>if (SystemClassHandler.v().isClassInSystemPackage(refMethod.getDeclaringClass().getName()))<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} else if (config.getCallbackConfig().getFilterThreadCallbacks()) {<NEW_LINE>// Check for thread call edges<NEW_LINE>if (e.kind() == Kind.THREAD || e.kind() == Kind.EXECUTOR)<NEW_LINE>return false;<NEW_LINE>// Some apps have a custom layer for managing<NEW_LINE>// threads,<NEW_LINE>// so we need a more generic model<NEW_LINE>if (e.tgt().getName().equals("run"))<NEW_LINE>if (Scene.v().getFastHierarchy().canStoreType(e.tgt().getDeclaringClass().getType(), RefType.v("java.lang.Runnable")))<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>Iterator<Edge> targets = filter.wrap(Scene.v().getCallGraph().edgesOutOf(m));<NEW_LINE>addMethods(new Targets(targets));<NEW_LINE>}<NEW_LINE>} | .getInvokeExpr().getMethod(); |
1,217,521 | public void loadDynamicClasses() {<NEW_LINE>final ArrayList<SootClass> <MASK><NEW_LINE>final Options opts = Options.v();<NEW_LINE>final Map<String, List<String>> temp = new HashMap<>();<NEW_LINE>temp.put(null, opts.dynamic_class());<NEW_LINE>final ModulePathSourceLocator msloc = ModulePathSourceLocator.v();<NEW_LINE>for (String path : opts.dynamic_dir()) {<NEW_LINE>temp.putAll(msloc.getClassUnderModulePath(path));<NEW_LINE>}<NEW_LINE>final SourceLocator sloc = SourceLocator.v();<NEW_LINE>for (String pkg : opts.dynamic_package()) {<NEW_LINE>temp.get(null).addAll(sloc.classesInDynamicPackage(pkg));<NEW_LINE>}<NEW_LINE>for (Map.Entry<String, List<String>> entry : temp.entrySet()) {<NEW_LINE>for (String className : entry.getValue()) {<NEW_LINE>dynamicClasses.add(loadClassAndSupport(className, Optional.fromNullable(entry.getKey())));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// remove non-concrete classes that may accidentally have been loaded<NEW_LINE>for (Iterator<SootClass> iterator = dynamicClasses.iterator(); iterator.hasNext(); ) {<NEW_LINE>SootClass c = iterator.next();<NEW_LINE>if (!c.isConcrete()) {<NEW_LINE>if (opts.verbose()) {<NEW_LINE>logger.warn("dynamic class " + c.getName() + " is abstract or an interface, and it will not be considered.");<NEW_LINE>}<NEW_LINE>iterator.remove();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>this.dynamicClasses = dynamicClasses;<NEW_LINE>} | dynamicClasses = new ArrayList<>(); |
1,220,938 | public ASTNode visitAlterTable(final AlterTableContext ctx) {<NEW_LINE>PostgreSQLAlterTableStatement result = new PostgreSQLAlterTableStatement();<NEW_LINE>result.setTable((SimpleTableSegment) visit(ctx.tableNameClause().tableName()));<NEW_LINE>if (null != ctx.alterDefinitionClause()) {<NEW_LINE>for (AlterDefinitionSegment each : ((CollectionValue<AlterDefinitionSegment>) visit(ctx.alterDefinitionClause())).getValue()) {<NEW_LINE>if (each instanceof AddColumnDefinitionSegment) {<NEW_LINE>result.getAddColumnDefinitions().add((AddColumnDefinitionSegment) each);<NEW_LINE>} else if (each instanceof ModifyColumnDefinitionSegment) {<NEW_LINE>result.getModifyColumnDefinitions()<MASK><NEW_LINE>} else if (each instanceof DropColumnDefinitionSegment) {<NEW_LINE>result.getDropColumnDefinitions().add((DropColumnDefinitionSegment) each);<NEW_LINE>} else if (each instanceof AddConstraintDefinitionSegment) {<NEW_LINE>result.getAddConstraintDefinitions().add((AddConstraintDefinitionSegment) each);<NEW_LINE>} else if (each instanceof ValidateConstraintDefinitionSegment) {<NEW_LINE>result.getValidateConstraintDefinitions().add((ValidateConstraintDefinitionSegment) each);<NEW_LINE>} else if (each instanceof ModifyConstraintDefinitionSegment) {<NEW_LINE>result.getModifyConstraintDefinitions().add((ModifyConstraintDefinitionSegment) each);<NEW_LINE>} else if (each instanceof DropConstraintDefinitionSegment) {<NEW_LINE>result.getDropConstraintDefinitions().add((DropConstraintDefinitionSegment) each);<NEW_LINE>} else if (each instanceof RenameTableDefinitionSegment) {<NEW_LINE>result.setRenameTable(((RenameTableDefinitionSegment) each).getRenameTable());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | .add((ModifyColumnDefinitionSegment) each); |
1,800,105 | protected void render(ItemStack stack, SymmetryWandModel model, PartialItemModelRenderer renderer, ItemTransforms.TransformType transformType, PoseStack ms, MultiBufferSource buffer, int light, int overlay) {<NEW_LINE>float worldTime = AnimationTickHolder.getRenderTime() / 20;<NEW_LINE>int maxLight = LightTexture.FULL_BRIGHT;<NEW_LINE>renderer.render(<MASK><NEW_LINE>renderer.renderSolidGlowing(model.getPartial("core"), maxLight);<NEW_LINE>renderer.renderGlowing(model.getPartial("core_glow"), maxLight);<NEW_LINE>float floating = Mth.sin(worldTime) * .05f;<NEW_LINE>float angle = worldTime * -10 % 360;<NEW_LINE>ms.translate(0, floating, 0);<NEW_LINE>ms.mulPose(Vector3f.YP.rotationDegrees(angle));<NEW_LINE>renderer.renderGlowing(model.getPartial("bits"), maxLight);<NEW_LINE>} | model.getOriginalModel(), light); |
928,429 | protected String extractImportsFromType(TypeSymbol typeSymbol, Set<Identifier> imports) {<NEW_LINE>String text = typeSymbol.signature();<NEW_LINE>StringBuilder newText = new StringBuilder();<NEW_LINE>Matcher matcher = FULLY_QUALIFIED_MODULE_ID_PATTERN.matcher(text);<NEW_LINE>int nextStart = 0;<NEW_LINE>// Matching Fully-Qualified-Module-IDs (eg.`abc/mod1:1.0.0`)<NEW_LINE>// Purpose is to transform `int|abc/mod1:1.0.0:Person` into `int|mod1:Person` or `int|Person`<NEW_LINE>// identifying the potential imports required.<NEW_LINE>while (matcher.find()) {<NEW_LINE>// Append up-to start of the match<NEW_LINE>newText.append(text, nextStart, matcher.start(1));<NEW_LINE>// Identify org name and module names<NEW_LINE>String orgName = matcher.group(1);<NEW_LINE>List<String> moduleNames = Arrays.asList(matcher.group(2).split("\\."));<NEW_LINE>for (int i = 1; i < moduleNames.size(); i++) {<NEW_LINE>if (BALLERINA_KEYWORDS.contains(moduleNames.get(i))) {<NEW_LINE>moduleNames.set(i, QUOTE + moduleNames.get(i));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>QuotedImport quotedImport = new QuotedImport(orgName, moduleNames);<NEW_LINE>// Add the import required<NEW_LINE>Identifier quotedPrefix = addImport(quotedImport);<NEW_LINE>imports.add(quotedPrefix);<NEW_LINE>// Update next-start position<NEW_LINE>newText.append(quotedPrefix.getName()).append(":");<NEW_LINE>nextStart = matcher.end(3) + 1;<NEW_LINE>}<NEW_LINE>// Append the remaining<NEW_LINE>if (nextStart != 0) {<NEW_LINE>newText.append<MASK><NEW_LINE>}<NEW_LINE>return newText.length() > 0 ? newText.toString() : text;<NEW_LINE>} | (text.substring(nextStart)); |
800,915 | public boolean performFinish() {<NEW_LINE>final String sourceURI = cloneSource.getSource();<NEW_LINE>final String dest = cloneSource.getDestination();<NEW_LINE>try {<NEW_LINE>getContainer().run(true, true, new IRunnableWithProgress() {<NEW_LINE><NEW_LINE>public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {<NEW_LINE>CloneJob job = new CloneJob(sourceURI, dest);<NEW_LINE>IStatus status = job.run(monitor);<NEW_LINE>if (!status.isOK()) {<NEW_LINE>if (status instanceof ProcessStatus) {<NEW_LINE>ProcessStatus ps = (ProcessStatus) status;<NEW_LINE>String stderr = ps.getStdErr();<NEW_LINE>throw new InvocationTargetException(new CoreException(new Status(status.getSeverity(), status.getPlugin(), stderr)));<NEW_LINE>}<NEW_LINE>throw new InvocationTargetException(new CoreException(status));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (InvocationTargetException e) {<NEW_LINE>if (e.getCause() instanceof CoreException) {<NEW_LINE>CoreException ce = <MASK><NEW_LINE>MessageDialog.openError(getShell(), Messages.CloneWizard_CloneFailedTitle, ce.getMessage());<NEW_LINE>} else {<NEW_LINE>IdeLog.logError(GitUIPlugin.getDefault(), e, IDebugScopes.DEBUG);<NEW_LINE>}<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>IdeLog.logError(GitUIPlugin.getDefault(), e, IDebugScopes.DEBUG);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | (CoreException) e.getCause(); |
415,032 | public List<Integer> mostVisited(int n, int[] rounds) {<NEW_LINE>int[] ans = new int[n];<NEW_LINE>for (int i = 0; i < rounds.length; i++) {<NEW_LINE>rounds[i]--;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>for (int i = 0; i < rounds.length - 1; i++) {<NEW_LINE>int start = rounds[i];<NEW_LINE>int end = rounds[i + 1];<NEW_LINE>if (end <= start) {<NEW_LINE>end += n;<NEW_LINE>}<NEW_LINE>for (int j = start + 1; j <= end; j++) {<NEW_LINE>ans[j % n]++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int max = Arrays.stream(ans).max().orElse(-1);<NEW_LINE>List<Integer> list = new ArrayList<>();<NEW_LINE>for (int i = 0; i < ans.length; i++) {<NEW_LINE>if (ans[i] == max) {<NEW_LINE>list.add(i + 1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return list;<NEW_LINE>} | ans[rounds[0]]++; |
1,573,905 | public static CompiledRule compile(Rule rule, HtmlSpanner spanner) {<NEW_LINE>Log.d("CSSCompiler", "Compiling rule " + rule);<NEW_LINE>List<List<TagNodeMatcher>> matchers = new ArrayList<List<TagNodeMatcher>>();<NEW_LINE>List<StyleUpdater> styleUpdaters = new ArrayList<StyleUpdater>();<NEW_LINE>for (Selector selector : rule.getSelectors()) {<NEW_LINE>List<CSSCompiler.TagNodeMatcher> selMatchers = CSSCompiler.createMatchersFromSelector(selector);<NEW_LINE>matchers.add(selMatchers);<NEW_LINE>}<NEW_LINE>Style blank = new Style();<NEW_LINE>for (PropertyValue propertyValue : rule.getPropertyValues()) {<NEW_LINE>CSSCompiler.StyleUpdater updater = CSSCompiler.getStyleUpdater(propertyValue.getProperty(<MASK><NEW_LINE>if (updater != null) {<NEW_LINE>styleUpdaters.add(updater);<NEW_LINE>blank = updater.updateStyle(blank, spanner);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Log.d("CSSCompiler", "Compiled rule: " + blank);<NEW_LINE>String asText = rule.toString();<NEW_LINE>return new CompiledRule(spanner, matchers, styleUpdaters, asText);<NEW_LINE>} | ), propertyValue.getValue()); |
532,314 | protected int diffSynchronized(JCSynchronized oldT, JCSynchronized newT, int[] bounds) {<NEW_LINE>int localPointer = bounds[0];<NEW_LINE>// lock<NEW_LINE>int[] lockBounds = getBounds(oldT.lock);<NEW_LINE>copyTo(localPointer, lockBounds[0]);<NEW_LINE>localPointer = diffTree(oldT.lock, newT.lock, lockBounds);<NEW_LINE>// body<NEW_LINE>int[] bodyBounds = getBounds(oldT.body);<NEW_LINE>copyTo(localPointer, bodyBounds[0]);<NEW_LINE>int oldIndent = newT.body.hasTag(Tag.BLOCK) ? -1 : printer.indent();<NEW_LINE>localPointer = diffTree(oldT.body, newT.body, bodyBounds);<NEW_LINE>if (!newT.body.hasTag(Tag.BLOCK))<NEW_LINE>printer.undent(oldIndent);<NEW_LINE>copyTo<MASK><NEW_LINE>return bounds[1];<NEW_LINE>} | (localPointer, bounds[1]); |
55,541 | public void start() throws InterruptedException {<NEW_LINE>long startTimeMs = time.milliseconds();<NEW_LINE>try {<NEW_LINE>logger.info("Starting storage manager");<NEW_LINE>List<Thread> startupThreads = new ArrayList<>();<NEW_LINE>for (final DiskManager diskManager : diskToDiskManager.values()) {<NEW_LINE>Thread thread = Utils.newThread("disk-manager-startup-" + diskManager.getDisk(), () -> {<NEW_LINE>try {<NEW_LINE>diskManager.start();<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>Thread.currentThread().interrupt();<NEW_LINE>logger.error("Disk manager startup thread interrupted for disk {}", diskManager.getDisk(), e);<NEW_LINE>}<NEW_LINE>}, false);<NEW_LINE>thread.start();<NEW_LINE>startupThreads.add(thread);<NEW_LINE>}<NEW_LINE>for (Thread startupThread : startupThreads) {<NEW_LINE>startupThread.join();<NEW_LINE>}<NEW_LINE>metrics.initializeCompactionThreadsTracker(<MASK><NEW_LINE>if (clusterParticipants != null) {<NEW_LINE>clusterParticipants.forEach(participant -> {<NEW_LINE>participant.registerPartitionStateChangeListener(StateModelListenerType.StorageManagerListener, new PartitionStateChangeListenerImpl());<NEW_LINE>participant.setInitialLocalPartitions(partitionNameToReplicaId.keySet());<NEW_LINE>});<NEW_LINE>}<NEW_LINE>diskToDiskManager.values().forEach(diskManager -> unexpectedDirs.addAll(diskManager.getUnexpectedDirs()));<NEW_LINE>logger.info("Starting storage manager complete");<NEW_LINE>} finally {<NEW_LINE>metrics.storageManagerStartTimeMs.update(time.milliseconds() - startTimeMs);<NEW_LINE>}<NEW_LINE>} | this, diskToDiskManager.size()); |
1,500,826 | public void createBeforeUnloadDialog(WebView view, String message, final JsResult result, String responseMessage, String confirmButtonTitle, String cancelButtonTitle) {<NEW_LINE>String alertMessage = (responseMessage != null && !responseMessage.isEmpty()) ? responseMessage : message;<NEW_LINE>DialogInterface.OnClickListener confirmClickListener = new DialogInterface.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(DialogInterface dialog, int which) {<NEW_LINE>result.confirm();<NEW_LINE>dialog.dismiss();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>DialogInterface.OnClickListener cancelClickListener = new DialogInterface.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(DialogInterface dialog, int which) {<NEW_LINE>result.cancel();<NEW_LINE>dialog.dismiss();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>Activity activity = inAppBrowserDelegate != null ? inAppBrowserDelegate<MASK><NEW_LINE>AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(activity, R.style.Theme_AppCompat_Dialog_Alert);<NEW_LINE>alertDialogBuilder.setMessage(alertMessage);<NEW_LINE>if (confirmButtonTitle != null && !confirmButtonTitle.isEmpty()) {<NEW_LINE>alertDialogBuilder.setPositiveButton(confirmButtonTitle, confirmClickListener);<NEW_LINE>} else {<NEW_LINE>alertDialogBuilder.setPositiveButton(android.R.string.ok, confirmClickListener);<NEW_LINE>}<NEW_LINE>if (cancelButtonTitle != null && !cancelButtonTitle.isEmpty()) {<NEW_LINE>alertDialogBuilder.setNegativeButton(cancelButtonTitle, cancelClickListener);<NEW_LINE>} else {<NEW_LINE>alertDialogBuilder.setNegativeButton(android.R.string.cancel, cancelClickListener);<NEW_LINE>}<NEW_LINE>alertDialogBuilder.setOnCancelListener(new DialogInterface.OnCancelListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onCancel(DialogInterface dialog) {<NEW_LINE>result.cancel();<NEW_LINE>dialog.dismiss();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>AlertDialog alertDialog = alertDialogBuilder.create();<NEW_LINE>alertDialog.show();<NEW_LINE>} | .getActivity() : plugin.activity; |
372,730 | public void buildDestinationRow(@NonNull View view, String timeText, final Spannable title, Spannable secondaryText, LatLon location, LinearLayout imagesContainer, OnClickListener onClickListener) {<NEW_LINE>OsmandApplication app = requireMyApplication();<NEW_LINE>FrameLayout baseItemView = new FrameLayout(view.getContext());<NEW_LINE>FrameLayout.LayoutParams baseViewLayoutParams = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);<NEW_LINE>baseItemView.setLayoutParams(baseViewLayoutParams);<NEW_LINE>LinearLayout baseView = new LinearLayout(view.getContext());<NEW_LINE>baseView.setOrientation(LinearLayout.VERTICAL);<NEW_LINE>baseView.setLayoutParams(baseViewLayoutParams);<NEW_LINE>baseView.setGravity(Gravity.END);<NEW_LINE>baseView.setBackgroundResource(AndroidUtils.resolveAttribute(view.getContext(), android.R.attr.selectableItemBackground));<NEW_LINE>baseItemView.addView(baseView);<NEW_LINE>LinearLayout ll = buildHorizontalContainerView(view.getContext(), 48, new OnLongClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean onLongClick(View v) {<NEW_LINE>copyToClipboard(title.toString(), v.getContext());<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>baseView.addView(ll);<NEW_LINE>Drawable destinationIcon = app.getUIUtilities().getIcon(R.drawable.list_destination);<NEW_LINE>ImageView iconView = new ImageView(view.getContext());<NEW_LINE>iconView.setImageDrawable(destinationIcon);<NEW_LINE>FrameLayout.LayoutParams imageViewLayoutParams = new FrameLayout.LayoutParams(dpToPx(<MASK><NEW_LINE>iconView.setLayoutParams(imageViewLayoutParams);<NEW_LINE>iconView.setScaleType(ImageView.ScaleType.CENTER_INSIDE);<NEW_LINE>if (imagesContainer != null) {<NEW_LINE>imagesContainer.addView(iconView);<NEW_LINE>} else {<NEW_LINE>AndroidUtils.setMargins(imageViewLayoutParams, dpToPx(16), 0, dpToPx(24), 0);<NEW_LINE>baseItemView.addView(iconView);<NEW_LINE>}<NEW_LINE>LinearLayout llText = buildTextContainerView(view.getContext());<NEW_LINE>ll.addView(llText);<NEW_LINE>buildDescriptionView(secondaryText, llText, 8, 0);<NEW_LINE>buildTitleView(title, llText);<NEW_LINE>if (location != null) {<NEW_LINE>if (!TextUtils.isEmpty(destinationStreetStr)) {<NEW_LINE>if (!title.toString().equals(destinationStreetStr)) {<NEW_LINE>buildDescriptionView(new SpannableString(destinationStreetStr), llText, 4, 4);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>updateDestinationStreetName(location);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!TextUtils.isEmpty(timeText)) {<NEW_LINE>TextView timeView = new TextView(view.getContext());<NEW_LINE>FrameLayout.LayoutParams timeViewParams = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);<NEW_LINE>timeViewParams.gravity = Gravity.END | Gravity.TOP;<NEW_LINE>AndroidUtils.setMargins(timeViewParams, 0, dpToPx(8), 0, 0);<NEW_LINE>timeView.setLayoutParams(timeViewParams);<NEW_LINE>AndroidUtils.setPadding(timeView, 0, 0, dpToPx(16), 0);<NEW_LINE>timeView.setTextSize(16);<NEW_LINE>timeView.setTextColor(getMainFontColor());<NEW_LINE>timeView.setText(timeText);<NEW_LINE>baseItemView.addView(timeView);<NEW_LINE>}<NEW_LINE>if (onClickListener != null) {<NEW_LINE>ll.setOnClickListener(onClickListener);<NEW_LINE>}<NEW_LINE>((LinearLayout) view).addView(baseItemView);<NEW_LINE>} | 24), dpToPx(24)); |
112,540 | private List<String> path(Element owner, TypeElement annotation, ExecutableElement exec) {<NEW_LINE>List<String> prefix = path(owner);<NEW_LINE>if (prefix.isEmpty()) {<NEW_LINE>// Look at parent @path annotation<NEW_LINE>List<TypeElement> superTypes = superTypes(owner);<NEW_LINE>int i = superTypes.size() - 1;<NEW_LINE>while (prefix.isEmpty() && i >= 0) {<NEW_LINE>prefix = path(superTypes.get(i--));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Favor GET("/path") over Path("/path") at method level<NEW_LINE>List<String> path = path(annotation.getQualifiedName().toString(), annotation.getAnnotationMirrors());<NEW_LINE>if (path.isEmpty()) {<NEW_LINE>path = path(annotation.getQualifiedName().toString(), exec.getAnnotationMirrors());<NEW_LINE>}<NEW_LINE>List<String> methodPath = path;<NEW_LINE>if (prefix.isEmpty()) {<NEW_LINE>return path.isEmpty() ? Collections.singletonList("/") : path;<NEW_LINE>}<NEW_LINE>if (path.isEmpty()) {<NEW_LINE>return prefix.isEmpty() ? <MASK><NEW_LINE>}<NEW_LINE>return prefix.stream().flatMap(root -> methodPath.stream().map(p -> root.equals("/") ? p : root + p)).distinct().collect(Collectors.toList());<NEW_LINE>} | Collections.singletonList("/") : prefix; |
1,542,779 | public CustomEmailLambdaVersionConfigType unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>CustomEmailLambdaVersionConfigType customEmailLambdaVersionConfigType = new CustomEmailLambdaVersionConfigType();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("LambdaVersion", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>customEmailLambdaVersionConfigType.setLambdaVersion(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("LambdaArn", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>customEmailLambdaVersionConfigType.setLambdaArn(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return customEmailLambdaVersionConfigType;<NEW_LINE>} | class).unmarshall(context)); |
382,008 | private ContentValues mapStory(Map<String, Object> map, Story.FILTER filter, Integer rank) {<NEW_LINE>ContentValues storyValues = new ContentValues();<NEW_LINE>try {<NEW_LINE>String by = (String) map.get("by");<NEW_LINE>Long id = (Long) map.get("id");<NEW_LINE>String type = (String) map.get("type");<NEW_LINE>Long time = (Long) map.get("time");<NEW_LINE>Long score = (Long) map.get("score");<NEW_LINE>String title = (String) map.get("title");<NEW_LINE>String url = (String) map.get("url");<NEW_LINE>Long descendants = Long.valueOf(0);<NEW_LINE>if (map.get("descendants") != null) {<NEW_LINE>descendants = (Long) map.get("descendants");<NEW_LINE>}<NEW_LINE>storyValues.put(HNewsContract.StoryEntry.ITEM_ID, id);<NEW_LINE>storyValues.put(HNewsContract.StoryEntry.BY, by);<NEW_LINE>storyValues.put(HNewsContract.StoryEntry.TYPE, type);<NEW_LINE>storyValues.put(HNewsContract.StoryEntry.TIME_AGO, time * 1000);<NEW_LINE>storyValues.put(HNewsContract.StoryEntry.SCORE, score);<NEW_LINE>storyValues.put(HNewsContract.StoryEntry.TITLE, title);<NEW_LINE>storyValues.put(HNewsContract.StoryEntry.COMMENTS, descendants);<NEW_LINE>storyValues.put(HNewsContract.StoryEntry.URL, url);<NEW_LINE>storyValues.put(HNewsContract.StoryEntry.RANK, rank);<NEW_LINE>storyValues.put(HNewsContract.StoryEntry.TIMESTAMP, System.currentTimeMillis());<NEW_LINE>storyValues.put(HNewsContract.StoryEntry.<MASK><NEW_LINE>} catch (Exception ex) {<NEW_LINE>Log.d(ex.getMessage());<NEW_LINE>}<NEW_LINE>return storyValues;<NEW_LINE>} | FILTER, filter.name()); |
767,206 | public void jobExists(String jobId, boolean errorIfMissing, ActionListener<Boolean> listener) {<NEW_LINE>GetRequest getRequest = new GetRequest(MlConfigIndex.indexName(), Job.documentId(jobId));<NEW_LINE>getRequest.fetchSourceContext(FetchSourceContext.DO_NOT_FETCH_SOURCE);<NEW_LINE>executeAsyncWithOrigin(client, ML_ORIGIN, GetAction.INSTANCE, getRequest, new ActionListener<GetResponse>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onResponse(GetResponse getResponse) {<NEW_LINE>if (getResponse.isExists() == false) {<NEW_LINE>if (errorIfMissing) {<NEW_LINE>listener.onFailure(ExceptionsHelper.missingJobException(jobId));<NEW_LINE>} else {<NEW_LINE>listener.onResponse(Boolean.FALSE);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onFailure(Exception e) {<NEW_LINE>if (e.getClass() == IndexNotFoundException.class) {<NEW_LINE>if (errorIfMissing) {<NEW_LINE>listener.onFailure(ExceptionsHelper.missingJobException(jobId));<NEW_LINE>} else {<NEW_LINE>listener.onResponse(Boolean.FALSE);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>listener.onFailure(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | listener.onResponse(Boolean.TRUE); |
210,501 | protected void update() {<NEW_LINE>if (!isUpdateNeeded()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>switch(numGains) {<NEW_LINE>case 0:<NEW_LINE>assert (A == null);<NEW_LINE>break;<NEW_LINE>case 1:<NEW_LINE>A.put(0, colorParameters[0]);<NEW_LINE>A.put(4, colorParameters[0]);<NEW_LINE>A.put(8, colorParameters[0]);<NEW_LINE>break;<NEW_LINE>case 3:<NEW_LINE>A.put(0, colorParameters[0]);<NEW_LINE>A.put<MASK><NEW_LINE>A.put(8, colorParameters[2]);<NEW_LINE>break;<NEW_LINE>case 9:<NEW_LINE>A.put(0, colorParameters, 0, 9);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>assert (false);<NEW_LINE>}<NEW_LINE>switch(numBiases) {<NEW_LINE>case 0:<NEW_LINE>assert (b == null);<NEW_LINE>break;<NEW_LINE>case 1:<NEW_LINE>b.put(0, colorParameters[numGains]);<NEW_LINE>b.put(1, colorParameters[numGains]);<NEW_LINE>b.put(2, colorParameters[numGains]);<NEW_LINE>break;<NEW_LINE>case 3:<NEW_LINE>b.put(0, colorParameters, numGains, 3);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>assert (false);<NEW_LINE>}<NEW_LINE>super.update();<NEW_LINE>setUpdateNeeded(false);<NEW_LINE>} | (4, colorParameters[1]); |
810,888 | public Kryo create() {<NEW_LINE>Kryo kryo = new Kryo();<NEW_LINE>kryo.setRegistrationRequired(false);<NEW_LINE>// register serializer<NEW_LINE>kryo.register(Arrays.asList("").getClass(), new ArraysAsListSerializer());<NEW_LINE>kryo.register(GregorianCalendar<MASK><NEW_LINE>kryo.register(InvocationHandler.class, new JdkProxySerializer());<NEW_LINE>kryo.register(BigDecimal.class, new DefaultSerializers.BigDecimalSerializer());<NEW_LINE>kryo.register(BigInteger.class, new DefaultSerializers.BigIntegerSerializer());<NEW_LINE>kryo.register(Pattern.class, new RegexSerializer());<NEW_LINE>kryo.register(BitSet.class, new BitSetSerializer());<NEW_LINE>kryo.register(URI.class, new URISerializer());<NEW_LINE>kryo.register(UUID.class, new UUIDSerializer());<NEW_LINE>// register commonly class<NEW_LINE>SerializerClassRegistry.getRegisteredClasses().keySet().forEach(kryo::register);<NEW_LINE>return kryo;<NEW_LINE>} | .class, new GregorianCalendarSerializer()); |
509,759 | final DescribeVpcClassicLinkResult executeDescribeVpcClassicLink(DescribeVpcClassicLinkRequest describeVpcClassicLinkRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeVpcClassicLinkRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<DescribeVpcClassicLinkRequest> request = null;<NEW_LINE>Response<DescribeVpcClassicLinkResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeVpcClassicLinkRequestMarshaller().marshall(super.beforeMarshalling(describeVpcClassicLinkRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeVpcClassicLink");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DescribeVpcClassicLinkResult> responseHandler = new StaxResponseHandler<DescribeVpcClassicLinkResult>(new DescribeVpcClassicLinkResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.startEvent(Field.ClientExecuteTime); |
1,715,945 | public void write(JsonWriter out, T value) throws IOException {<NEW_LINE>Class<?> srcType = value.getClass();<NEW_LINE>String label = subtypeToLabel.get(srcType);<NEW_LINE>TypeAdapter<T> delegate = (TypeAdapter<T>) subtypeToDelegate.get(srcType);<NEW_LINE>if (delegate == null)<NEW_LINE>throw new JsonParseException("Cannot serialize " + baseType + " subtype named " + srcType.getName() + "; did you forget to register a subtype?");<NEW_LINE>JsonObject jsonObject = delegate.<MASK><NEW_LINE>if (jsonObject.has(typeFieldName))<NEW_LINE>throw new JsonParseException("Cannot serialize " + srcType.getName() + " because it already defines a field named " + typeFieldName);<NEW_LINE>JsonObject clone = new JsonObject();<NEW_LINE>clone.add(typeFieldName, new JsonPrimitive(label));<NEW_LINE>for (Map.Entry<String, JsonElement> entry : jsonObject.entrySet()) {<NEW_LINE>clone.add(entry.getKey(), entry.getValue());<NEW_LINE>}<NEW_LINE>logger.trace("Writing {} for {} ", label, value);<NEW_LINE>gson.toJson(clone, out);<NEW_LINE>} | toJsonTree(value).getAsJsonObject(); |
1,457,339 | public void start(Stage stage) {<NEW_LINE>stage.setTitle("TextBoxClipboard");<NEW_LINE>Scene scene = new Scene(new Group(), 600, 450);<NEW_LINE>scene.setFill(Color.GHOSTWHITE);<NEW_LINE>final Label copyFrom = new Label("Copy From: ");<NEW_LINE>final TextField copyFromText = new TextField("ABC 123");<NEW_LINE>final HBox cf = new HBox();<NEW_LINE>cf.getChildren().add(copyFrom);<NEW_LINE>cf.getChildren().add(copyFromText);<NEW_LINE>final Label copyTo = new Label("Copy To: ");<NEW_LINE>final TextField copyToText = new TextField();<NEW_LINE>final HBox ct = new HBox();<NEW_LINE>ct.getChildren().add(copyTo);<NEW_LINE>ct.getChildren().add(copyToText);<NEW_LINE>final HBox btns = new HBox();<NEW_LINE>final Button copy = new Button("Copy");<NEW_LINE>copy.setOnAction(e -> {<NEW_LINE>ClipboardContent content = new ClipboardContent();<NEW_LINE>content.putString(copyFromText.getText());<NEW_LINE>Clipboard.getSystemClipboard().setContent(content);<NEW_LINE>});<NEW_LINE>final Button paste = new Button("Paste");<NEW_LINE>paste.setOnAction(e -> {<NEW_LINE>Set<DataFormat> types = Clipboard.getSystemClipboard().getContentTypes();<NEW_LINE>for (DataFormat type : types) {<NEW_LINE>System.<MASK><NEW_LINE>}<NEW_LINE>copyToText.setText(Clipboard.getSystemClipboard().getString());<NEW_LINE>});<NEW_LINE>btns.getChildren().add(copy);<NEW_LINE>btns.getChildren().add(paste);<NEW_LINE>final VBox vbox = new VBox();<NEW_LINE>vbox.setPadding(new Insets(30, 0, 0, 0));<NEW_LINE>vbox.setSpacing(25);<NEW_LINE>vbox.getChildren().add(btns);<NEW_LINE>vbox.getChildren().add(cf);<NEW_LINE>vbox.getChildren().add(ct);<NEW_LINE>scene.setRoot(vbox);<NEW_LINE>stage.setScene(scene);<NEW_LINE>stage.show();<NEW_LINE>} | out.println("TYPE: " + type); |
770,575 | void buildStatic(SmallRyeContextPropagationRecorder recorder) throws ClassNotFoundException, IOException {<NEW_LINE>List<ThreadContextProvider> discoveredProviders = new ArrayList<>();<NEW_LINE>List<ContextManagerExtension> discoveredExtensions = new ArrayList<>();<NEW_LINE>for (Class<?> provider : ServiceUtil.classesNamedIn(Thread.currentThread().getContextClassLoader(), "META-INF/services/" + ThreadContextProvider.class.getName())) {<NEW_LINE>try {<NEW_LINE>discoveredProviders.add((ThreadContextProvider) provider.<MASK><NEW_LINE>} catch (InstantiationException | IllegalAccessException | NoSuchMethodException | InvocationTargetException e) {<NEW_LINE>throw new RuntimeException("Failed to instantiate declared ThreadContextProvider class: " + provider.getName(), e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (Class<?> extension : ServiceUtil.classesNamedIn(Thread.currentThread().getContextClassLoader(), "META-INF/services/" + ContextManagerExtension.class.getName())) {<NEW_LINE>try {<NEW_LINE>discoveredExtensions.add((ContextManagerExtension) extension.getDeclaredConstructor().newInstance());<NEW_LINE>} catch (InstantiationException | IllegalAccessException | NoSuchMethodException | InvocationTargetException e) {<NEW_LINE>throw new RuntimeException("Failed to instantiate declared ThreadContextProvider class: " + extension.getName(), e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>recorder.configureStaticInit(discoveredProviders, discoveredExtensions);<NEW_LINE>} | getDeclaredConstructor().newInstance()); |
1,161,449 | private static SweepPriority hydrate(SweepPriorityTable.SweepPriorityRowResult rr) {<NEW_LINE>return ImmutableSweepPriority.builder().tableRef(TableReference.createUnsafe(rr.getRowName().getFullTableName())).writeCount(rr.hasWriteCount() ? rr.getWriteCount() : 0L).lastSweepTimeMillis(rr.hasLastSweepTime() ? OptionalLong.of(rr.getLastSweepTime()) : OptionalLong.empty()).minimumSweptTimestamp(rr.hasMinimumSweptTimestamp() ? rr.getMinimumSweptTimestamp() : Long.MIN_VALUE).staleValuesDeleted(rr.hasCellsDeleted() ? rr.getCellsDeleted() : 0L).cellTsPairsExamined(rr.hasCellsExamined() ? rr.getCellsExamined(<MASK><NEW_LINE>} | ) : 0L).build(); |
1,675,524 | private void selectFolderInternal(final SelectAction action, final PersistableFolder folder, final Uri startUri, final CopyChoice copyChoice) {<NEW_LINE>// call for document tree dialog<NEW_LINE>final Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT_TREE);<NEW_LINE>intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION | (folder == null || folder.needsWrite() ? Intent.FLAG_GRANT_WRITE_URI_PERMISSION : 0) | (folder != null <MASK><NEW_LINE>Uri realStartUri = startUri != null ? startUri : (folder != null ? folder.getUri() : null);<NEW_LINE>// show internal storage<NEW_LINE>intent.putExtra(Intents.EXTRA_SHOW_ADVANCED, true);<NEW_LINE>if (realStartUri != null && android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {<NEW_LINE>if (UriUtils.isFileUri(realStartUri)) {<NEW_LINE>realStartUri = UriUtils.getPseudoTreeUriForFileUri(realStartUri);<NEW_LINE>}<NEW_LINE>// Field is only supported starting with SDK26<NEW_LINE>intent.putExtra(DocumentsContract.EXTRA_INITIAL_URI, realStartUri);<NEW_LINE>}<NEW_LINE>runningIntentData = new IntentData(folder, copyChoice, action);<NEW_LINE>this.activity.startActivityForResult(intent, action.requestCode);<NEW_LINE>} | ? Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION : 0)); |
595,548 | private Mono<Response<Flux<ByteBuffer>>> disableAzureMonitorWithResponseAsync(String resourceGroupName, String clusterName) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (clusterName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>return FluxUtil.withContext(context -> service.disableAzureMonitor(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, clusterName, this.client.getApiVersion(), accept, context)).contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));<NEW_LINE>} | error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); |
1,410,384 | private ProductType type(PersistableProductType type, ProductType destination) throws ServiceException {<NEW_LINE>if (destination == null) {<NEW_LINE>destination = new ProductType();<NEW_LINE>}<NEW_LINE>destination.setCode(type.getCode());<NEW_LINE>destination.setId(type.getId());<NEW_LINE>destination.setAllowAddToCart(type.isAllowAddToCart());<NEW_LINE>destination.setVisible(type.isVisible());<NEW_LINE>// destination.set<NEW_LINE>List<com.salesmanager.core.model.catalog.product.type.ProductTypeDescription> descriptions = new ArrayList<com.salesmanager.core.model.catalog.product.type.ProductTypeDescription>();<NEW_LINE>if (!CollectionUtils.isEmpty(type.getDescriptions())) {<NEW_LINE>for (ProductTypeDescription d : type.getDescriptions()) {<NEW_LINE>com.salesmanager.core.model.catalog.product.type.ProductTypeDescription desc = typeDescription(d, destination, d.getLanguage());<NEW_LINE>descriptions.add(desc);<NEW_LINE>}<NEW_LINE>destination.setDescriptions(new HashSet<com.salesmanager.core.model.catalog.product.<MASK><NEW_LINE>}<NEW_LINE>return destination;<NEW_LINE>} | type.ProductTypeDescription>(descriptions)); |
1,437,215 | private ByteArray[] generateDerivedByteValuesForGD(TreeMap<Object, DerivedValue> sortedMap) {<NEW_LINE>Iterator<Map.Entry<Object, DerivedValue>> sortedIterator = sortedMap.entrySet().iterator();<NEW_LINE>int cardinality = sortedMap.size();<NEW_LINE>ByteArray[] values = new ByteArray[cardinality];<NEW_LINE>Random random = new Random();<NEW_LINE>int i = 0;<NEW_LINE>while (sortedIterator.hasNext()) {<NEW_LINE>Map.Entry<Object, DerivedValue> entry = sortedIterator.next();<NEW_LINE>ByteArray byteArray = (ByteArray) entry.getKey();<NEW_LINE>if (byteArray == null || byteArray.length() == 0) {<NEW_LINE>values[i++] = new ByteArray(new byte[0]);<NEW_LINE>} else {<NEW_LINE>int origValLength = byteArray.length();<NEW_LINE>byte[] generated = new byte[origValLength];<NEW_LINE>random.nextBytes(generated);<NEW_LINE>values[i++] = new ByteArray(generated);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Arrays.sort(values);<NEW_LINE>sortedIterator = sortedMap<MASK><NEW_LINE>i = 0;<NEW_LINE>while (sortedIterator.hasNext()) {<NEW_LINE>Map.Entry<Object, DerivedValue> entry = sortedIterator.next();<NEW_LINE>DerivedValue derivedValue = entry.getValue();<NEW_LINE>derivedValue._derivedValue = values[i++];<NEW_LINE>}<NEW_LINE>return values;<NEW_LINE>} | .entrySet().iterator(); |
1,519,221 | public CompletableFuture<TableStore> openTableStore(long scId, RangeId rid, int ttlSeconds) {<NEW_LINE>TableStore store = tableStores.get(rid);<NEW_LINE>if (null != store) {<NEW_LINE>return FutureUtils.value(store);<NEW_LINE>}<NEW_LINE>CompletableFuture<TableStore> openFuture = tableStoresOpening.get(rid);<NEW_LINE>if (null != openFuture) {<NEW_LINE>return openFuture;<NEW_LINE>}<NEW_LINE>// no store is cached, and there is no outstanding open request<NEW_LINE>openFuture = FutureUtils.createFuture();<NEW_LINE>CompletableFuture<TableStore> existingOpenFuture = <MASK><NEW_LINE>if (null != existingOpenFuture) {<NEW_LINE>// there is already an ongoing open request<NEW_LINE>return existingOpenFuture;<NEW_LINE>}<NEW_LINE>// I am the first one to open a table store<NEW_LINE>final CompletableFuture<TableStore> openingFuture = openFuture;<NEW_LINE>mvccStoreFactory.openStore(scId, rid.getStreamId(), rid.getRangeId(), ttlSeconds).thenAccept(mvccStore -> {<NEW_LINE>TableStore newStore = tableStoreFactory.createStore(mvccStore);<NEW_LINE>TableStore oldStore = tableStores.putIfAbsent(rid, newStore);<NEW_LINE>if (null != oldStore) {<NEW_LINE>openingFuture.complete(oldStore);<NEW_LINE>} else {<NEW_LINE>openingFuture.complete(newStore);<NEW_LINE>}<NEW_LINE>tableStoresOpening.remove(rid, openingFuture);<NEW_LINE>}).exceptionally(cause -> {<NEW_LINE>openingFuture.completeExceptionally(cause);<NEW_LINE>tableStoresOpening.remove(rid, openingFuture);<NEW_LINE>return null;<NEW_LINE>});<NEW_LINE>return openingFuture;<NEW_LINE>} | tableStoresOpening.putIfAbsent(rid, openFuture); |
1,276,748 | public INDArray permute(int... rearrange) {<NEW_LINE>Preconditions.checkArgument(rearrange.length == rank(), "Incorrect number of arguments for permute function:" + <MASK><NEW_LINE>Nd4j.getCompressor().autoDecompress(this);<NEW_LINE>boolean alreadyInOrder = true;<NEW_LINE>// IntBuffer shapeInfo = shapeInfo();<NEW_LINE>int rank = jvmShapeInfo.rank;<NEW_LINE>for (int i = 0; i < rank; i++) {<NEW_LINE>if (rearrange[i] != i) {<NEW_LINE>alreadyInOrder = false;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (alreadyInOrder)<NEW_LINE>return this;<NEW_LINE>checkArrangeArray(rearrange);<NEW_LINE>val newShape = doPermuteSwap(shape(), rearrange);<NEW_LINE>val newStride = doPermuteSwap(stride(), rearrange);<NEW_LINE>char newOrder = Shape.getOrder(newShape, newStride, 1);<NEW_LINE>INDArray value = create(data(), newShape, newStride, offset(), newOrder);<NEW_LINE>return value;<NEW_LINE>} | " got arguments %s for rank %s array. Number of arguments must equal array rank", rearrange, rank()); |
601,415 | public static Map<String, ClassNode> createGenericsSpec(ClassNode current, Map<String, ClassNode> oldSpec) {<NEW_LINE>Map<String, ClassNode> ret = new HashMap<String, ClassNode>(oldSpec);<NEW_LINE>// ret contains the type specs, what we now need is the type spec for the<NEW_LINE>// current class. To get that we first apply the type parameters to the<NEW_LINE>// current class and then use the type names of the current class to reset<NEW_LINE>// the map. Example:<NEW_LINE>// class A<V,W,X>{}<NEW_LINE>// class B<T extends Number> extends A<T,Long,String> {}<NEW_LINE>// first we have: T->Number<NEW_LINE>// we apply it to A<T,Long,String> -> A<Number,Long,String><NEW_LINE>// resulting in: V->Number,W->Long,X->String<NEW_LINE>GenericsType[] sgts = current.getGenericsTypes();<NEW_LINE>if (sgts != null) {<NEW_LINE>ClassNode[] spec = new ClassNode[sgts.length];<NEW_LINE>for (int i = 0; i < spec.length; i++) {<NEW_LINE>spec[i] = correctToGenericsSpec<MASK><NEW_LINE>}<NEW_LINE>GenericsType[] newGts = current.redirect().getGenericsTypes();<NEW_LINE>if (newGts == null)<NEW_LINE>return ret;<NEW_LINE>ret.clear();<NEW_LINE>for (int i = 0; i < spec.length; i++) {<NEW_LINE>ret.put(newGts[i].getName(), spec[i]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return ret;<NEW_LINE>} | (ret, sgts[i]); |
230,993 | static final boolean testRSAKeys(byte[] b, byte[][] privKey, byte[][] pubKey) {<NEW_LINE>int l = pubKey[0].length;<NEW_LINE>if (pubKey[0][0] == 0)<NEW_LINE>l--;<NEW_LINE>long t1 = System.currentTimeMillis();<NEW_LINE>byte[] rsa_b = rsa(true, 0, pubKey, b, 1, l);<NEW_LINE>long t2 = System.currentTimeMillis();<NEW_LINE>rsa_b = rsa(false, 0, privKey, rsa_b, 0, rsa_b.length);<NEW_LINE>long t3 = System.currentTimeMillis();<NEW_LINE>String s = ("RSA/" + (privKey.length == 8 ? "CRT/" : "") + (l * 8) + (pubKey[1].length == 1 && pubKey[1][0] == 3 <MASK><NEW_LINE>s = s.substring(0, 20);<NEW_LINE>for (int i = 0; i < 2; i++) {<NEW_LINE>String ss = " " + (i == 0 ? (t3 - t2) : (t2 - t1));<NEW_LINE>s += ss.substring(ss.length() - 5);<NEW_LINE>}<NEW_LINE>for (int i = 0; i < rsa_b.length; i++) if (rsa_b[i] != (byte) ((i + 1) % 128)) {<NEW_LINE>if (tc.isDebugEnabled())<NEW_LINE>Tr.debug(tc, "RSA failed!");<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | ? "/3" : "/F4") + " ..................."); |
1,828,945 | public void testCompletionStageRxInvoker_post4WithExecutorService(Map<String, String> param, StringBuilder ret) {<NEW_LINE>String serverIP = param.get("serverIP");<NEW_LINE>String serverPort = param.get("serverPort");<NEW_LINE>final String threadName = "jaxrs21Thread";<NEW_LINE>ThreadFactory jaxrs21ThreadFactory = Executors.defaultThreadFactory();<NEW_LINE>Thread jaxrs21Thread = jaxrs21ThreadFactory.newThread(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>String runThreadName = Thread.currentThread().getName();<NEW_LINE>if (!(runThreadName.equals(threadName))) {<NEW_LINE>throw new RuntimeException("testCompletionStageRxInvoker_post4WithExecutorService: incorrect thread name");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>jaxrs21Thread.setName(threadName);<NEW_LINE>ExecutorService <MASK><NEW_LINE>ClientBuilder cb = ClientBuilder.newBuilder().executorService(executorService);<NEW_LINE>Client c = cb.build();<NEW_LINE>WebTarget t = c.target("http://" + serverIP + ":" + serverPort + "/jaxrs21bookstore/JAXRS21bookstore2/rxpost1");<NEW_LINE>Builder builder = t.request();<NEW_LINE>CompletionStageRxInvoker completionStageRxInvoker = builder.rx();<NEW_LINE>JAXRS21Book book = new JAXRS21Book("Test book4", 103);<NEW_LINE>CompletionStage<Response> completionStage = completionStageRxInvoker.post(Entity.xml(book));<NEW_LINE>CompletableFuture<Response> completableFuture = completionStage.toCompletableFuture();<NEW_LINE>try {<NEW_LINE>Response response = completableFuture.get();<NEW_LINE>ret.append(response.readEntity(String.class));<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>} catch (ExecutionException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>c.close();<NEW_LINE>} | executorService = Executors.newSingleThreadExecutor(jaxrs21ThreadFactory); |
819,962 | private void checkHasLocalReader(SingleSeriesExpression expression, MetaGroupMember metaGroupMember) throws IOException {<NEW_LINE>Filter filter = expression.getFilter();<NEW_LINE>Filter timeFilter = getTimeFilter(filter);<NEW_LINE>PartialPath path = <MASK><NEW_LINE>TSDataType dataType;<NEW_LINE>try {<NEW_LINE>dataType = IoTDB.schemaProcessor.getSeriesType(path);<NEW_LINE>List<PartitionGroup> partitionGroups = metaGroupMember.routeFilter(null, path);<NEW_LINE>for (PartitionGroup partitionGroup : partitionGroups) {<NEW_LINE>if (partitionGroup.contains(metaGroupMember.getThisNode())) {<NEW_LINE>DataGroupMember dataGroupMember = metaGroupMember.getLocalDataMember(partitionGroup.getHeader(), String.format("Query: %s, time filter: %s, queryId: %d", path, null, context.getQueryId()));<NEW_LINE>IPointReader pointReader = readerFactory.getSeriesPointReader(path, queryPlan.getAllMeasurementsInDevice(path.getDevice()), dataType, timeFilter, filter, context, dataGroupMember, queryPlan.isAscending(), null);<NEW_LINE>if (pointReader.hasNextTimeValuePair()) {<NEW_LINE>this.hasLocalReader = true;<NEW_LINE>this.endPoint = null;<NEW_LINE>pointReader.close();<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>pointReader.close();<NEW_LINE>} else if (endPoint == null) {<NEW_LINE>endPoint = new QueryDataSet.EndPoint(partitionGroup.getHeader().getNode().getClientIp(), partitionGroup.getHeader().getNode().getClientPort());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new IOException(e);<NEW_LINE>}<NEW_LINE>} | (PartialPath) expression.getSeriesPath(); |
809,046 | private static void hardLinkFile(DownloadManager manager, DiskManagerFileInfo file_info, File source, File target, Runnable done) {<NEW_LINE>// this behaviour should be put further down in the core but I'd rather not<NEW_LINE>// do so close to release :(<NEW_LINE>manager.setUserData("is_changing_links", true);<NEW_LINE>// I don't link this one bit, but there's a lot of things I don't like and this isn't the worst<NEW_LINE>manager.setUserData("set_link_dont_delete_existing", true);<NEW_LINE>String failure_msg = null;<NEW_LINE>try {<NEW_LINE>try {<NEW_LINE>Files.createLink(target.toPath(), source.toPath());<NEW_LINE>} catch (Throwable e) {<NEW_LINE>failure_msg = MessageText.getString("hardlink.failed.text", new String[] { target.toString(), source.toString(), Debug.getNestedExceptionMessage(e) });<NEW_LINE>}<NEW_LINE>if (failure_msg == null) {<NEW_LINE>boolean ok = file_info.setLink(target);<NEW_LINE>if (!ok) {<NEW_LINE>target.delete();<NEW_LINE>String error = file_info.getLastError();<NEW_LINE>if (error == null) {<NEW_LINE>error = MessageText.getString("SpeedView.stats.unknown");<NEW_LINE>}<NEW_LINE>failure_msg = MessageText.getString("hardlink.failed.text", new String[] { target.toString(), source<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (failure_msg != null) {<NEW_LINE>new MessageBoxShell(SWT.ICON_ERROR | SWT.OK, MessageText.getString("hardlink.failed.title"), failure_msg).open(new UserPrompterResultListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void prompterClosed(int result) {<NEW_LINE>if (done != null) {<NEW_LINE>done.run();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>manager.setUserData("is_changing_links", false);<NEW_LINE>manager.setUserData("set_link_dont_delete_existing", null);<NEW_LINE>if (failure_msg == null) {<NEW_LINE>if (done != null) {<NEW_LINE>done.run();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .toString(), error }); |
843,519 | public String handleRequest(SQSEvent event, Context context) {<NEW_LINE>String response = new String();<NEW_LINE>// call Lambda API<NEW_LINE>logger.info("Getting account settings");<NEW_LINE>CompletableFuture<GetAccountSettingsResponse> accountSettings = lambdaClient.getAccountSettings(GetAccountSettingsRequest.builder().build());<NEW_LINE>// log execution details<NEW_LINE>logger.info("ENVIRONMENT VARIABLES: {}", gson.toJson(System.getenv()));<NEW_LINE>logger.info("CONTEXT: {}", gson.toJson(context));<NEW_LINE>logger.info("EVENT: {}"<MASK><NEW_LINE>// process event<NEW_LINE>for (SQSMessage msg : event.getRecords()) {<NEW_LINE>logger.info(msg.getBody());<NEW_LINE>}<NEW_LINE>// process Lambda API response<NEW_LINE>try {<NEW_LINE>GetAccountSettingsResponse settings = accountSettings.get();<NEW_LINE>response = gson.toJson(settings.accountUsage());<NEW_LINE>logger.info("Account usage: {}", response);<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.getStackTrace();<NEW_LINE>}<NEW_LINE>return response;<NEW_LINE>} | , gson.toJson(event)); |
1,505,733 | protected void handleSuccess(final BreakpointSetReply reply) {<NEW_LINE>final BreakpointManager manager = getDebugger().getBreakpointManager();<NEW_LINE>final Set<BreakpointAddress> addressesToActivate = new HashSet<>();<NEW_LINE>final Set<BreakpointAddress> <MASK><NEW_LINE>for (final Pair<RelocatedAddress, Integer> resultPair : reply.getAddresses()) {<NEW_LINE>if (resultPair.second() == 0) {<NEW_LINE>// If a breakpoint was successfully set in the target process, its status is<NEW_LINE>// set to ACTIVE in the breakpoint manager.<NEW_LINE>final BreakpointAddress breakpointAddress = DebuggerHelpers.getBreakpointAddress(getDebugger(), resultPair.first());<NEW_LINE>if (manager.getBreakpointStatus(breakpointAddress, BreakpointType.REGULAR) != BreakpointStatus.BREAKPOINT_DISABLED) {<NEW_LINE>addressesToActivate.add(breakpointAddress);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// If a breakpoint could not be set in the target process, its status in the<NEW_LINE>// breakpoint manager is set to INVALID. The real status of the breakpoint<NEW_LINE>// is unknown though.<NEW_LINE>addressesToInvalidate.add(DebuggerHelpers.getBreakpointAddress(getDebugger(), resultPair.first()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>manager.setBreakpointStatus(addressesToInvalidate, BreakpointType.REGULAR, BreakpointStatus.BREAKPOINT_INVALID);<NEW_LINE>manager.setBreakpointStatus(addressesToActivate, BreakpointType.REGULAR, BreakpointStatus.BREAKPOINT_ACTIVE);<NEW_LINE>} | addressesToInvalidate = new HashSet<>(); |
1,215,920 | public void visitMatrixReport(MatrixReport matrixReport) {<NEW_LINE>Map<String, Matrix> matrixs = matrixReport.getMatrixs();<NEW_LINE>Collection<Matrix> matrix = matrixs.values();<NEW_LINE>int size = matrix.size();<NEW_LINE>if (size > m_maxSize) {<NEW_LINE>List<Matrix> matrixList = new ArrayList<Matrix>(matrix);<NEW_LINE>Collections.sort(matrixList, new MeatricCompartor());<NEW_LINE>matrixs.clear();<NEW_LINE>for (int i = 0; i < m_maxSize; i++) {<NEW_LINE>Matrix temp = matrixList.get(i);<NEW_LINE>matrixs.put(temp.getName(), temp);<NEW_LINE>}<NEW_LINE>Matrix value = new Matrix(OTHERS);<NEW_LINE>for (int i = m_maxSize; i < size; i++) {<NEW_LINE>Matrix item = matrixList.get(i);<NEW_LINE>value.<MASK><NEW_LINE>value.setCount(item.getCount() + value.getCount());<NEW_LINE>}<NEW_LINE>matrixs.put(OTHERS, value);<NEW_LINE>}<NEW_LINE>super.visitMatrixReport(matrixReport);<NEW_LINE>} | setType(item.getType()); |
587,180 | public com.amazonaws.services.waf.model.WAFReferencedItemException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.waf.model.WAFReferencedItemException wAFReferencedItemException = new com.amazonaws.services.waf.model.WAFReferencedItemException(null);<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return wAFReferencedItemException;<NEW_LINE>} | JsonToken token = context.getCurrentToken(); |
45,645 | public static void main(String[] args) throws Exception {<NEW_LINE>SerializePresets app = new SerializePresets();<NEW_LINE>app.initializeApplication();<NEW_LINE>if (args.length < 1) {<NEW_LINE>printUsage();<NEW_LINE>throw new IllegalArgumentException("Invalid Command Line Params");<NEW_LINE>}<NEW_LINE>Locale.setDefault(Locale.ENGLISH);<NEW_LINE>ComponentPresetDatabase componentPresetDao = new ComponentPresetDatabase();<NEW_LINE>for (int i = 0; i < args.length; i++) {<NEW_LINE>System.err.println("Processing .orc files in directory " + args[i]);<NEW_LINE>FileIterator iterator = DirectoryIterator.findDirectory(args[i], new SimpleFileFilter<MASK><NEW_LINE>if (iterator == null) {<NEW_LINE>throw new RuntimeException("Can't find " + args[i] + " directory");<NEW_LINE>}<NEW_LINE>while (iterator.hasNext()) {<NEW_LINE>Pair<String, InputStream> f = iterator.next();<NEW_LINE>String fileName = f.getU();<NEW_LINE>InputStream is = f.getV();<NEW_LINE>OpenRocketComponentLoader loader = new OpenRocketComponentLoader();<NEW_LINE>Collection<ComponentPreset> presets = loader.load(is, fileName);<NEW_LINE>componentPresetDao.addAll(presets);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<ComponentPreset> list = componentPresetDao.listAll();<NEW_LINE>System.out.println("Total number of presets = " + list.size());<NEW_LINE>File outFile = new File("resources/datafiles/presets", "system.ser");<NEW_LINE>FileOutputStream ofs = new FileOutputStream(outFile);<NEW_LINE>ObjectOutputStream oos = new ObjectOutputStream(ofs);<NEW_LINE>oos.writeObject(list);<NEW_LINE>ofs.flush();<NEW_LINE>ofs.close();<NEW_LINE>} | ("", false, "orc")); |
538,857 | private Pair<Long, String> matchesInternal(DateTimeParserContext ctx) {<NEW_LINE>int snapshot = ctx.cursor().value();<NEW_LINE>int sign = 1;<NEW_LINE>if (ctx.isSymbolAtCursor(DateTimeTokenizer.Symbol.PLUS) || ctx.isSymbolAtCursor(DateTimeTokenizer.Symbol.MINUS)) {<NEW_LINE>sign = ctx.isSymbolAtCursor(DateTimeTokenizer.Symbol.PLUS) ? 1 : -1;<NEW_LINE>ctx.cursor().inc();<NEW_LINE>ctx.skipWhitespaces();<NEW_LINE>}<NEW_LINE>if (!ctx.isSymbolAtCursor(DateTimeTokenizer.Symbol.DIGITS)) {<NEW_LINE>ctx.withCursorValue(snapshot);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>long value = ctx.readLongAtCursorAndInc() * sign;<NEW_LINE>ctx.skipWhitespaces();<NEW_LINE>if (!ctx.isSymbolAtCursor(DateTimeTokenizer.Symbol.STRING)) {<NEW_LINE>ctx.withCursorValue(snapshot);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Matcher matcher = UNIT.matcher(ctx.readCharBufferAtCursor());<NEW_LINE><MASK><NEW_LINE>if (!unitMatches) {<NEW_LINE>ctx.withCursorValue(snapshot);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>String unit = ctx.readStringAtCursorAndInc().toLowerCase();<NEW_LINE>// try to find "ago" token.<NEW_LINE>if (ctx.isSymbolAtCursor(DateTimeTokenizer.Symbol.SPACE)) {<NEW_LINE>snapshot = ctx.cursor().value();<NEW_LINE>ctx.cursor().inc();<NEW_LINE>if (ctx.isSymbolAtCursor(DateTimeTokenizer.Symbol.STRING) && "ago".equalsIgnoreCase(ctx.readStringAtCursor())) {<NEW_LINE>value = -value;<NEW_LINE>ctx.cursor().inc();<NEW_LINE>} else {<NEW_LINE>ctx.withCursorValue(snapshot);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new Pair<>(value, unit);<NEW_LINE>} | boolean unitMatches = matcher.matches(); |
842,820 | public void shutDown(CloseConnectionReason closeConnectionReason, @Nullable Runnable shutDownCompleteHandler) {<NEW_LINE>log.info("Connection shutdown started");<NEW_LINE>log.debug("shutDown: peersNodeAddressOptional={}, closeConnectionReason={}", peersNodeAddressOptional, closeConnectionReason);<NEW_LINE>connectionState.shutDown();<NEW_LINE>if (!stopped) {<NEW_LINE>String peersNodeAddress = peersNodeAddressOptional.map(NodeAddress::toString).orElse("null");<NEW_LINE>log.debug("\n\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n" + "ShutDown connection:" + "\npeersNodeAddress=" + peersNodeAddress + "\ncloseConnectionReason=" + closeConnectionReason + "\nuid=" + uid + "\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n");<NEW_LINE>if (closeConnectionReason.sendCloseMessage) {<NEW_LINE>new Thread(() -> {<NEW_LINE>try {<NEW_LINE>String reason = closeConnectionReason == CloseConnectionReason.RULE_VIOLATION ? getRuleViolation().name() : closeConnectionReason.name();<NEW_LINE>sendMessage(new CloseConnectionMessage(reason));<NEW_LINE>stopped = true;<NEW_LINE>Uninterruptibles.sleepUninterruptibly(200, TimeUnit.MILLISECONDS);<NEW_LINE>} catch (Throwable t) {<NEW_LINE>log.error(t.getMessage());<NEW_LINE>t.printStackTrace();<NEW_LINE>} finally {<NEW_LINE>stopped = true;<NEW_LINE>UserThread.execute(() -> doShutDown(closeConnectionReason, shutDownCompleteHandler));<NEW_LINE>}<NEW_LINE>}, "Connection:SendCloseConnectionMessage-" + this.uid).start();<NEW_LINE>} else {<NEW_LINE>stopped = true;<NEW_LINE>doShutDown(closeConnectionReason, shutDownCompleteHandler);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// TODO find out why we get called that<NEW_LINE>log.debug("stopped was already at shutDown call");<NEW_LINE>UserThread.execute(() <MASK><NEW_LINE>}<NEW_LINE>} | -> doShutDown(closeConnectionReason, shutDownCompleteHandler)); |
807,485 | public boolean apply(Game game, Ability source) {<NEW_LINE>Permanent blockedCreature = game.getPermanent(this.getTargetPointer().getFirst(game, source));<NEW_LINE>if (blockedCreature == null) {<NEW_LINE>// it can't be sacrificed, nothing happens<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>Set<UUID> blockingCreatures = new HashSet<>();<NEW_LINE>for (CombatGroup combatGroup : game.getCombat().getGroups()) {<NEW_LINE>if (combatGroup.getAttackers().contains(blockedCreature.getId())) {<NEW_LINE>blockingCreatures.addAll(combatGroup.getBlockers());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (blockedCreature.sacrifice(source, game)) {<NEW_LINE>for (UUID blockerId : blockingCreatures) {<NEW_LINE>Permanent <MASK><NEW_LINE>if (blockingCreature != null) {<NEW_LINE>blockingCreature.damage(4, blockedCreature.getId(), source, game, false, true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | blockingCreature = game.getPermanent(blockerId); |
1,006,445 | public static BatchJoinMeetingResponse unmarshall(BatchJoinMeetingResponse batchJoinMeetingResponse, UnmarshallerContext _ctx) {<NEW_LINE>batchJoinMeetingResponse.setRequestId(_ctx.stringValue("BatchJoinMeetingResponse.RequestId"));<NEW_LINE>batchJoinMeetingResponse.setMessage(_ctx.stringValue("BatchJoinMeetingResponse.Message"));<NEW_LINE>batchJoinMeetingResponse.setErrorCode(_ctx.integerValue("BatchJoinMeetingResponse.ErrorCode"));<NEW_LINE>batchJoinMeetingResponse.setSuccess(_ctx.booleanValue("BatchJoinMeetingResponse.Success"));<NEW_LINE>MeetingInfo meetingInfo = new MeetingInfo();<NEW_LINE>meetingInfo.setMeetingAppId(_ctx.stringValue("BatchJoinMeetingResponse.MeetingInfo.MeetingAppId"));<NEW_LINE>meetingInfo.setMeetingDomain(_ctx.stringValue("BatchJoinMeetingResponse.MeetingInfo.MeetingDomain"));<NEW_LINE>meetingInfo.setClientAppId(_ctx.stringValue("BatchJoinMeetingResponse.MeetingInfo.ClientAppId"));<NEW_LINE>meetingInfo.setMeetingCode(_ctx.stringValue("BatchJoinMeetingResponse.MeetingInfo.MeetingCode"));<NEW_LINE>meetingInfo.setMeetingUUID<MASK><NEW_LINE>SlsInfo slsInfo = new SlsInfo();<NEW_LINE>slsInfo.setLogServiceEndpoint(_ctx.stringValue("BatchJoinMeetingResponse.MeetingInfo.SlsInfo.LogServiceEndpoint"));<NEW_LINE>slsInfo.setLogstore(_ctx.stringValue("BatchJoinMeetingResponse.MeetingInfo.SlsInfo.Logstore"));<NEW_LINE>slsInfo.setProject(_ctx.stringValue("BatchJoinMeetingResponse.MeetingInfo.SlsInfo.Project"));<NEW_LINE>meetingInfo.setSlsInfo(slsInfo);<NEW_LINE>List<Member> memberList = new ArrayList<Member>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("BatchJoinMeetingResponse.MeetingInfo.MemberList.Length"); i++) {<NEW_LINE>Member member = new Member();<NEW_LINE>member.setUserId(_ctx.stringValue("BatchJoinMeetingResponse.MeetingInfo.MemberList[" + i + "].UserId"));<NEW_LINE>member.setMeetingToken(_ctx.stringValue("BatchJoinMeetingResponse.MeetingInfo.MemberList[" + i + "].MeetingToken"));<NEW_LINE>member.setMemberUUID(_ctx.stringValue("BatchJoinMeetingResponse.MeetingInfo.MemberList[" + i + "].MemberUUID"));<NEW_LINE>memberList.add(member);<NEW_LINE>}<NEW_LINE>meetingInfo.setMemberList(memberList);<NEW_LINE>batchJoinMeetingResponse.setMeetingInfo(meetingInfo);<NEW_LINE>return batchJoinMeetingResponse;<NEW_LINE>} | (_ctx.stringValue("BatchJoinMeetingResponse.MeetingInfo.MeetingUUID")); |
1,111,260 | public CreateSvmActiveDirectoryConfiguration unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>CreateSvmActiveDirectoryConfiguration createSvmActiveDirectoryConfiguration = new CreateSvmActiveDirectoryConfiguration();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("NetBiosName", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>createSvmActiveDirectoryConfiguration.setNetBiosName(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("SelfManagedActiveDirectoryConfiguration", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>createSvmActiveDirectoryConfiguration.setSelfManagedActiveDirectoryConfiguration(SelfManagedActiveDirectoryConfigurationJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return createSvmActiveDirectoryConfiguration;<NEW_LINE>} | String currentParentElement = context.getCurrentParentElement(); |
1,149,357 | public NonCodeUsageSearchInfo findUsages(@NotNull PsiElement element, @NotNull PsiElement[] allElementsToDelete, @NotNull List<UsageInfo> result) {<NEW_LINE>if (element instanceof ErlangFunction) {<NEW_LINE>Collection<PsiReference> all = ReferencesSearch.search(element).findAll();<NEW_LINE>for (PsiReference ref : all) {<NEW_LINE>PsiElement refElement = ref.getElement();<NEW_LINE>if (PsiTreeUtil.getParentOfType(refElement, ErlangSpecification.class) != null)<NEW_LINE>continue;<NEW_LINE>final boolean inExport = PsiTreeUtil.getParentOfType(refElement, ErlangExportFunction.class, false) != null;<NEW_LINE>result.add(new SafeDeleteReferenceSimpleDeleteUsageInfo(refElement, element, inExport) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void deleteElement() throws IncorrectOperationException {<NEW_LINE>PsiElement e = getElement();<NEW_LINE>if (isSafeDelete() && inExport && e != null) {<NEW_LINE>PsiElement <MASK><NEW_LINE>if (isComma(prev)) {<NEW_LINE>prev.delete();<NEW_LINE>} else {<NEW_LINE>PsiElement next = PsiTreeUtil.nextVisibleLeaf(e);<NEW_LINE>if (isComma(next)) {<NEW_LINE>next.delete();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>e.delete();<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Contract("null -> false")<NEW_LINE>private boolean isComma(@Nullable PsiElement leaf) {<NEW_LINE>return leaf instanceof LeafPsiElement && ((LeafPsiElement) leaf).getElementType() == ErlangTypes.ERL_COMMA;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | prev = PsiTreeUtil.prevVisibleLeaf(e); |
1,156,349 | public Object visit(ASTCompilationUnit node, Object data) {<NEW_LINE>Object superResult = <MASK><NEW_LINE>Info info = new Info();<NEW_LINE>List<ASTImportDeclaration> importDeclarations = node.findChildrenOfType(ASTImportDeclaration.class);<NEW_LINE>for (ASTImportDeclaration importDeclaration : importDeclarations) {<NEW_LINE>ASTName name = importDeclaration.getFirstChildOfType(ASTName.class);<NEW_LINE>info.executorsUsed = info.executorsUsed || (name.getType() == Executors.class || Executors.class.getName().equals(name.getImage()));<NEW_LINE>if (name.getImage().startsWith(Executors.class.getName() + DOT)) {<NEW_LINE>info.importedExecutorsMethods.add(name.getImage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<ASTPrimaryExpression> primaryExpressions = node.findDescendantsOfType(ASTPrimaryExpression.class);<NEW_LINE>for (ASTPrimaryExpression primaryExpression : primaryExpressions) {<NEW_LINE>if (!info.executorsUsed && info.importedExecutorsMethods.isEmpty()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Token initToken = (Token) primaryExpression.jjtGetFirstToken();<NEW_LINE>if (!checkInitStatement(initToken, info)) {<NEW_LINE>addViolationWithMessage(data, primaryExpression, "java.concurrent.ThreadPoolCreationRule.violation.msg");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return superResult;<NEW_LINE>} | super.visit(node, data); |
429,011 | public static void splitSameNamedVariablesOfDiffTypes(MethodNode node) {<NEW_LINE>if (node.localVariables == null)<NEW_LINE>return;<NEW_LINE>Map<Integer, LocalVariableNode> indexToVar = new HashMap<>();<NEW_LINE>Map<Integer, String> indexToName = new HashMap<>();<NEW_LINE>Map<String, Integer> nameToIndex = new HashMap<>();<NEW_LINE>boolean changed = false;<NEW_LINE>for (LocalVariableNode lvn : node.localVariables) {<NEW_LINE>int index = lvn.index;<NEW_LINE>String name = lvn.name;<NEW_LINE>if (indexToName.containsValue(name)) {<NEW_LINE>// The variable name is NOT unique.<NEW_LINE>// Set both variables names to <NAME + INDEX><NEW_LINE>// Even with 3+ duplicates, this method will give each a unique index-based name.<NEW_LINE>int otherIndex = nameToIndex.get(name);<NEW_LINE>LocalVariableNode <MASK><NEW_LINE>if (!lvn.desc.equals(otherLvn.desc)) {<NEW_LINE>if (index != otherIndex) {<NEW_LINE>// Different indices are used<NEW_LINE>lvn.name = name + index;<NEW_LINE>otherLvn.name = name + otherIndex;<NEW_LINE>} else {<NEW_LINE>// Same index but other type?<NEW_LINE>// Just give it a random name.<NEW_LINE>// TODO: Naming instead off of types would be better.<NEW_LINE>lvn.name = nextIndexName(name, node);<NEW_LINE>}<NEW_LINE>changed = true;<NEW_LINE>}<NEW_LINE>// Update maps<NEW_LINE>indexToVar.put(index, lvn);<NEW_LINE>indexToName.put(index, lvn.name);<NEW_LINE>nameToIndex.put(lvn.name, index);<NEW_LINE>} else {<NEW_LINE>// The variable name is unique.<NEW_LINE>// Update maps<NEW_LINE>indexToVar.put(index, lvn);<NEW_LINE>indexToName.put(index, name);<NEW_LINE>nameToIndex.put(name, index);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Logging<NEW_LINE>if (changed) {<NEW_LINE>Log.warn("Separating variables of same name pointing to different indices: " + node.name + node.desc);<NEW_LINE>}<NEW_LINE>} | otherLvn = indexToVar.get(otherIndex); |
531,928 | private static DependencyResolver pickOne(Properties properties, DefinitelyNotAClassLoader classLoader) {<NEW_LINE>String propPath = properties.getProperty("robolectric-deps.properties");<NEW_LINE>if (propPath != null) {<NEW_LINE>return new PropertiesDependencyResolver(Paths.get(propPath));<NEW_LINE>}<NEW_LINE>String <MASK><NEW_LINE>if (dependencyDir != null || Boolean.parseBoolean(properties.getProperty("robolectric.offline"))) {<NEW_LINE>return new LocalDependencyResolver(new File(dependencyDir == null ? "." : dependencyDir));<NEW_LINE>}<NEW_LINE>URL buildPathPropertiesUrl = classLoader.getResource("robolectric-deps.properties");<NEW_LINE>if (buildPathPropertiesUrl != null) {<NEW_LINE>return new PropertiesDependencyResolver(Paths.get(Fs.toUri(buildPathPropertiesUrl)));<NEW_LINE>}<NEW_LINE>Class<?> clazz;<NEW_LINE>try {<NEW_LINE>clazz = classLoader.loadClass("org.robolectric.internal.dependency.MavenDependencyResolver");<NEW_LINE>return (DependencyResolver) ReflectionHelpers.callConstructor(clazz);<NEW_LINE>} catch (ClassNotFoundException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>} | dependencyDir = properties.getProperty("robolectric.dependency.dir"); |
1,596,183 | private Mono<Response<RecipientUserCollectionInner>> listByNotificationWithResponseAsync(String resourceGroupName, String serviceName, NotificationName notificationName, 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 (serviceName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (notificationName == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.listByNotification(this.client.getEndpoint(), resourceGroupName, serviceName, notificationName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context);<NEW_LINE>} | error(new IllegalArgumentException("Parameter notificationName is required and cannot be null.")); |
893,132 | public AnnotationMirror convertAnnotationMirror(StringToJavaExpression stringToJavaExpr, AnnotationMirror anno) {<NEW_LINE>if (!isExpressionAnno(anno)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Map<ExecutableElement, List<JavaExpression>> <MASK><NEW_LINE>for (ExecutableElement element : getListOfExpressionElements(anno)) {<NEW_LINE>List<String> expressionStrings = AnnotationUtils.getElementValueArray(anno, element, String.class, Collections.emptyList());<NEW_LINE>List<JavaExpression> javaExprs = new ArrayList<>(expressionStrings.size());<NEW_LINE>newElements.put(element, javaExprs);<NEW_LINE>for (String expression : expressionStrings) {<NEW_LINE>JavaExpression result;<NEW_LINE>if (shouldPassThroughExpression(expression)) {<NEW_LINE>result = new PassThroughExpression(objectTM, expression);<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>result = stringToJavaExpr.toJavaExpression(expression);<NEW_LINE>} catch (JavaExpressionParseException e) {<NEW_LINE>result = createError(expression, e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (result != null) {<NEW_LINE>result = transform(result);<NEW_LINE>javaExprs.add(result);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return buildAnnotation(anno, newElements);<NEW_LINE>} | newElements = new HashMap<>(); |
1,655,371 | private static INaviCodeNode insertCodeNode(final INaviView target, final INaviCodeNode node) {<NEW_LINE>// TODO: cloning the node is a bad solution since this just fixes the symptoms: instructions are<NEW_LINE>// closed two times<NEW_LINE>final INaviCodeNode sourceNode = (INaviCodeNode) node.cloneNode();<NEW_LINE>final Iterable<INaviInstruction> instructions = sourceNode.getInstructions();<NEW_LINE>final ArrayList<INaviInstruction> instructionList = Lists.newArrayList(instructions);<NEW_LINE>CCodeNode codeNode;<NEW_LINE>try {<NEW_LINE>codeNode = target.getContent().createCodeNode(<MASK><NEW_LINE>} catch (final MaybeNullException e) {<NEW_LINE>codeNode = target.getContent().createCodeNode(null, instructionList);<NEW_LINE>}<NEW_LINE>if (sourceNode.getComments().getGlobalCodeNodeComment() != null) {<NEW_LINE>codeNode.getComments().initializeGlobalCodeNodeComment(sourceNode.getComments().getGlobalCodeNodeComment());<NEW_LINE>}<NEW_LINE>if (sourceNode.getComments().getLocalCodeNodeComment() != null) {<NEW_LINE>codeNode.getComments().initializeLocalCodeNodeComment(sourceNode.getComments().getLocalCodeNodeComment());<NEW_LINE>}<NEW_LINE>final Iterable<INaviInstruction> newInstructions = codeNode.getInstructions();<NEW_LINE>for (int i = 0; i < Iterables.size(instructions); i++) {<NEW_LINE>codeNode.getComments().initializeLocalInstructionComment(Iterables.get(newInstructions, i), sourceNode.getComments().getLocalInstructionComment(Iterables.get(instructions, i)));<NEW_LINE>}<NEW_LINE>return codeNode;<NEW_LINE>} | sourceNode.getParentFunction(), instructionList); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.