idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
235,480
public void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>((WordPress) getActivity().getApplication()).component().inject(this);<NEW_LINE>if (savedInstanceState != null) {<NEW_LINE>AppLog.d(T.READER, "reader post list > restoring instance state");<NEW_LINE>if (savedInstanceState.containsKey(ReaderConstants.ARG_TAG)) {<NEW_LINE>mCurrentTag = (ReaderTag) <MASK><NEW_LINE>}<NEW_LINE>if (savedInstanceState.containsKey(ReaderConstants.ARG_BLOG_ID)) {<NEW_LINE>mCurrentBlogId = savedInstanceState.getLong(ReaderConstants.ARG_BLOG_ID);<NEW_LINE>}<NEW_LINE>if (savedInstanceState.containsKey(ReaderConstants.ARG_FEED_ID)) {<NEW_LINE>mCurrentFeedId = savedInstanceState.getLong(ReaderConstants.ARG_FEED_ID);<NEW_LINE>}<NEW_LINE>if (savedInstanceState.containsKey(ReaderConstants.ARG_SEARCH_QUERY)) {<NEW_LINE>mCurrentSearchQuery = savedInstanceState.getString(ReaderConstants.ARG_SEARCH_QUERY);<NEW_LINE>}<NEW_LINE>if (savedInstanceState.containsKey(ReaderConstants.ARG_POST_LIST_TYPE)) {<NEW_LINE>mPostListType = (ReaderPostListType) savedInstanceState.getSerializable(ReaderConstants.ARG_POST_LIST_TYPE);<NEW_LINE>}<NEW_LINE>if (getPostListType() == ReaderPostListType.TAG_PREVIEW) {<NEW_LINE>mTagPreviewHistory.restoreInstance(savedInstanceState);<NEW_LINE>}<NEW_LINE>if (savedInstanceState.containsKey(ReaderConstants.ARG_IS_TOP_LEVEL)) {<NEW_LINE>mIsTopLevel = savedInstanceState.getBoolean(ReaderConstants.ARG_IS_TOP_LEVEL);<NEW_LINE>}<NEW_LINE>if (savedInstanceState.containsKey(ReaderConstants.ARG_ORIGINAL_TAG)) {<NEW_LINE>mTagFragmentStartedWith = (ReaderTag) savedInstanceState.getSerializable(ReaderConstants.ARG_ORIGINAL_TAG);<NEW_LINE>}<NEW_LINE>mRestorePosition = savedInstanceState.getInt(ReaderConstants.KEY_RESTORE_POSITION);<NEW_LINE>mSiteSearchRestorePosition = savedInstanceState.getInt(ReaderConstants.KEY_SITE_SEARCH_RESTORE_POSITION);<NEW_LINE>mWasPaused = savedInstanceState.getBoolean(ReaderConstants.KEY_WAS_PAUSED);<NEW_LINE>mHasUpdatedPosts = savedInstanceState.getBoolean(ReaderConstants.KEY_ALREADY_UPDATED);<NEW_LINE>mFirstLoad = savedInstanceState.getBoolean(ReaderConstants.KEY_FIRST_LOAD);<NEW_LINE>mSearchTabsPos = savedInstanceState.getInt(ReaderConstants.KEY_ACTIVE_SEARCH_TAB, NO_POSITION);<NEW_LINE>mQuickStartEvent = savedInstanceState.getParcelable(QuickStartEvent.KEY);<NEW_LINE>}<NEW_LINE>}
savedInstanceState.getSerializable(ReaderConstants.ARG_TAG);
183,682
public void writeSFixed64List(int fieldNumber, List<Long> value, boolean packed) throws IOException {<NEW_LINE>if (packed) {<NEW_LINE>output.writeTag(fieldNumber, WIRETYPE_LENGTH_DELIMITED);<NEW_LINE>// Compute and write the length of the data.<NEW_LINE>int dataSize = 0;<NEW_LINE>for (int i = 0; i < value.size(); ++i) {<NEW_LINE>dataSize += CodedOutputStream.computeSFixed64SizeNoTag(value.get(i));<NEW_LINE>}<NEW_LINE>output.writeUInt32NoTag(dataSize);<NEW_LINE>// Write the data itself, without any tags.<NEW_LINE>for (int i = 0; i < value.size(); ++i) {<NEW_LINE>output.writeSFixed64NoTag<MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>for (int i = 0; i < value.size(); ++i) {<NEW_LINE>output.writeSFixed64(fieldNumber, value.get(i));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
(value.get(i));
1,849,638
public void propagate(InstanceState state) {<NEW_LINE>// get attributes<NEW_LINE>BitWidth dataWidth = state.getAttributeValue(StdAttr.WIDTH);<NEW_LINE>// compute outputs<NEW_LINE>Value gt = Value.FALSE;<NEW_LINE>Value eq = Value.TRUE;<NEW_LINE>Value lt = Value.FALSE;<NEW_LINE>Value a = state.getPortValue(IN0);<NEW_LINE>Value b = state.getPortValue(IN1);<NEW_LINE>Value[] ax = a.getAll();<NEW_LINE>Value[] bx = b.getAll();<NEW_LINE>int maxlen = Math.max(ax.length, bx.length);<NEW_LINE>for (int pos = maxlen - 1; pos >= 0; pos--) {<NEW_LINE>Value ab = pos < ax.length ? ax[pos] : Value.ERROR;<NEW_LINE>Value bb = pos < bx.length ? bx[pos] : Value.ERROR;<NEW_LINE>if (pos == ax.length - 1 && ab != bb) {<NEW_LINE>Object <MASK><NEW_LINE>if (mode != UNSIGNED_OPTION) {<NEW_LINE>Value t = ab;<NEW_LINE>ab = bb;<NEW_LINE>bb = t;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (ab == Value.ERROR || bb == Value.ERROR) {<NEW_LINE>gt = Value.ERROR;<NEW_LINE>eq = Value.ERROR;<NEW_LINE>lt = Value.ERROR;<NEW_LINE>break;<NEW_LINE>} else if (ab == Value.UNKNOWN || bb == Value.UNKNOWN) {<NEW_LINE>gt = Value.UNKNOWN;<NEW_LINE>eq = Value.UNKNOWN;<NEW_LINE>lt = Value.UNKNOWN;<NEW_LINE>break;<NEW_LINE>} else if (ab != bb) {<NEW_LINE>eq = Value.FALSE;<NEW_LINE>if (ab == Value.TRUE)<NEW_LINE>gt = Value.TRUE;<NEW_LINE>else<NEW_LINE>lt = Value.TRUE;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// propagate them<NEW_LINE>int delay = (dataWidth.getWidth() + 2) * Adder.PER_DELAY;<NEW_LINE>state.setPort(GT, gt, delay);<NEW_LINE>state.setPort(EQ, eq, delay);<NEW_LINE>state.setPort(LT, lt, delay);<NEW_LINE>}
mode = state.getAttributeValue(MODE_ATTR);
423,718
public void actionPerformed(ActionEvent e) {<NEW_LINE>UIHelper uiHelper = new UIHelper(owlEditorKit);<NEW_LINE>Set<OWLOntology> ontologies = uiHelper.pickOWLOntologies();<NEW_LINE>for (OWLOntology ont : ontologies) {<NEW_LINE>// @@TODO what about anonymous ontologies?<NEW_LINE>String uriString = ont.getOntologyID().getDefaultDocumentIRI().get().toString();<NEW_LINE>String prefix;<NEW_LINE>if (uriString.endsWith("/")) {<NEW_LINE>String sub = uriString.substring(0, <MASK><NEW_LINE>prefix = sub.substring(sub.lastIndexOf("/") + 1, sub.length());<NEW_LINE>} else {<NEW_LINE>prefix = uriString.substring(uriString.lastIndexOf('/') + 1, uriString.length());<NEW_LINE>}<NEW_LINE>if (prefix.endsWith(".owl")) {<NEW_LINE>prefix = prefix.substring(0, prefix.length() - 4);<NEW_LINE>}<NEW_LINE>prefix = prefix.toLowerCase();<NEW_LINE>if (!uriString.endsWith("#") && !uriString.endsWith("/")) {<NEW_LINE>uriString = uriString + "#";<NEW_LINE>}<NEW_LINE>PrefixMapperTable table = tables.getPrefixMapperTable();<NEW_LINE>int index = table.getModel().addMapping(prefix, uriString);<NEW_LINE>table.getSelectionModel().setSelectionInterval(index, index);<NEW_LINE>}<NEW_LINE>}
uriString.length() - 1);
1,148,296
public okhttp3.Call readNodeCall(String name, String pretty, final ApiCallback _callback) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/api/v1/nodes/{name}".replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString()));<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();<NEW_LINE>if (pretty != null) {<NEW_LINE>localVarQueryParams.addAll(localVarApiClient.parameterToPair("pretty", pretty));<NEW_LINE>}<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, String> localVarCookieParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new <MASK><NEW_LINE>final String[] localVarAccepts = { "application/json", "application/yaml", "application/vnd.kubernetes.protobuf" };<NEW_LINE>final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>if (localVarAccept != null) {<NEW_LINE>localVarHeaderParams.put("Accept", localVarAccept);<NEW_LINE>}<NEW_LINE>final String[] localVarContentTypes = {};<NEW_LINE>final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>String[] localVarAuthNames = new String[] { "BearerToken" };<NEW_LINE>return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);<NEW_LINE>}
HashMap<String, Object>();
1,802,448
void calc(FastDistanceSparseData left, FastDistanceSparseData right, double[] res) {<NEW_LINE>Arrays.fill(res, 0.0);<NEW_LINE>int[][] leftIndices = left.getIndices();<NEW_LINE>int[][] rightIndices = right.getIndices();<NEW_LINE>double[][] leftValues = left.getValues();<NEW_LINE>double[][] rightValues = right.getValues();<NEW_LINE>Preconditions.checkArgument(leftIndices.length == rightIndices.length, "VectorSize not equal!");<NEW_LINE>for (int i = 0; i < leftIndices.length; i++) {<NEW_LINE>int[] leftIndicesList = leftIndices[i];<NEW_LINE>int[] rightIndicesList = rightIndices[i];<NEW_LINE>double[] leftValuesList = leftValues[i];<NEW_LINE>double[] rightValuesList = rightValues[i];<NEW_LINE>if (null != leftIndicesList) {<NEW_LINE>for (int j = 0; j < leftIndicesList.length; j++) {<NEW_LINE>double leftValue = leftValuesList[j];<NEW_LINE>int startIndex = leftIndicesList[j] * right.vectorNum;<NEW_LINE>if (null != rightIndicesList) {<NEW_LINE>for (int k = 0; k < rightIndicesList.length; k++) {<NEW_LINE>res[startIndex + rightIndicesList[k]] -= (Math.abs(rightValuesList[k]) + Math.abs(leftValue) - Math.abs(rightValuesList[k] - leftValue));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int leftCnt = 0;<NEW_LINE>int rightCnt = 0;<NEW_LINE>int numRow = right.vectorNum;<NEW_LINE>double[] leftSum = left.label.getData();<NEW_LINE>double[] rightSum <MASK><NEW_LINE>for (int i = 0; i < res.length; i++) {<NEW_LINE>if (rightCnt == numRow) {<NEW_LINE>rightCnt = 0;<NEW_LINE>leftCnt++;<NEW_LINE>}<NEW_LINE>res[i] += rightSum[rightCnt++] + leftSum[leftCnt];<NEW_LINE>}<NEW_LINE>}
= right.label.getData();
861,916
private void loadNode1180() {<NEW_LINE>PropertyTypeNode node = new PropertyTypeNode(this.context, Identifiers.ProgramStateMachineType_ProgramDiagnostics_LastMethodCall, new QualifiedName(0, "LastMethodCall"), new LocalizedText("en", "LastMethodCall"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), new DataValue(Variant.NULL_VALUE), Identifiers.String, -1, new UInteger[] {}, UByte.valueOf(1), UByte.valueOf(1), 0.0, false);<NEW_LINE>node.addReference(new Reference(Identifiers.ProgramStateMachineType_ProgramDiagnostics_LastMethodCall, Identifiers.HasTypeDefinition, Identifiers.PropertyType.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ProgramStateMachineType_ProgramDiagnostics_LastMethodCall, Identifiers.HasModellingRule, Identifiers.ModellingRule_Mandatory.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ProgramStateMachineType_ProgramDiagnostics_LastMethodCall, Identifiers.HasProperty, Identifiers.ProgramStateMachineType_ProgramDiagnostics.expanded(), false));<NEW_LINE><MASK><NEW_LINE>}
this.nodeManager.addNode(node);
338,992
public void updateUserRole(UserRequest user) {<NEW_LINE><MASK><NEW_LINE>UserGroupExample userGroupExample = new UserGroupExample();<NEW_LINE>userGroupExample.createCriteria().andUserIdEqualTo(userId);<NEW_LINE>List<UserGroup> userGroups = userGroupMapper.selectByExample(userGroupExample);<NEW_LINE>List<String> list = userGroups.stream().map(UserGroup::getSourceId).collect(Collectors.toList());<NEW_LINE>if (!CollectionUtils.isEmpty(list)) {<NEW_LINE>if (list.contains(user.getLastWorkspaceId())) {<NEW_LINE>user.setLastWorkspaceId(null);<NEW_LINE>userMapper.updateByPrimaryKeySelective(user);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>userGroupMapper.deleteByExample(userGroupExample);<NEW_LINE>List<Map<String, Object>> groups = user.getGroups();<NEW_LINE>if (!groups.isEmpty()) {<NEW_LINE>insertUserGroup(groups, user.getId());<NEW_LINE>}<NEW_LINE>UserExample example = new UserExample();<NEW_LINE>UserExample.Criteria criteria = example.createCriteria();<NEW_LINE>criteria.andEmailEqualTo(user.getEmail());<NEW_LINE>criteria.andIdNotEqualTo(user.getId());<NEW_LINE>if (userMapper.countByExample(example) > 0) {<NEW_LINE>MSException.throwException(Translator.get("user_email_already_exists"));<NEW_LINE>}<NEW_LINE>user.setUpdateTime(System.currentTimeMillis());<NEW_LINE>userMapper.updateByPrimaryKeySelective(user);<NEW_LINE>}
String userId = user.getId();
195,939
public void run(RegressionEnvironment env) {<NEW_LINE>String startTime = "2002-05-30T09:00:00.000";<NEW_LINE>env.advanceTime(DateTime.parseDefaultMSec(startTime));<NEW_LINE>String sdfPattern = "yyyy.MM.dd G 'at' HH:mm:ss";<NEW_LINE>SimpleDateFormat sdf = new SimpleDateFormat(sdfPattern);<NEW_LINE>DateTimeFormatter dtf = DateTimeFormatter.ofPattern(sdfPattern);<NEW_LINE>String[] fields = "val0,val1,val2,val3,val4,val5,val6".split(",");<NEW_LINE>String eplFragment = "@name('s0') select " + "longdate.format(\"" + sdfPattern + "\") as val0," + "utildate.format(\"" + sdfPattern + "\") as val1," + "caldate.format(\"" + sdfPattern + "\") as val2," + "localdate.format(\"" + sdfPattern + "\") as val3," + "zoneddate.format(\"" + sdfPattern + "\") as val4," + "utildate.format(SimpleDateFormat.getDateInstance()) as val5," + "localdate.format(java.time.format.DateTimeFormatter.BASIC_ISO_DATE) as val6" + " from SupportDateTime";<NEW_LINE>env.compileDeploy(eplFragment).addListener("s0");<NEW_LINE>env.assertStmtTypesAllSame("s0", fields, EPTypePremade.STRING.getEPType());<NEW_LINE>SupportDateTime sdt = SupportDateTime.make(startTime);<NEW_LINE>env.sendEventBean<MASK><NEW_LINE>Object[] expected = new Object[] { sdf.format(sdt.getLongdate()), sdf.format(sdt.getUtildate()), sdf.format(sdt.getCaldate().getTime()), sdt.getLocaldate().format(dtf), sdt.getZoneddate().format(dtf), SimpleDateFormat.getDateInstance().format(sdt.getUtildate()), sdt.getLocaldate().format(DateTimeFormatter.BASIC_ISO_DATE) };<NEW_LINE>env.assertPropsNew("s0", fields, expected);<NEW_LINE>env.sendEventBean(SupportDateTime.make(null));<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { null, null, null, null, null, null, null });<NEW_LINE>env.undeployAll();<NEW_LINE>}
(SupportDateTime.make(startTime));
534,385
public DeleteServiceTemplateResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>DeleteServiceTemplateResult deleteServiceTemplateResult = new DeleteServiceTemplateResult();<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 deleteServiceTemplateResult;<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("serviceTemplate", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>deleteServiceTemplateResult.setServiceTemplate(ServiceTemplateJsonUnmarshaller.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 deleteServiceTemplateResult;<NEW_LINE>}
JsonToken token = context.getCurrentToken();
685,697
private static Object evalNumeric(Number left, Number right, QueryDataTypeFamily family) {<NEW_LINE>try {<NEW_LINE>switch(family) {<NEW_LINE>case TINYINT:<NEW_LINE>return (byte) (left.byteValue() / right.longValue());<NEW_LINE>case SMALLINT:<NEW_LINE>return (short) (left.shortValue(<MASK><NEW_LINE>case INTEGER:<NEW_LINE>return (int) (left.intValue() / right.longValue());<NEW_LINE>case BIGINT:<NEW_LINE>return ExpressionMath.divideExact(left.longValue(), right.longValue());<NEW_LINE>case REAL:<NEW_LINE>return ExpressionMath.divideExact(left.floatValue(), right.floatValue());<NEW_LINE>case DOUBLE:<NEW_LINE>return ExpressionMath.divideExact(left.doubleValue(), right.doubleValue());<NEW_LINE>case DECIMAL:<NEW_LINE>return ((BigDecimal) left).divide((BigDecimal) right, DECIMAL_MATH_CONTEXT);<NEW_LINE>default:<NEW_LINE>throw new IllegalArgumentException("Unexpected result family: " + family);<NEW_LINE>}<NEW_LINE>} catch (ArithmeticException e) {<NEW_LINE>throw QueryException.error(SqlErrorCode.DATA_EXCEPTION, "Division by zero", e);<NEW_LINE>}<NEW_LINE>}
) / right.longValue());
1,476,640
void start() throws IOException {<NEW_LINE>if (compactedLogFile != null && compactedLogFile.exists()) {<NEW_LINE><MASK><NEW_LINE>String compactedFilename = compactedLogFile.getName();<NEW_LINE>// create a hard link "x.log" for file "x.log.y.compacted"<NEW_LINE>this.newEntryLogFile = new File(dir, compactedFilename.substring(0, compactedFilename.indexOf(".log") + 4));<NEW_LINE>if (!newEntryLogFile.exists()) {<NEW_LINE>HardLink.createHardLink(compactedLogFile, newEntryLogFile);<NEW_LINE>}<NEW_LINE>if (isInRecovery) {<NEW_LINE>recoverEntryLocations(EntryLogger.fileName2LogId(newEntryLogFile.getName()));<NEW_LINE>}<NEW_LINE>if (!offsets.isEmpty()) {<NEW_LINE>// update entry locations and flush index<NEW_LINE>ledgerStorage.updateEntriesLocations(offsets);<NEW_LINE>ledgerStorage.flushEntriesLocationsIndex();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new IOException("Failed to find compacted log file in UpdateIndexPhase");<NEW_LINE>}<NEW_LINE>}
File dir = compactedLogFile.getParentFile();
928,908
public void draw(DrawHandler drawHandler, DrawingInfo drawingInfo) {<NEW_LINE>double width = drawingInfo.getSymmetricWidth(getFirstLifeline(), getLastLifeline(), tick);<NEW_LINE>double height = TextSplitter.getSplitStringHeight(textLines, width - ROUND_PART_WIDTH * 2, drawHandler) + VERTICAL_BORDER_PADDING * 2;<NEW_LINE>double topY = drawingInfo.getVerticalStart(tick);<NEW_LINE>topY += (drawingInfo.getTickHeight(tick) - height) / 2;<NEW_LINE>double leftX = drawingInfo.getHDrawingInfo(getFirstLifeline<MASK><NEW_LINE>drawHandler.drawArc(leftX, topY, ROUND_PART_WIDTH * 2, height, 90, 180, true);<NEW_LINE>width = width - ROUND_PART_WIDTH * 2;<NEW_LINE>drawHandler.drawArc(leftX + width, topY, ROUND_PART_WIDTH * 2, height, 270, 180, true);<NEW_LINE>drawHandler.drawLine(leftX + ROUND_PART_WIDTH, topY, leftX + width + ROUND_PART_WIDTH, topY);<NEW_LINE>drawHandler.drawLine(leftX + ROUND_PART_WIDTH, topY + height, leftX + width + ROUND_PART_WIDTH, topY + height);<NEW_LINE>TextSplitter.drawText(drawHandler, textLines, leftX + ROUND_PART_WIDTH, topY, width, height, AlignHorizontal.CENTER, AlignVertical.CENTER);<NEW_LINE>for (Lifeline ll : coveredLifelines) {<NEW_LINE>drawingInfo.getDrawingInfo(ll).addInterruptedArea(new Line1D(topY, topY + height));<NEW_LINE>}<NEW_LINE>}
()).getSymmetricHorizontalStart(tick);
1,724,194
public static ExtendedUri parseExtendedUri(final Element element) throws ParseException {<NEW_LINE>try {<NEW_LINE>final URI uri = new URI(getChild(element, "default-uri").getTextContent());<NEW_LINE>final long size = Long.parseLong(element.getAttribute("size"));<NEW_LINE>final String <MASK><NEW_LINE>final List<URI> alternates = new LinkedList<URI>();<NEW_LINE>for (Element alternateElement : XMLUtils.getChildren(element, "alternate-uri")) {<NEW_LINE>alternates.add(new URI(alternateElement.getTextContent()));<NEW_LINE>}<NEW_LINE>if (uri.getScheme().equals("file")) {<NEW_LINE>return new ExtendedUri(uri, alternates, uri, size, md5);<NEW_LINE>} else {<NEW_LINE>return new ExtendedUri(uri, alternates, size, md5);<NEW_LINE>}<NEW_LINE>} catch (URISyntaxException e) {<NEW_LINE>throw new ParseException("Cannot parse extended URI", e);<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>throw new ParseException("Cannot parse extended URI", e);<NEW_LINE>}<NEW_LINE>}
md5 = element.getAttribute("md5");
1,340,869
private Set<BrokerEntity> detectMetricAnomalies(Map<BrokerEntity, ValuesAndExtrapolations> metricsHistoryByBroker, Map<BrokerEntity, ValuesAndExtrapolations> currentMetricsByBroker) {<NEW_LINE>// Preprocess raw metrics to get the metrics of interest for each broker.<NEW_LINE>Map<BrokerEntity, List<Double>> historicalLogFlushTimeMetricValues = new HashMap<>();<NEW_LINE>Map<BrokerEntity, Double> currentLogFlushTimeMetricValues = new HashMap<>();<NEW_LINE>Map<BrokerEntity, List<Double>> historicalPerByteLogFlushTimeMetricValues = new HashMap<>();<NEW_LINE>Map<BrokerEntity, Double> currentPerByteLogFlushTimeMetricValues = new HashMap<>();<NEW_LINE>Set<Integer> skippedBrokers = new HashSet<>();<NEW_LINE>for (Map.Entry<BrokerEntity, ValuesAndExtrapolations> entry : currentMetricsByBroker.entrySet()) {<NEW_LINE><MASK><NEW_LINE>if (!brokerHasNegligibleTraffic(broker, entry.getValue().metricValues())) {<NEW_LINE>collectLogFlushTimeMetric(broker, metricsHistoryByBroker.get(broker), entry.getValue(), historicalLogFlushTimeMetricValues, currentLogFlushTimeMetricValues);<NEW_LINE>collectPerByteLogFlushTimeMetric(broker, metricsHistoryByBroker.get(broker), entry.getValue(), historicalPerByteLogFlushTimeMetricValues, currentPerByteLogFlushTimeMetricValues);<NEW_LINE>} else {<NEW_LINE>skippedBrokers.add(broker.brokerId());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!skippedBrokers.isEmpty()) {<NEW_LINE>LOG.info("Skip slowness check for brokers {} because they serve negligible traffic.", skippedBrokers);<NEW_LINE>}<NEW_LINE>Set<BrokerEntity> detectedMetricAnomalies = getMetricAnomalies(historicalLogFlushTimeMetricValues, currentLogFlushTimeMetricValues);<NEW_LINE>detectedMetricAnomalies.retainAll(getMetricAnomalies(historicalPerByteLogFlushTimeMetricValues, currentPerByteLogFlushTimeMetricValues));<NEW_LINE>detectedMetricAnomalies.retainAll(getLogFlushTimeMetricAnomaliesFromValue(currentLogFlushTimeMetricValues));<NEW_LINE>return detectedMetricAnomalies;<NEW_LINE>}
BrokerEntity broker = entry.getKey();
1,848,903
void updatePowerSavingsLabels() {<NEW_LINE>boolean isMotionSensorOn = ClientPrefs.getInstance(mView.getContext()).isMotionSensorEnabled();<NEW_LINE>int battPct = ClientPrefs.getInstance(mView.getContext()).getMinBatteryPercent();<NEW_LINE>TextView tv = (TextView) mView.findViewById(R.id.textview_stop_at_battery);<NEW_LINE>String s = String.format(mView.getResources().getString(R.string.stop_at_x_battery), battPct);<NEW_LINE>tv.setText(s);<NEW_LINE>tv = (TextView) mView.findViewById(R.id.textview_motion_detection);<NEW_LINE>final String onOrOff = isMotionSensorOn ? mView.getResources().getString(R.string.on) : mView.getResources().<MASK><NEW_LINE>s = String.format(mView.getResources().getString(R.string.motion_detection_onoff), onOrOff);<NEW_LINE>tv.setText(s);<NEW_LINE>}
getString(R.string.off);
62,647
private void writeToCsv(List<List<?>> data) {<NEW_LINE>if (titles != null) {<NEW_LINE>synchronized (this) {<NEW_LINE>if (titles == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>data.add(0, titles);<NEW_LINE>titles = null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<String> content = data.stream().map(d -> {<NEW_LINE>return d.stream().map(v -> {<NEW_LINE>if (v == null) {<NEW_LINE>return "";<NEW_LINE>}<NEW_LINE>String vStr = v.toString();<NEW_LINE>vStr = PATTERN_QUOTES.matcher(vStr).replaceAll("\"\"");<NEW_LINE>boolean hasComma = PATTERN_QUOTES_PREMISE.matcher(v.<MASK><NEW_LINE>if (hasComma) {<NEW_LINE>vStr = "\"" + vStr + "\"";<NEW_LINE>}<NEW_LINE>return vStr;<NEW_LINE>}).collect(Collectors.joining(Constants.COMMA));<NEW_LINE>}).collect(Collectors.toCollection(LinkedList::new));<NEW_LINE>synchronized (this) {<NEW_LINE>try {<NEW_LINE>if (csv == null) {<NEW_LINE>Path csvTemp = TempFileOperator.createTempFile("d_t_c", Constants.CSV);<NEW_LINE>csv = new Csv(csvTemp);<NEW_LINE>}<NEW_LINE>Files.write(csv.getFilePath(), content, StandardCharsets.UTF_8, StandardOpenOption.APPEND);<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
toString()).find();
1,087,688
public final int addCluster(final String clusterName, final int requestedId) {<NEW_LINE>try {<NEW_LINE>stateLock.acquireWriteLock();<NEW_LINE>try {<NEW_LINE>interruptionManager.enterCriticalPath();<NEW_LINE>checkOpennessAndMigration();<NEW_LINE>checkIfThreadIsBlocked();<NEW_LINE>if (requestedId < 0) {<NEW_LINE>throw new OConfigurationException("Cluster id must be positive!");<NEW_LINE>}<NEW_LINE>if (requestedId < clusters.size() && clusters.get(requestedId) != null) {<NEW_LINE>throw new OConfigurationException("Requested cluster ID [" + requestedId + "] is occupied by cluster with name [" + clusters.get(requestedId<MASK><NEW_LINE>}<NEW_LINE>makeStorageDirty();<NEW_LINE>return atomicOperationsManager.calculateInsideAtomicOperation(null, atomicOperation -> doAddCluster(atomicOperation, clusterName, requestedId));<NEW_LINE>} catch (final IOException e) {<NEW_LINE>throw OException.wrapException(new OStorageException("Error in creation of new cluster '" + clusterName + "'"), e);<NEW_LINE>} finally {<NEW_LINE>stateLock.releaseWriteLock();<NEW_LINE>interruptionManager.exitCriticalPath();<NEW_LINE>}<NEW_LINE>} catch (final RuntimeException ee) {<NEW_LINE>throw logAndPrepareForRethrow(ee);<NEW_LINE>} catch (final Error ee) {<NEW_LINE>throw logAndPrepareForRethrow(ee);<NEW_LINE>} catch (final Throwable t) {<NEW_LINE>throw logAndPrepareForRethrow(t);<NEW_LINE>}<NEW_LINE>}
).getName() + "]");
1,330,401
public synchronized void performRequest(final Collection<K> keys, final TimestampBound timestampBound, final RequestResponseHandler<HashMap<K, V>, F> handler) {<NEW_LINE>final HashSet<K> keysRemaining = new HashSet<>(keys);<NEW_LINE>final HashMap<K, V> cacheResult = new HashMap<>(keys.size());<NEW_LINE>long oldestTimestamp = Long.MAX_VALUE;<NEW_LINE>for (final K key : keys) {<NEW_LINE>final CacheEntry entry = cached.get(key);<NEW_LINE>if (entry != null) {<NEW_LINE>final V value = entry.data;<NEW_LINE>if (timestampBound.verifyTimestamp(value.getTimestamp())) {<NEW_LINE>keysRemaining.remove(key);<NEW_LINE>cacheResult.put(key, value);<NEW_LINE>oldestTimestamp = Math.min(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!keysRemaining.isEmpty()) {<NEW_LINE>final long outerOldestTimestamp = oldestTimestamp;<NEW_LINE>cacheDataSource.performRequest(keysRemaining, timestampBound, new RequestResponseHandler<HashMap<K, V>, F>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onRequestFailed(final F failureReason) {<NEW_LINE>handler.onRequestFailed(failureReason);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onRequestSuccess(final HashMap<K, V> result, final long timeCached) {<NEW_LINE>cacheResult.putAll(result);<NEW_LINE>handler.onRequestSuccess(cacheResult, Math.min(timeCached, outerOldestTimestamp));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} else {<NEW_LINE>handler.onRequestSuccess(cacheResult, oldestTimestamp);<NEW_LINE>}<NEW_LINE>}
oldestTimestamp, value.getTimestamp());
1,165,261
public static void parsePodTemplate(AbstractModel model, PodTemplate pod) {<NEW_LINE>if (pod != null) {<NEW_LINE>if (pod.getMetadata() != null) {<NEW_LINE>model.templatePodLabels = pod.getMetadata().getLabels();<NEW_LINE>model.templatePodAnnotations = pod.getMetadata().getAnnotations();<NEW_LINE>}<NEW_LINE>if (pod.getAffinity() != null) {<NEW_LINE>model.setUserAffinity(pod.getAffinity());<NEW_LINE>}<NEW_LINE>if (pod.getTolerations() != null) {<NEW_LINE>model.setTolerations(removeEmptyValuesFromTolerations<MASK><NEW_LINE>}<NEW_LINE>model.templateTerminationGracePeriodSeconds = pod.getTerminationGracePeriodSeconds();<NEW_LINE>model.templateImagePullSecrets = pod.getImagePullSecrets();<NEW_LINE>model.templateSecurityContext = pod.getSecurityContext();<NEW_LINE>model.templatePodPriorityClassName = pod.getPriorityClassName();<NEW_LINE>model.templatePodSchedulerName = pod.getSchedulerName();<NEW_LINE>model.templatePodHostAliases = pod.getHostAliases();<NEW_LINE>model.templatePodTopologySpreadConstraints = pod.getTopologySpreadConstraints();<NEW_LINE>model.templatePodEnableServiceLinks = pod.getEnableServiceLinks();<NEW_LINE>model.templateTmpDirSizeLimit = pod.getTmpDirSizeLimit();<NEW_LINE>}<NEW_LINE>}
(pod.getTolerations()));
1,719,887
static GoCompile createGoCompileRule(BuildTarget buildTarget, ProjectFilesystem projectFilesystem, BuildRuleParams params, ActionGraphBuilder graphBuilder, GoBuckConfig goBuckConfig, Path packageName, ImmutableSet<SourcePath> srcs, List<String> compilerFlags, List<String> assemblerFlags, GoPlatform platform, Iterable<BuildTarget> deps, Iterable<BuildTarget> cgoDeps, List<ListType> goListTypes) {<NEW_LINE>Preconditions.checkState(buildTarget.getFlavors().contains(platform.getFlavor()));<NEW_LINE>ImmutableSet<GoLinkable> linkables = requireGoLinkables(buildTarget, graphBuilder, platform, deps);<NEW_LINE>ImmutableList.Builder<BuildRule> linkableDepsBuilder = ImmutableList.builder();<NEW_LINE>for (GoLinkable linkable : linkables) {<NEW_LINE>linkableDepsBuilder.addAll(linkable.getDeps(graphBuilder));<NEW_LINE>}<NEW_LINE>BuildTarget target = createSymlinkTreeTarget(buildTarget);<NEW_LINE>MappedSymlinkTree symlinkTree = makeSymlinkTree(target, projectFilesystem, graphBuilder, linkables);<NEW_LINE>graphBuilder.addToIndex(symlinkTree);<NEW_LINE>ImmutableList.Builder<SourcePath> extraAsmOutputsBuilder = ImmutableList.builder();<NEW_LINE>ImmutableSet.Builder<SourcePath> generatedSrcBuilder = ImmutableSet.builder();<NEW_LINE>for (BuildTarget cgoBuildTarget : cgoDeps) {<NEW_LINE>CGoLibrary lib = <MASK><NEW_LINE>generatedSrcBuilder.addAll(lib.getGeneratedGoSource());<NEW_LINE>extraAsmOutputsBuilder.add(lib.getOutput());<NEW_LINE>linkableDepsBuilder.add(lib);<NEW_LINE>}<NEW_LINE>LOG.verbose("Symlink tree for compiling %s: %s", buildTarget, symlinkTree.getLinks());<NEW_LINE>return new GoCompile(buildTarget, projectFilesystem, params.copyAppendingExtraDeps(linkableDepsBuilder.build()).copyAppendingExtraDeps(ImmutableList.of(symlinkTree)).copyAppendingExtraDeps(getDependenciesFromSources(graphBuilder, srcs)), symlinkTree, packageName, getPackageImportMap(goBuckConfig.getVendorPaths(), buildTarget.getCellRelativeBasePath().getPath(), linkables.stream().flatMap(input -> input.getGoLinkInput().keySet().stream()).collect(ImmutableList.toImmutableList())), srcs, generatedSrcBuilder.build(), ImmutableList.copyOf(compilerFlags), ImmutableList.copyOf(assemblerFlags), platform, goBuckConfig.getGensymabis(), extraAsmOutputsBuilder.build(), goListTypes);<NEW_LINE>}
getCGoLibrary(graphBuilder, platform, cgoBuildTarget);
1,631,278
public void renderTileEntityAt(TileGenericPipe pipe, double x, double y, double z, float f, int argumentthatisalwaysminusone) {<NEW_LINE>if (BuildCraftCore.render == RenderMode.NoDynamic) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (pipe.pipe == null)<NEW_LINE>return;<NEW_LINE>if (pipe.pipe.container == null)<NEW_LINE>return;<NEW_LINE>Minecraft.getMinecraft().mcProfiler.startSection("bc");<NEW_LINE>Minecraft.getMinecraft().mcProfiler.startSection("pipe");<NEW_LINE>Minecraft.getMinecraft().mcProfiler.startSection("wire");<NEW_LINE>renderWire(pipe, x, y, z);<NEW_LINE>Minecraft.getMinecraft().mcProfiler.endStartSection("pluggable");<NEW_LINE>renderPluggables(pipe, x, y, z);<NEW_LINE>Minecraft.getMinecraft().mcProfiler.endStartSection("contents");<NEW_LINE>if (pipe.pipe.transport != null) {<NEW_LINE>try {<NEW_LINE>PipeTransportRenderer renderer = PipeTransportRenderer.RENDERER_MAP.get(pipe.pipe.transport.getClass());<NEW_LINE>if (renderer != null) {<NEW_LINE>renderer.render(pipe.pipe, x, y, z, f);<NEW_LINE>}<NEW_LINE>} catch (Throwable t) {<NEW_LINE>BCLog.logger.warn("A crash! Oh no!", t);<NEW_LINE>throw Throwables.propagate(t);<NEW_LINE>} finally {<NEW_LINE>Minecraft.getMinecraft().mcProfiler.endSection();<NEW_LINE>Minecraft.getMinecraft<MASK><NEW_LINE>Minecraft.getMinecraft().mcProfiler.endSection();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
().mcProfiler.endSection();
955,836
private void writeSnapshotAndCount(MetricName metricName, Snapshot snapshot, long count, double factor, String helpMessage) throws IOException {<NEW_LINE><MASK><NEW_LINE>writer.writeHelp(sanitizeName, helpMessage);<NEW_LINE>writer.writeType(sanitizeName, MetricType.SUMMARY);<NEW_LINE>Map<String, String> tags = metricName.getTags();<NEW_LINE>writer.writeSample(sanitizeName, addTags(tags, "quantile", "0.5"), snapshot.getMedian() * factor);<NEW_LINE>writer.writeSample(sanitizeName, addTags(tags, "quantile", "0.75"), snapshot.get75thPercentile() * factor);<NEW_LINE>writer.writeSample(sanitizeName, addTags(tags, "quantile", "0.95"), snapshot.get95thPercentile() * factor);<NEW_LINE>writer.writeSample(sanitizeName, addTags(tags, "quantile", "0.98"), snapshot.get98thPercentile() * factor);<NEW_LINE>writer.writeSample(sanitizeName, addTags(tags, "quantile", "0.99"), snapshot.get99thPercentile() * factor);<NEW_LINE>writer.writeSample(sanitizeName, addTags(tags, "quantile", "0.999"), snapshot.get999thPercentile() * factor);<NEW_LINE>writer.writeSample(sanitizeName + "_min", tags, snapshot.getMin());<NEW_LINE>writer.writeSample(sanitizeName + "_max", tags, snapshot.getMax());<NEW_LINE>writer.writeSample(sanitizeName + "_median", tags, snapshot.getMedian());<NEW_LINE>writer.writeSample(sanitizeName + "_mean", tags, snapshot.getMean());<NEW_LINE>writer.writeSample(sanitizeName + "_stddev", tags, snapshot.getStdDev());<NEW_LINE>writer.writeSample(sanitizeName + "_count", tags, count);<NEW_LINE>}
String sanitizeName = metricName.getName();
309,478
private String scanResource(Class<? extends IBaseResource> theClass, ResourceDef resourceDefinition) {<NEW_LINE>ourLog.debug("Scanning resource class: {}", theClass.getName());<NEW_LINE>boolean primaryNameProvider = true;<NEW_LINE>String resourceName = resourceDefinition.name();<NEW_LINE>if (isBlank(resourceName)) {<NEW_LINE>Class<?> parent = theClass.getSuperclass();<NEW_LINE>primaryNameProvider = false;<NEW_LINE>while (parent.equals(Object.class) == false && isBlank(resourceName)) {<NEW_LINE>ResourceDef nextDef = <MASK><NEW_LINE>if (nextDef != null) {<NEW_LINE>resourceName = nextDef.name();<NEW_LINE>}<NEW_LINE>parent = parent.getSuperclass();<NEW_LINE>}<NEW_LINE>if (isBlank(resourceName)) {<NEW_LINE>throw new ConfigurationException(Msg.code(1719) + "Resource type @" + ResourceDef.class.getSimpleName() + " annotation contains no resource name(): " + theClass.getCanonicalName() + " - This is only allowed for types that extend other resource types ");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String resourceNameLowerCase = resourceName.toLowerCase();<NEW_LINE>Class<? extends IBaseResource> builtInType = myNameToResourceType.get(resourceNameLowerCase);<NEW_LINE>boolean standardType = builtInType != null && builtInType.equals(theClass) == true;<NEW_LINE>if (primaryNameProvider) {<NEW_LINE>if (builtInType != null && builtInType.equals(theClass) == false) {<NEW_LINE>primaryNameProvider = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String resourceId = resourceDefinition.id();<NEW_LINE>if (!isBlank(resourceId)) {<NEW_LINE>if (myIdToResourceDefinition.containsKey(resourceId)) {<NEW_LINE>throw new ConfigurationException(Msg.code(1720) + "The following resource types have the same ID of '" + resourceId + "' - " + theClass.getCanonicalName() + " and " + myIdToResourceDefinition.get(resourceId).getImplementingClass().getCanonicalName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>RuntimeResourceDefinition resourceDef = new RuntimeResourceDefinition(myContext, resourceName, theClass, resourceDefinition, standardType, myClassToElementDefinitions);<NEW_LINE>myClassToElementDefinitions.put(theClass, resourceDef);<NEW_LINE>if (primaryNameProvider) {<NEW_LINE>if (resourceDef.getStructureVersion() == myVersion) {<NEW_LINE>myNameToResourceDefinitions.put(resourceNameLowerCase, resourceDef);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>myIdToResourceDefinition.put(resourceId, resourceDef);<NEW_LINE>scanResourceForSearchParams(theClass, resourceDef);<NEW_LINE>resourceDef.populateScanAlso(myScanAlso);<NEW_LINE>return resourceName;<NEW_LINE>}
pullAnnotation(parent, ResourceDef.class);
1,838,933
public void readFromNBT(@Nonnull NBTTagCompound nbtRoot) {<NEW_LINE>super.readFromNBT(nbtRoot);<NEW_LINE>for (EnumFacing dir : EnumFacing.VALUES) {<NEW_LINE>String key = "upgrades." + dir.name();<NEW_LINE>if (nbtRoot.hasKey(key)) {<NEW_LINE>NBTTagCompound upTag = (NBTTagCompound) nbtRoot.getTag(key);<NEW_LINE><MASK><NEW_LINE>upgrades.put(dir, ups);<NEW_LINE>}<NEW_LINE>key = "inFilts." + dir.name();<NEW_LINE>if (nbtRoot.hasKey(key)) {<NEW_LINE>NBTTagCompound filterTag = (NBTTagCompound) nbtRoot.getTag(key);<NEW_LINE>IFilter filter = FilterRegistry.loadFilterFromNbt(filterTag);<NEW_LINE>inputFilters.put(dir, filter);<NEW_LINE>}<NEW_LINE>key = "inputFilterUpgrades." + dir.name();<NEW_LINE>if (nbtRoot.hasKey(key)) {<NEW_LINE>NBTTagCompound upTag = (NBTTagCompound) nbtRoot.getTag(key);<NEW_LINE>ItemStack ups = new ItemStack(upTag);<NEW_LINE>inputFilterUpgrades.put(dir, ups);<NEW_LINE>}<NEW_LINE>key = "outputFilterUpgrades." + dir.name();<NEW_LINE>if (nbtRoot.hasKey(key)) {<NEW_LINE>NBTTagCompound upTag = (NBTTagCompound) nbtRoot.getTag(key);<NEW_LINE>ItemStack ups = new ItemStack(upTag);<NEW_LINE>outputFilterUpgrades.put(dir, ups);<NEW_LINE>}<NEW_LINE>key = "outFilts." + dir.name();<NEW_LINE>if (nbtRoot.hasKey(key)) {<NEW_LINE>NBTTagCompound filterTag = (NBTTagCompound) nbtRoot.getTag(key);<NEW_LINE>IFilter filter = FilterRegistry.loadFilterFromNbt(filterTag);<NEW_LINE>outputFilters.put(dir, filter);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
ItemStack ups = new ItemStack(upTag);
1,761,611
protected void saveContentletVersionInfo(ContentletVersionInfo cvInfo, boolean updateVersionTS) throws DotDataException, DotStateException {<NEW_LINE>boolean isNew = true;<NEW_LINE>if (UtilMethods.isSet(cvInfo.getIdentifier())) {<NEW_LINE>try {<NEW_LINE>final Optional<ContentletVersionInfo> fromDB = findContentletVersionInfoInDB(cvInfo.getIdentifier(), cvInfo.getLang());<NEW_LINE>if (fromDB.isPresent()) {<NEW_LINE>isNew = false;<NEW_LINE>}<NEW_LINE>} catch (final Exception e) {<NEW_LINE>Logger.debug(this.getClass(), e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>cvInfo.setIdentifier(UUIDGenerator.generateUuid());<NEW_LINE>}<NEW_LINE>if (updateVersionTS) {<NEW_LINE>cvInfo.setVersionTs(new Date());<NEW_LINE>}<NEW_LINE>final DotConnect dotConnect = new DotConnect();<NEW_LINE>if (isNew) {<NEW_LINE>dotConnect.setSQL(INSERT_CONTENTLET_VERSION_INFO_SQL);<NEW_LINE>dotConnect.addParam(cvInfo.getIdentifier());<NEW_LINE>dotConnect.addParam(cvInfo.getLang());<NEW_LINE>dotConnect.addParam(cvInfo.getWorkingInode());<NEW_LINE>dotConnect.addParam(cvInfo.getLiveInode());<NEW_LINE>dotConnect.addParam(cvInfo.isDeleted());<NEW_LINE>dotConnect.addParam(cvInfo.getLockedBy());<NEW_LINE>dotConnect.addParam(cvInfo.getLockedOn());<NEW_LINE>dotConnect.<MASK><NEW_LINE>dotConnect.loadResult();<NEW_LINE>} else {<NEW_LINE>dotConnect.setSQL(UPDATE_CONTENTLET_VERSION_INFO_SQL);<NEW_LINE>dotConnect.addParam(cvInfo.getWorkingInode());<NEW_LINE>dotConnect.addParam(cvInfo.getLiveInode());<NEW_LINE>dotConnect.addParam(cvInfo.isDeleted());<NEW_LINE>dotConnect.addParam(cvInfo.getLockedBy());<NEW_LINE>dotConnect.addParam(cvInfo.getLockedOn());<NEW_LINE>dotConnect.addParam(cvInfo.getVersionTs());<NEW_LINE>dotConnect.addParam(cvInfo.getIdentifier());<NEW_LINE>dotConnect.addParam(cvInfo.getLang());<NEW_LINE>dotConnect.loadResult();<NEW_LINE>}<NEW_LINE>this.icache.removeContentletVersionInfoToCache(cvInfo.getIdentifier(), cvInfo.getLang());<NEW_LINE>}
addParam(cvInfo.getVersionTs());
1,681,647
public void findMessages(final MethodCall methodCall, final MethodChannel.Result result) {<NEW_LINE>List<String> messageIDList = CommonUtil.getParam(methodCall, result, "messageIDList");<NEW_LINE>V2TIMManager.getMessageManager().findMessages(messageIDList, new V2TIMValueCallback<List<V2TIMMessage>>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onSuccess(List<V2TIMMessage> v2TIMMessages) {<NEW_LINE>LinkedList<HashMap<String, Object>> <MASK><NEW_LINE>for (int i = 0; i < v2TIMMessages.size(); i++) {<NEW_LINE>messageList.add(CommonUtil.convertV2TIMMessageToMap(v2TIMMessages.get(i)));<NEW_LINE>}<NEW_LINE>CommonUtil.returnSuccess(result, messageList);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onError(int code, String desc) {<NEW_LINE>CommonUtil.returnError(result, code, desc);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
messageList = new LinkedList<>();
1,681,296
private void injectToList(List listObject, Class<?> elementType, List<String> stepFieldNames, int step, Object value) throws Exception {<NEW_LINE>String fieldName = stepFieldNames.get(step);<NEW_LINE>if (step + 1 >= stepFieldNames.size() && fieldName.matches("\\[\\d+]")) {<NEW_LINE>int index = Integer.parseInt(fieldName.substring(1, fieldName.length() - 1));<NEW_LINE>// expand list<NEW_LINE>int expand = index + 1 - listObject.size();<NEW_LINE>while (expand-- > 0) {<NEW_LINE>listObject.add(null);<NEW_LINE>}<NEW_LINE>if (elementType.equals(String.class) || PrimitiveUtils.isPrimitive(elementType)) {<NEW_LINE>listObject.set(index, PrimitiveUtils.primitiveTypeConverse(value, elementType));<NEW_LINE>} else if (elementType.equals(Object.class)) {<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>throw new IllegalAccessException("Cannot set value: " + value + " to array: " + stepFieldNames.get(step - 1));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
listObject.set(index, value);
615,342
public void testSFLocalEnvEntry_Float_InvalidValue() throws Exception {<NEW_LINE>SFLa ejb1 = fhome1.create();<NEW_LINE>try {<NEW_LINE>// The test case looks for a environment variable named "envFloatInvalid".<NEW_LINE>Float tempFloat = ejb1.getFloatEnvVar("envFloatBlankValue");<NEW_LINE>fail("Get environment invalid float object should have failed, instead we got: " + tempFloat);<NEW_LINE>} catch (NamingException ne) {<NEW_LINE>svLogger.info("Caught expected " + ne.getClass().getName());<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>// The test case looks for a environment variable named "envFloatInvalid".<NEW_LINE>Float tempFloat = ejb1.getFloatEnvVar("envFloatInvalid");<NEW_LINE>fail("Get environment invalid float object should have failed, instead we got: " + tempFloat);<NEW_LINE>} catch (NamingException ne) {<NEW_LINE>svLogger.info("Caught expected " + ne.<MASK><NEW_LINE>}<NEW_LINE>// The test case looks for a environment variable named "envFloatInvalid".<NEW_LINE>Float tempFloat = ejb1.getFloatEnvVar("envFloatGT32bit");<NEW_LINE>assertTrue("Get environment invalid float object should have been infinity (Float.isInfinite)", Float.isInfinite(tempFloat.floatValue()));<NEW_LINE>ejb1.remove();<NEW_LINE>}
getClass().getName());
1,707,719
private <T> T attr(AttributeKey<T> key, boolean ownAttr) {<NEW_LINE>requireNonNull(key, "key");<NEW_LINE>final AtomicReferenceArray<DefaultAttribute<?>> attributes = this.attributes;<NEW_LINE>if (attributes == null) {<NEW_LINE>if (!ownAttr && rootAttributeMap != null) {<NEW_LINE>return rootAttributeMap.attr(key);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>final int i = index(key);<NEW_LINE>final DefaultAttribute<?> head = attributes.get(i);<NEW_LINE>if (head == null) {<NEW_LINE>if (!ownAttr && rootAttributeMap != null) {<NEW_LINE>return rootAttributeMap.attr(key);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>synchronized (head) {<NEW_LINE>DefaultAttribute<?> curr = head;<NEW_LINE>for (; ; ) {<NEW_LINE>final DefaultAttribute<MASK><NEW_LINE>if (next == null) {<NEW_LINE>if (!ownAttr && rootAttributeMap != null) {<NEW_LINE>return rootAttributeMap.attr(key);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (next.key == key) {<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>final T result = (T) next.getValue();<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>curr = next;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
<?> next = curr.next;
1,539,391
public boolean validateCheckSum(Map<HdfsFile, byte[]> fileCheckSumMap) {<NEW_LINE>if (checkSumType == CheckSumType.NONE) {<NEW_LINE>logger.info("No check-sum verification required");<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>CheckSum <MASK><NEW_LINE>for (HdfsFile file : allFiles) {<NEW_LINE>byte[] fileCheckSum = fileCheckSumMap.get(file);<NEW_LINE>if (fileCheckSum != null) {<NEW_LINE>checkSumGenerator.update(fileCheckSum);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>byte[] computedCheckSum = checkSumGenerator.getCheckSum();<NEW_LINE>boolean checkSumComparison = (ByteUtils.compare(expectedCheckSum, computedCheckSum) == 0);<NEW_LINE>logger.info("Checksum generated from streaming - " + new String(Hex.encodeHex(computedCheckSum)));<NEW_LINE>logger.info("Checksum on file - " + new String(Hex.encodeHex(expectedCheckSum)));<NEW_LINE>logger.info("Check-sum verification - " + checkSumComparison);<NEW_LINE>return checkSumComparison;<NEW_LINE>}
checkSumGenerator = CheckSum.getInstance(checkSumType);
249,400
public EpsilonApproQuantile.SketchEntry[] createWQSummary(int maxSize, double eps, EpsilonApproQuantile.SketchEntry[] buffer, double[] dynamicWeights, BitSet validFlags) {<NEW_LINE>for (int i = 0, index = 0; i < n; ++i) {<NEW_LINE>final FeatureMeta featureMeta = featureMetas[i];<NEW_LINE>if (featureMeta.getType().equals(FeatureMeta.FeatureType.CONTINUOUS)) {<NEW_LINE>buffer[index].sumTotal = 0.0;<NEW_LINE>int featureOffSet = i * m;<NEW_LINE>for (int j = 0; j < m; ++j) {<NEW_LINE>IndexedValue v = sortedValues[featureOffSet + j];<NEW_LINE>if (validFlags.get(v.index) && !Preprocessing.isMissing(v.val, featureMeta, zeroAsMissing)) {<NEW_LINE>buffer[index].sumTotal += dynamicWeights[v.index];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>index++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int i = 0, index = 0; i < n; ++i) {<NEW_LINE><MASK><NEW_LINE>if (featureMeta.getType().equals(FeatureMeta.FeatureType.CONTINUOUS)) {<NEW_LINE>int start = 0;<NEW_LINE>int end = m;<NEW_LINE>EpsilonApproQuantile.SketchEntry entry = buffer[index];<NEW_LINE>if (start == end || entry.sumTotal == 0.0) {<NEW_LINE>// empty or all elements are null.<NEW_LINE>index++;<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>entry.init(maxSize);<NEW_LINE>int featureOffSet = i * m;<NEW_LINE>for (int j = start; j < end; ++j) {<NEW_LINE>IndexedValue v = sortedValues[featureOffSet + j];<NEW_LINE>if (validFlags.get(v.index) && !Preprocessing.isMissing(v.val, featureMeta, zeroAsMissing)) {<NEW_LINE>entry.push(v.val, dynamicWeights[v.index], maxSize);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>entry.finalize(maxSize);<NEW_LINE>index++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return buffer;<NEW_LINE>}
final FeatureMeta featureMeta = featureMetas[i];
784,914
void sealAndInitialize(FhirContext theContext, Map<Class<? extends IBase>, BaseRuntimeElementDefinition<?>> theClassToElementDefinitions) {<NEW_LINE>Map<String, BaseRuntimeElementDefinition<?>> datatypeAttributeNameToDefinition = new HashMap<>();<NEW_LINE>myDatatypeToAttributeName = new HashMap<>();<NEW_LINE>myDatatypeToDefinition = new HashMap<>();<NEW_LINE>for (BaseRuntimeElementDefinition<?> next : theClassToElementDefinitions.values()) {<NEW_LINE>if (next instanceof IRuntimeDatatypeDefinition) {<NEW_LINE>myDatatypeToDefinition.put(next.getImplementingClass(), next);<NEW_LINE>boolean isSpecialization = ((IRuntimeDatatypeDefinition) next).isSpecialization();<NEW_LINE>if (isSpecialization) {<NEW_LINE>ourLog.trace("Not adding specialization: {}", next.getImplementingClass());<NEW_LINE>}<NEW_LINE>if (!next.isStandardType()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>String qualifiedName = next.getImplementingClass().getName();<NEW_LINE>if (!qualifiedName.startsWith("ca.uhn.fhir.model")) {<NEW_LINE>if (!qualifiedName.startsWith("org.hl7.fhir")) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String attrName = createExtensionChildName(next);<NEW_LINE>if (isSpecialization && datatypeAttributeNameToDefinition.containsKey(attrName)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (datatypeAttributeNameToDefinition.containsKey(attrName)) {<NEW_LINE>BaseRuntimeElementDefinition<?> existing = datatypeAttributeNameToDefinition.get(attrName);<NEW_LINE>// We do allow built-in standard types to override extension types with the same element name,<NEW_LINE>// e.g. how EnumerationType extends CodeType but both serialize to "code". In this case,<NEW_LINE>// CodeType should win. If we aren't in a situation like that, there is a problem with the<NEW_LINE>// model so we should bail.<NEW_LINE>if (!existing.isStandardType()) {<NEW_LINE>throw new ConfigurationException(Msg.code(1734) + "More than one child of " + getElementName() + " matches attribute name " + attrName + ". Found [" + existing.getImplementingClass().getName() + "] and [" + next.getImplementingClass(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>datatypeAttributeNameToDefinition.put(attrName, next);<NEW_LINE>datatypeAttributeNameToDefinition.put(attrName.toLowerCase(), next);<NEW_LINE>myDatatypeToAttributeName.put(next.getImplementingClass(), attrName);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>myAttributeNameToDefinition = datatypeAttributeNameToDefinition;<NEW_LINE>addReferenceBinding(theContext, theClassToElementDefinitions, VALUE_RESOURCE);<NEW_LINE>addReferenceBinding(theContext, theClassToElementDefinitions, VALUE_REFERENCE);<NEW_LINE>}
).getName() + "]");
1,154,822
public static <T, K, V, M extends Multimap<K, V>> Collector<T, ?, M> flatteningToMultimap(java.util.function.Function<? super T, ? extends K> keyFunction, java.util.function.Function<? super T, ? extends Stream<? extends V>> valueFunction, java.util.function.Supplier<M> multimapSupplier) {<NEW_LINE>checkNotNull(keyFunction);<NEW_LINE>checkNotNull(valueFunction);<NEW_LINE>checkNotNull(multimapSupplier);<NEW_LINE>return Collector.of(multimapSupplier, (multimap, input) -> {<NEW_LINE>K <MASK><NEW_LINE>Collection<V> valuesForKey = multimap.get(key);<NEW_LINE>valueFunction.apply(input).forEachOrdered(valuesForKey::add);<NEW_LINE>}, (multimap1, multimap2) -> {<NEW_LINE>multimap1.putAll(multimap2);<NEW_LINE>return multimap1;<NEW_LINE>});<NEW_LINE>}
key = keyFunction.apply(input);
941,276
public boolean parseText(String src, List<CompilationUnitTree> trees, Consumer<SourcePositions> sourcePositions, Consumer<DocTrees> docTrees, DiagnosticCollector<JavaFileObject> errorHandler) {<NEW_LINE>init();<NEW_LINE>ArrayList<JavaFileObject> javaStringObjects = new ArrayList<>();<NEW_LINE>javaStringObjects.add(new StringJavaFileObject("sample", src));<NEW_LINE>StringWriter errors = new StringWriter();<NEW_LINE>BasicJavacTask javacTask = (BasicJavacTask) _javac.getTask(errors, _mfm, errorHandler, Collections.singletonList("-proc:none"), null, javaStringObjects);<NEW_LINE>try {<NEW_LINE>initTypeProcessing(javacTask, Collections.singleton("sample"));<NEW_LINE>Iterable<? extends CompilationUnitTree> iterable = javacTask.parse();<NEW_LINE>if (errors.getBuffer().length() > 0) {<NEW_LINE>System.err.println(errors.getBuffer());<NEW_LINE>}<NEW_LINE>for (CompilationUnitTree x : iterable) {<NEW_LINE>trees.add(x);<NEW_LINE>}<NEW_LINE>if (sourcePositions != null) {<NEW_LINE>sourcePositions.accept(Trees.instance<MASK><NEW_LINE>}<NEW_LINE>if (docTrees != null) {<NEW_LINE>docTrees.accept(DocTrees.instance(javacTask));<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} catch (Exception e) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}
(javacTask).getSourcePositions());
103,373
private StringBuffer printNode(MTreeNode node, Properties ctx) {<NEW_LINE>StringBuffer sb = new StringBuffer();<NEW_LINE>// Leaf<NEW_LINE>if (!node.isSummary()) {<NEW_LINE>String cssClassName = "";<NEW_LINE>String servletName = "";<NEW_LINE>if (node.isWindow()) {<NEW_LINE>cssClassName = "menuWindow";<NEW_LINE>servletName = "WWindow";<NEW_LINE>} else if (node.isForm()) {<NEW_LINE>return sb;<NEW_LINE>} else if (node.isReport()) {<NEW_LINE>cssClassName = "menuReport";<NEW_LINE>servletName = "WProcess";<NEW_LINE>} else if (node.isProcess()) {<NEW_LINE>cssClassName = "menuProcess";<NEW_LINE>servletName = "WProcess";<NEW_LINE>} else if (node.isWorkFlow()) {<NEW_LINE>return sb;<NEW_LINE>} else if (node.isTask()) {<NEW_LINE>return sb;<NEW_LINE>} else<NEW_LINE>servletName = "WError";<NEW_LINE>// TODO getTranslation<NEW_LINE>String name = Msg.getMsg(ctx, node.getName().replace('\'', ' ').replace('"', ' '));<NEW_LINE>String description = Msg.getMsg(ctx, node.getDescription().replace('\'', ' ').replace('"', ' '));<NEW_LINE>//<NEW_LINE>sb.append(// debug<NEW_LINE>"<li class=\"" + cssClassName + "\" id=\"" + node.getNode_ID() + "\"><a href=\"");<NEW_LINE>// Get URL<NEW_LINE>boolean standardURL = true;<NEW_LINE>if (// url = /appl/servletName?AD_Menu_ID=x<NEW_LINE>standardURL) {<NEW_LINE>sb.append(MobileEnv.getBaseDirectory(servletName)).append("?AD_Menu_ID=").<MASK><NEW_LINE>}<NEW_LINE>// remaining a tag<NEW_LINE>// language set in MTree.getNodeDetails based on ctx<NEW_LINE>sb.append("\" class=\"whiteButton\" target=\"_self\" title=\"" + description + "\">").// language set in MTree.getNodeDetails based on ctx<NEW_LINE>append(name).append("</a></li>\n");<NEW_LINE>} else {<NEW_LINE>String name = node.getName().replace('\'', ' ').replace('"', ' ');<NEW_LINE>sb.append("\n<li><a href=\"#" + node.getNode_ID() + "\">").append(name).append("</a></li>\n");<NEW_LINE>}<NEW_LINE>return sb;<NEW_LINE>}
append(node.getNode_ID());
169,968
protected void customizeCellRenderer(@Nonnull JList<? extends FileInfo> list, FileInfo value, int index, boolean selected, boolean hasFocus) {<NEW_LINE>Project project = mySwitcherPanel.project;<NEW_LINE><MASK><NEW_LINE>String renderedName = value.getNameForRendering();<NEW_LINE>setIcon(VfsIconUtil.getIcon(virtualFile, Iconable.ICON_FLAG_READ_STATUS, project));<NEW_LINE>FileStatus fileStatus = FileStatusManager.getInstance(project).getStatus(virtualFile);<NEW_LINE>open = FileEditorManager.getInstance(project).isFileOpen(virtualFile);<NEW_LINE>boolean hasProblem = WolfTheProblemSolver.getInstance(project).isProblemFile(virtualFile);<NEW_LINE>TextAttributes attributes = new TextAttributes(fileStatus.getColor(), null, hasProblem ? StandardColors.RED : null, EffectType.WAVE_UNDERSCORE, Font.PLAIN);<NEW_LINE>append(renderedName, SimpleTextAttributes.fromTextAttributes(attributes));<NEW_LINE>// calc color the same way editor tabs do this, i.e. including EPs<NEW_LINE>Color color = EditorTabPresentationUtil.getFileBackgroundColor(project, virtualFile);<NEW_LINE>if (!selected && color != null) {<NEW_LINE>setBackground(color);<NEW_LINE>}<NEW_LINE>SpeedSearchUtil.applySpeedSearchHighlighting(mySwitcherPanel, this, false, selected);<NEW_LINE>IdeDocumentHistoryImpl.appendTimestamp(project, this, virtualFile);<NEW_LINE>}
VirtualFile virtualFile = value.getFirst();
988,085
private void validateCommandPlacement(String placement) {<NEW_LINE>if (placement == COMMAND_PLACEMENT_VALUE_TOP) {<NEW_LINE>((BorderLayout) getTitleAreaContainer().getLayout()).setCenterBehavior(BorderLayout.CENTER_BEHAVIOR_SCALE);<NEW_LINE>if (!(getTitleComponent() instanceof Button)) {<NEW_LINE>Button b = new Button(parent.getTitle());<NEW_LINE>b.setUIID("Title");<NEW_LINE>parent.setTitleComponent(b);<NEW_LINE>b.addActionListener(new ActionListener() {<NEW_LINE><NEW_LINE>public void actionPerformed(ActionEvent evt) {<NEW_LINE>openMenu(COMMAND_PLACEMENT_VALUE_TOP);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (placement == COMMAND_PLACEMENT_VALUE_RIGHT) {<NEW_LINE>if (rightSideButton != null && rightSideButton.getParent() != null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>rightSideButton = new Button();<NEW_LINE>rightSideButton.setUIID("MenuButtonRight");<NEW_LINE><MASK><NEW_LINE>Image i = (Image) uim.getThemeImageConstant("rightSideMenuImage");<NEW_LINE>if (i != null) {<NEW_LINE>rightSideButton.setIcon(i);<NEW_LINE>} else {<NEW_LINE>FontImage.setMaterialIcon(rightSideButton, FontImage.MATERIAL_MENU);<NEW_LINE>}<NEW_LINE>Image p = (Image) uim.getThemeImageConstant("rightSideMenuPressImage");<NEW_LINE>if (p != null) {<NEW_LINE>rightSideButton.setPressedIcon(p);<NEW_LINE>}<NEW_LINE>rightSideButton.addActionListener(new ActionListener() {<NEW_LINE><NEW_LINE>public void actionPerformed(ActionEvent evt) {<NEW_LINE>openMenu(COMMAND_PLACEMENT_VALUE_RIGHT);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>Container ta = getTitleAreaContainer();<NEW_LINE>ta.addComponent(BorderLayout.EAST, rightSideButton);<NEW_LINE>ta.revalidate();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}
UIManager uim = parent.getUIManager();
96,590
public InteractionResultHolder<ItemStack> use(Level worldIn, Player playerIn, @NotNull InteractionHand handIn) {<NEW_LINE>ItemStack itemstack = playerIn.getItemInHand(handIn);<NEW_LINE>if (!worldIn.isClientSide) {<NEW_LINE>ThrownEnderpearl enderpearlentity = new ThrownEnderpearl(worldIn, playerIn);<NEW_LINE>enderpearlentity.setItem(itemstack);<NEW_LINE>enderpearlentity.shootFromRotation(playerIn, playerIn.getXRot(), playerIn.getYRot(), 0.0F, 1.5F, 1.0F);<NEW_LINE>if (!worldIn.addFreshEntity(enderpearlentity)) {<NEW_LINE>if (playerIn instanceof ServerPlayerEntityBridge) {<NEW_LINE>((ServerPlayerEntityBridge) playerIn).bridge$getBukkitEntity().updateInventory();<NEW_LINE>}<NEW_LINE>return new InteractionResultHolder<>(InteractionResult.FAIL, itemstack);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>worldIn.playSound(null, playerIn.getX(), playerIn.getY(), playerIn.getZ(), SoundEvents.ENDER_PEARL_THROW, SoundSource.NEUTRAL, 0.5F, 0.4F / (worldIn.getRandom().nextFloat() * 0.4F + 0.8F));<NEW_LINE>playerIn.getCooldowns(<MASK><NEW_LINE>playerIn.awardStat(Stats.ITEM_USED.get(this));<NEW_LINE>if (!playerIn.getAbilities().instabuild) {<NEW_LINE>itemstack.shrink(1);<NEW_LINE>}<NEW_LINE>return InteractionResultHolder.sidedSuccess(itemstack, worldIn.isClientSide());<NEW_LINE>}
).addCooldown(this, 20);
463,104
public InstanceIdentity postInstanceRegisterInformation(InstanceRegisterInformation info, java.util.Map<String, java.util.List<String>> headers) {<NEW_LINE>WebTarget target = base.path("/instance");<NEW_LINE>Invocation.Builder invocationBuilder = target.request("application/json");<NEW_LINE>if (credsHeader != null) {<NEW_LINE>invocationBuilder = credsHeader.startsWith("Cookie.") ? invocationBuilder.cookie(credsHeader.substring(7), credsToken) : <MASK><NEW_LINE>}<NEW_LINE>Response response = invocationBuilder.post(javax.ws.rs.client.Entity.entity(info, "application/json"));<NEW_LINE>int code = response.getStatus();<NEW_LINE>switch(code) {<NEW_LINE>case 201:<NEW_LINE>if (headers != null) {<NEW_LINE>headers.put("location", java.util.Arrays.asList((String) response.getHeaders().getFirst("Location")));<NEW_LINE>}<NEW_LINE>return response.readEntity(InstanceIdentity.class);<NEW_LINE>default:<NEW_LINE>throw new ResourceException(code, response.readEntity(ResourceError.class));<NEW_LINE>}<NEW_LINE>}
invocationBuilder.header(credsHeader, credsToken);
587,123
public static void main(String[] args) {<NEW_LINE>final CliBuilder<Runnable> builder = Cli.builder("druid");<NEW_LINE>builder.withDescription("Druid command-line runner.").withDefaultCommand(Help.class).withCommands(Help.class, Version.class);<NEW_LINE>List<Class<? extends Runnable>> serverCommands = Arrays.asList(CliCoordinator.class, CliHistorical.class, CliBroker.class, CliOverlord.class, CliIndexer.class, CliMiddleManager.class, CliRouter.class);<NEW_LINE>builder.withGroup("server").withDescription("Run one of the Druid server types.").withDefaultCommand(Help.class).withCommands(serverCommands);<NEW_LINE>List<Class<? extends Runnable>> toolCommands = Arrays.asList(DruidJsonValidator.class, PullDependencies.class, CreateTables.class, DumpSegment.class, ResetCluster.class, ValidateSegments.class, ExportMetadata.class);<NEW_LINE>builder.withGroup("tools").withDescription("Various tools for working with Druid").withDefaultCommand(Help.class).withCommands(toolCommands);<NEW_LINE>builder.withGroup("index").withDescription("Run indexing for druid").withDefaultCommand(Help.class).withCommands(CliHadoopIndexer.class);<NEW_LINE>builder.withGroup("internal").withDescription("Processes that Druid runs \"internally\", you should rarely use these directly").withDefaultCommand(Help.class).withCommands(CliPeon.class, CliInternalHadoopIndexer.class);<NEW_LINE>final Injector injector = GuiceInjectors.makeStartupInjector();<NEW_LINE>final ExtensionsConfig config = <MASK><NEW_LINE>final Collection<CliCommandCreator> extensionCommands = Initialization.getFromExtensions(config, CliCommandCreator.class);<NEW_LINE>for (CliCommandCreator creator : extensionCommands) {<NEW_LINE>creator.addCommands(builder);<NEW_LINE>}<NEW_LINE>final Cli<Runnable> cli = builder.build();<NEW_LINE>try {<NEW_LINE>final Runnable command = cli.parse(args);<NEW_LINE>if (!(command instanceof Help)) {<NEW_LINE>// Hack to work around Help not liking being injected<NEW_LINE>injector.injectMembers(command);<NEW_LINE>}<NEW_LINE>command.run();<NEW_LINE>} catch (ParseException e) {<NEW_LINE>System.out.println("ERROR!!!!");<NEW_LINE>System.out.println(e.getMessage());<NEW_LINE>System.out.println("===");<NEW_LINE>cli.parse(new String[] { "help" }).run();<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>}
injector.getInstance(ExtensionsConfig.class);
293,736
public int fill(FluidStack resource, FluidAction doFill) {<NEW_LINE>if (resource == null)<NEW_LINE>return 0;<NEW_LINE>int canAccept = resource.getAmount();<NEW_LINE>if (canAccept <= 0)<NEW_LINE>return 0;<NEW_LINE>Set<DirectionalFluidOutput> outputList = getConnectedFluidHandlers(pipe.getBlockPos(), pipe.level);<NEW_LINE>if (outputList.size() < 1)<NEW_LINE>// NO OUTPUTS!<NEW_LINE>return 0;<NEW_LINE>BlockPos ccFrom = new BlockPos(pipe.getBlockPos().relative(facing));<NEW_LINE>int sum = 0;<NEW_LINE>HashMap<DirectionalFluidOutput, Integer> sorting = new HashMap<>();<NEW_LINE>for (DirectionalFluidOutput output : outputList) {<NEW_LINE>BlockPos cc = output.containingTile.getBlockPos();<NEW_LINE>if (!cc.equals(ccFrom) && pipe.level.hasChunkAt(cc) && !pipe.equals(output.containingTile)) {<NEW_LINE>int limit = getTransferableAmount(resource, output.containingTile);<NEW_LINE>int tileSpecificAcceptedFluid = Math.min(limit, canAccept);<NEW_LINE>int temp = output.output.fill(Utils.copyFluidStackWithAmount(resource, tileSpecificAcceptedFluid, output.stripPressure()), FluidAction.SIMULATE);<NEW_LINE>if (temp > 0) {<NEW_LINE>sorting.put(output, temp);<NEW_LINE>sum += temp;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (sum > 0) {<NEW_LINE>int f = 0;<NEW_LINE>for (DirectionalFluidOutput output : sorting.keySet()) {<NEW_LINE>int amount = sorting.get(output);<NEW_LINE>if (sum > resource.getAmount()) {<NEW_LINE>int limit = getTransferableAmount(resource, output.containingTile);<NEW_LINE>int tileSpecificAcceptedFluid = <MASK><NEW_LINE>float prio = amount / (float) sum;<NEW_LINE>amount = (int) Math.ceil(Mth.clamp(amount, 1, Math.min(resource.getAmount() * prio, tileSpecificAcceptedFluid)));<NEW_LINE>amount = Math.min(amount, canAccept);<NEW_LINE>}<NEW_LINE>int r = output.output.fill(Utils.copyFluidStackWithAmount(resource, amount, output.stripPressure()), doFill);<NEW_LINE>if (r > IFluidPipe.AMOUNT_UNPRESSURIZED)<NEW_LINE>pipe.canOutputPressurized(output.containingTile, true);<NEW_LINE>f += r;<NEW_LINE>canAccept -= r;<NEW_LINE>if (canAccept <= 0)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>return f;<NEW_LINE>}<NEW_LINE>return 0;<NEW_LINE>}
Math.min(limit, canAccept);
879,053
public String doSaveAs(String filePath, String extension) throws IOException {<NEW_LINE>boolean ownXmlFormat = extension.equals(Program.getInstance().getExtension());<NEW_LINE>JFileChooser fileChooser = createSaveFileChooser(!ownXmlFormat, filePath);<NEW_LINE>String chosenFileName = chooseFileName(ownXmlFormat, filters.get(extension), fileChooser);<NEW_LINE>String chosenExtension = fileextensions.<MASK><NEW_LINE>if (chosenFileName == null) {<NEW_LINE>// If the filechooser has been closed without saving<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (!chosenFileName.endsWith("." + chosenExtension)) {<NEW_LINE>chosenFileName += "." + chosenExtension;<NEW_LINE>}<NEW_LINE>File fileToSave = new File(chosenFileName);<NEW_LINE>Config.getInstance().setSaveFileHome(fileToSave.getParent());<NEW_LINE>if (chosenExtension.equals(Program.getInstance().getExtension())) {<NEW_LINE>file = fileToSave;<NEW_LINE>setFileName(file.getName());<NEW_LINE>save();<NEW_LINE>} else {<NEW_LINE>lastExportFile = fileToSave;<NEW_LINE>doExportAs(extension, fileToSave);<NEW_LINE>}<NEW_LINE>return fileToSave.getAbsolutePath();<NEW_LINE>}
get(fileChooser.getFileFilter());
1,523,867
public void paint(GGlassPane glassPane, Graphics g) {<NEW_LINE>Rectangle defaultBounds = component.getBounds();<NEW_LINE>int width = (int) (defaultBounds.width * emphasis);<NEW_LINE>int height = (int) (defaultBounds.height * emphasis);<NEW_LINE>Rectangle emphasizedBounds = new Rectangle(defaultBounds.x, defaultBounds.y, width, height);<NEW_LINE>emphasizedBounds = SwingUtilities.convertRectangle(component.getParent(), emphasizedBounds, glassPane);<NEW_LINE>Graphics2D g2d = (Graphics2D) g;<NEW_LINE>int offsetX = emphasizedBounds.x - ((width - defaultBounds.width) >> 1);<NEW_LINE>int offsetY = emphasizedBounds.y - ((height - <MASK><NEW_LINE>g2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);<NEW_LINE>//<NEW_LINE>// Shake code<NEW_LINE>//<NEW_LINE>if (lastDirection > 0) {<NEW_LINE>lastDirection = -.01;<NEW_LINE>lastDirection = -.01 * emphasis;<NEW_LINE>} else {<NEW_LINE>lastDirection = .01;<NEW_LINE>lastDirection = .01 * emphasis;<NEW_LINE>}<NEW_LINE>g2d.rotate(lastDirection, emphasizedBounds.getCenterX(), emphasizedBounds.getCenterY());<NEW_LINE>g.drawImage(image, offsetX, offsetY, width, height, null);<NEW_LINE>}
defaultBounds.height) >> 1);
1,806,120
private JComponent createTopCombo(JFileChooser fc) {<NEW_LINE>JPanel panel = new JPanel();<NEW_LINE>if (fc.getAccessory() != null) {<NEW_LINE>panel.setBorder(BorderFactory.createEmptyBorder(4, 0, 8, 0));<NEW_LINE>} else {<NEW_LINE>panel.setBorder(BorderFactory.createEmptyBorder(6, 0, 10, 0));<NEW_LINE>}<NEW_LINE>panel.setLayout(new BorderLayout());<NEW_LINE>Box labelBox = Box.createHorizontalBox();<NEW_LINE>lookInComboBoxLabel = new JLabel(lookInLabelText);<NEW_LINE>lookInComboBoxLabel.setDisplayedMnemonic(lookInLabelMnemonic);<NEW_LINE><MASK><NEW_LINE>lookInComboBoxLabel.setAlignmentY(JComponent.CENTER_ALIGNMENT);<NEW_LINE>labelBox.add(lookInComboBoxLabel);<NEW_LINE>labelBox.add(Box.createRigidArea(new Dimension(9, 0)));<NEW_LINE>// fixed #97525, made the height of the<NEW_LINE>// combo box bigger.<NEW_LINE>directoryComboBox = new JComboBox() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Dimension getMinimumSize() {<NEW_LINE>Dimension d = super.getMinimumSize();<NEW_LINE>d.width = 60;<NEW_LINE>return d;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Dimension getPreferredSize() {<NEW_LINE>Dimension d = super.getPreferredSize();<NEW_LINE>// Must be small enough to not affect total width and height.<NEW_LINE>d.height = 24;<NEW_LINE>d.width = 150;<NEW_LINE>return d;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>directoryComboBox.putClientProperty("JComboBox.lightweightKeyboardNavigation", "Lightweight");<NEW_LINE>lookInComboBoxLabel.setLabelFor(directoryComboBox);<NEW_LINE>directoryComboBoxModel = createDirectoryComboBoxModel(fc);<NEW_LINE>directoryComboBox.setModel(directoryComboBoxModel);<NEW_LINE>directoryComboBox.addActionListener(directoryComboBoxAction);<NEW_LINE>directoryComboBox.setRenderer(createDirectoryComboBoxRenderer(fc));<NEW_LINE>directoryComboBox.setAlignmentX(JComponent.LEFT_ALIGNMENT);<NEW_LINE>directoryComboBox.setAlignmentY(JComponent.CENTER_ALIGNMENT);<NEW_LINE>directoryComboBox.setMaximumRowCount(8);<NEW_LINE>panel.add(labelBox, BorderLayout.WEST);<NEW_LINE>panel.add(directoryComboBox, BorderLayout.CENTER);<NEW_LINE>return panel;<NEW_LINE>}
lookInComboBoxLabel.setAlignmentX(JComponent.LEFT_ALIGNMENT);
432,480
public void addDownload(final HttpMetadata metadata, final String file) {<NEW_LINE>if (refreshCallback != null) {<NEW_LINE>if (refreshCallback.isValidLink(metadata)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// HttpMetadata md = HttpMetadata.load(refreshCallback.getId());<NEW_LINE>// if (md.getType() == metadata.getType()) {<NEW_LINE>// if (md instanceof DashMetadata) {<NEW_LINE>// DashMetadata dm1 = (DashMetadata) md;<NEW_LINE>// DashMetadata dm2 = (DashMetadata) metadata;<NEW_LINE>// if (dm1.getLen1() == dm2.getLen1() && dm1.getLen2() ==<NEW_LINE>// dm2.getLen2()) {<NEW_LINE>// if(refreshCallback.isValidLink(metadata))<NEW_LINE>// dm1.setUrl(dm2.getUrl());<NEW_LINE>// dm1.setUrl2(dm2.getUrl2());<NEW_LINE>// dm1.setHeaders(dm2.getHeaders());<NEW_LINE>// dm1.setLen1(dm2.getLen1());<NEW_LINE>// dm1.setLen2(dm2.getLen2());<NEW_LINE>// dm1.save();<NEW_LINE>// }<NEW_LINE>// } else if (md instanceof HlsMetadata) {<NEW_LINE>// HlsMetadata hm1 = (HlsMetadata) md;<NEW_LINE>// HlsMetadata hm2 = (HlsMetadata) metadata;<NEW_LINE>// hm1<NEW_LINE>// }<NEW_LINE>// }<NEW_LINE>}<NEW_LINE>SwingUtilities.invokeLater(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>String fileName;<NEW_LINE>String folderPath;<NEW_LINE>if (StringUtils.isNullOrEmptyOrBlank(file)) {<NEW_LINE>if (metadata != null) {<NEW_LINE>fileName = XDMUtils.getFileName(metadata.getUrl());<NEW_LINE>} else {<NEW_LINE>fileName = null;<NEW_LINE>}<NEW_LINE>folderPath = null;<NEW_LINE>} else {<NEW_LINE>var path = Paths.get(file);<NEW_LINE>fileName = path<MASK><NEW_LINE>var parentPath = path.getParent();<NEW_LINE>if (parentPath != null && parentPath.isAbsolute()) {<NEW_LINE>folderPath = parentPath.toString();<NEW_LINE>} else {<NEW_LINE>String downloadFolderPath;<NEW_LINE>if (Config.getInstance().isForceSingleFolder()) {<NEW_LINE>downloadFolderPath = Config.getInstance().getDownloadFolder();<NEW_LINE>} else {<NEW_LINE>var category = XDMUtils.findCategory(file);<NEW_LINE>downloadFolderPath = XDMApp.getInstance().getFolder(category);<NEW_LINE>}<NEW_LINE>if (parentPath != null) {<NEW_LINE>folderPath = Paths.get(downloadFolderPath, parentPath.toString()).toString();<NEW_LINE>} else {<NEW_LINE>folderPath = downloadFolderPath;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (metadata != null && (Config.getInstance().isQuietMode() || Config.getInstance().isDownloadAutoStart())) {<NEW_LINE>createDownload(fileName, folderPath, metadata, true, "", 0, 0);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>new NewDownloadWindow(metadata, fileName, folderPath).setVisible(true);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
.getFileName().toString();
1,422,248
private void updateIPBlocked() {<NEW_LINE>if (!CoreFactory.isCoreRunning()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Core core = CoreFactory.getSingleton();<NEW_LINE>// IP Filter Status Section<NEW_LINE>IpFilter ip_filter = core.getIpFilterManager().getIPFilter();<NEW_LINE>ipBlocked.setForeground(display.getSystemColor(ip_filter.isEnabled() ? SWT.COLOR_WIDGET_FOREGROUND : SWT.COLOR_WIDGET_NORMAL_SHADOW));<NEW_LINE>ipBlocked.setText("IPs: " + numberFormat.format(ip_filter.getNbRanges()) + " - " + numberFormat.format(ip_filter.getNbIpsBlockedAndLoggable()) + "/" + numberFormat.format(ip_filter.getNbBannedIps()) + "/" + numberFormat.format(core.getIpFilterManager().getBadIps<MASK><NEW_LINE>Utils.setTT(ipBlocked, MessageText.getString("MainWindow.IPs.tooltip", new String[] { ip_filter.isEnabled() ? DisplayFormatters.formatDateShort(ip_filter.getLastUpdateTime()) : MessageText.getString("ipfilter.disabled") }));<NEW_LINE>}
().getNbBadIps()));
218,537
public static Writable reduceStringOrCategoricalColumn(StringReduceOp op, List<Writable> values) {<NEW_LINE>switch(op) {<NEW_LINE>case MERGE:<NEW_LINE>case APPEND:<NEW_LINE>StringBuilder stringBuilder = new StringBuilder();<NEW_LINE>for (Writable w : values) {<NEW_LINE>stringBuilder.append(w.toString());<NEW_LINE>}<NEW_LINE>return new <MASK><NEW_LINE>case REPLACE:<NEW_LINE>if (values.size() > 2) {<NEW_LINE>throw new IllegalArgumentException("Unable to run replace on columns > 2");<NEW_LINE>}<NEW_LINE>return new Text(values.get(1).toString());<NEW_LINE>case PREPEND:<NEW_LINE>List<Writable> reverse = new ArrayList<>(values);<NEW_LINE>Collections.reverse(reverse);<NEW_LINE>StringBuilder stringBuilder2 = new StringBuilder();<NEW_LINE>for (Writable w : reverse) {<NEW_LINE>stringBuilder2.append(w.toString());<NEW_LINE>}<NEW_LINE>return new Text(stringBuilder2.toString());<NEW_LINE>default:<NEW_LINE>throw new UnsupportedOperationException("Cannot execute op \"" + op + "\" on String/Categorical column " + "(can only perform Count, CountUnique, TakeFirst and TakeLast ops on categorical columns)");<NEW_LINE>}<NEW_LINE>}
Text(stringBuilder.toString());
653,077
private CodegenMethod evaluateCodegenRewritten(EPTypeClass requiredType, CodegenMethodScope codegenMethodScope, CodegenClassScope codegenClassScope) {<NEW_LINE>CodegenExpressionField nodeObject = getNodeObject(codegenClassScope);<NEW_LINE>EPType inner = innerForge.getEvaluationType();<NEW_LINE>EPTypeClass evaluationType = requiredType.getType() == Object.class ? EPTypePremade.OBJECT.getEPType() : (EPTypeClass) inner;<NEW_LINE>ExprForgeCodegenSymbol scope = new ExprForgeCodegenSymbol(true, null);<NEW_LINE>CodegenMethod methodNode = codegenMethodScope.makeChildWithScope(evaluationType, ExprDeclaredForgeBase.class, scope, codegenClassScope).addParam(ExprForgeCodegenNames.PARAMS);<NEW_LINE>CodegenExpression refEPS = scope.getAddEPS(methodNode);<NEW_LINE>CodegenExpression refExprEvalCtx = scope.getAddExprEvalCtx(methodNode);<NEW_LINE>// generate code for the inner value so we know its symbols and derived symbols<NEW_LINE>CodegenExpression innerValue = innerForge.evaluateCodegen(requiredType, methodNode, scope, codegenClassScope);<NEW_LINE>// produce derived symbols<NEW_LINE>CodegenBlock block = methodNode.getBlock();<NEW_LINE>scope.derivedSymbolsCodegen(methodNode, block, codegenClassScope);<NEW_LINE>if (isCache) {<NEW_LINE>CodegenExpression eval = exprDotMethod(ref("entry"), "getResult");<NEW_LINE>if (evaluationType.getType() != Object.class) {<NEW_LINE>eval = cast((EPTypeClass) JavaClassHelper.getBoxedType(innerForge<MASK><NEW_LINE>}<NEW_LINE>block.declareVar(ExpressionResultCacheForDeclaredExprLastValue.EPTYPE, "cache", exprDotMethodChain(refExprEvalCtx).add("getExpressionResultCacheService").add("getAllocateDeclaredExprLastValue")).declareVar(ExpressionResultCacheEntryEventBeanArrayAndObj.EPTYPE, "entry", exprDotMethod(ref("cache"), "getDeclaredExpressionLastValue", nodeObject, refEPS)).ifCondition(notEqualsNull(ref("entry"))).blockReturn(eval).declareVar(evaluationType, "result", innerValue).expression(exprDotMethod(ref("cache"), "saveDeclaredExpressionLastValue", nodeObject, refEPS, ref("result")));<NEW_LINE>} else {<NEW_LINE>block.declareVar(evaluationType, "result", innerValue);<NEW_LINE>}<NEW_LINE>block.methodReturn(ref("result"));<NEW_LINE>return methodNode;<NEW_LINE>}
.getEvaluationType()), eval);
1,429,983
final StartMonitoringMemberResult executeStartMonitoringMember(StartMonitoringMemberRequest startMonitoringMemberRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(startMonitoringMemberRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<StartMonitoringMemberRequest> request = null;<NEW_LINE>Response<StartMonitoringMemberResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new StartMonitoringMemberRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(startMonitoringMemberRequest));<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, "Detective");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "StartMonitoringMember");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<StartMonitoringMemberResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new StartMonitoringMemberResultJsonUnmarshaller());<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();
204,978
private static <T, U> void eachSequentiallyImpl(Iterator<T> iterator, CFFactory<T, U> cfFactory, int index, List<U> tmpResult, CompletableFuture<List<U>> overallResult) {<NEW_LINE>if (!iterator.hasNext()) {<NEW_LINE>overallResult.complete(tmpResult);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>CompletableFuture<U> cf;<NEW_LINE>try {<NEW_LINE>cf = cfFactory.apply(iterator.next(), index, tmpResult);<NEW_LINE>Assert.assertNotNull(cf, () -> "cfFactory must return a non null value");<NEW_LINE>} catch (Exception e) {<NEW_LINE><MASK><NEW_LINE>cf.completeExceptionally(new CompletionException(e));<NEW_LINE>}<NEW_LINE>cf.whenComplete((cfResult, exception) -> {<NEW_LINE>if (exception != null) {<NEW_LINE>overallResult.completeExceptionally(exception);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>tmpResult.add(cfResult);<NEW_LINE>eachSequentiallyImpl(iterator, cfFactory, index + 1, tmpResult, overallResult);<NEW_LINE>});<NEW_LINE>}
cf = new CompletableFuture<>();
1,146,816
protected void flushToNode(ContainerUnloader container, NodeDraft nodeDraft, Node node) {<NEW_LINE>if (nodeDraft.getColor() != null) {<NEW_LINE>node.setColor(nodeDraft.getColor());<NEW_LINE>}<NEW_LINE>if (nodeDraft.getLabel() != null) {<NEW_LINE>if (node.getLabel() == null || !nodeDraft.isCreatedAuto()) {<NEW_LINE>node.setLabel(nodeDraft.getLabel());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (node.getTextProperties() != null) {<NEW_LINE>node.getTextProperties().setVisible(nodeDraft.isLabelVisible());<NEW_LINE>}<NEW_LINE>if (nodeDraft.getLabelColor() != null && node.getTextProperties() != null) {<NEW_LINE>Color labelColor = nodeDraft.getLabelColor();<NEW_LINE>node.getTextProperties().setColor(labelColor);<NEW_LINE>} else {<NEW_LINE>node.getTextProperties().setColor(new Color(0, 0, 0, 0));<NEW_LINE>}<NEW_LINE>if (nodeDraft.getLabelSize() != -1f && node.getTextProperties() != null) {<NEW_LINE>node.getTextProperties().setSize(nodeDraft.getLabelSize());<NEW_LINE>}<NEW_LINE>if ((nodeDraft.getX() != 0 || nodeDraft.getY() != 0 || nodeDraft.getZ() != 0) && (node.x() == 0 && node.y() == 0 && node.z() == 0)) {<NEW_LINE>node.setX(nodeDraft.getX());<NEW_LINE>node.<MASK><NEW_LINE>node.setZ(nodeDraft.getZ());<NEW_LINE>}<NEW_LINE>if (nodeDraft.getSize() != 0 && !Float.isNaN(nodeDraft.getSize())) {<NEW_LINE>node.setSize(nodeDraft.getSize());<NEW_LINE>} else if (node.size() == 0) {<NEW_LINE>node.setSize(10f);<NEW_LINE>}<NEW_LINE>// Timeset<NEW_LINE>if (nodeDraft.getTimeSet() != null) {<NEW_LINE>flushTimeSet(nodeDraft.getTimeSet(), node);<NEW_LINE>}<NEW_LINE>// Graph timeset<NEW_LINE>if (nodeDraft.getGraphTimestamp() != null) {<NEW_LINE>node.addTimestamp(nodeDraft.getGraphTimestamp());<NEW_LINE>} else if (nodeDraft.getGraphInterval() != null) {<NEW_LINE>node.addInterval(nodeDraft.getGraphInterval());<NEW_LINE>}<NEW_LINE>// Attributes<NEW_LINE>flushToElementAttributes(container, nodeDraft, node);<NEW_LINE>}
setY(nodeDraft.getY());
1,267,225
private boolean processCommonOptions(MainOptions mainOpts, Command command) throws SystemExitException {<NEW_LINE>if (command.help) {<NEW_LINE>throw command.usage(null);<NEW_LINE>}<NEW_LINE>boolean verbose;<NEW_LINE>switch(command.logLevel) {<NEW_LINE>case "error":<NEW_LINE>case "warn":<NEW_LINE>case "info":<NEW_LINE>verbose = false;<NEW_LINE>break;<NEW_LINE>case "debug":<NEW_LINE>case "trace":<NEW_LINE>verbose = true;<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw usage("Unknown log level '" + command.logLevel + "'");<NEW_LINE>}<NEW_LINE>if (command.configPath == null) {<NEW_LINE>command.configPath = mainOpts.configPath;<NEW_LINE>}<NEW_LINE>configureLogging(command.logLevel, <MASK><NEW_LINE>for (Map.Entry<String, String> pair : command.systemProperties.entrySet()) {<NEW_LINE>System.setProperty(pair.getKey(), pair.getValue());<NEW_LINE>}<NEW_LINE>return verbose;<NEW_LINE>}
command.logPath, command.logbackConfigPath);
366,029
public PNode visit(IfSSTNode node) {<NEW_LINE>int oldNum = generatorInfo.getNumOfActiveFlags();<NEW_LINE>ExpressionNode test = (ExpressionNode) node.test.accept(this);<NEW_LINE>StatementNode thenStatement = (StatementNode) node.thenStatement.accept(this);<NEW_LINE>// TODO: Do we need to generate empty else block, if doesn't exist? The execution check if<NEW_LINE>// the else branch is empty anyway.<NEW_LINE>StatementNode elseStatement = node.elseStatement == null ? BlockNode.createEmptyBlock() : (StatementNode) <MASK><NEW_LINE>StatementNode result = oldNum != generatorInfo.getNumOfActiveFlags() ? GeneratorIfNode.create(FactorySSTVisitor.toBooleanCastNode(test), thenStatement, elseStatement, generatorInfo) : new IfNode(FactorySSTVisitor.toBooleanCastNode(test), thenStatement, elseStatement);<NEW_LINE>if (node.startOffset != -1) {<NEW_LINE>result.assignSourceSection(createSourceSection(node.startOffset, node.endOffset));<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
node.elseStatement.accept(this);
319,807
public void toMatrix(Mat4f mat) {<NEW_LINE>float q00 = q0 * q0;<NEW_LINE>float q11 = q1 * q1;<NEW_LINE>float q22 = q2 * q2;<NEW_LINE>float q33 = q3 * q3;<NEW_LINE>// Diagonal elements<NEW_LINE>mat.set(0, 0, q00 + q11 - q22 - q33);<NEW_LINE>mat.set(1, 1, q00 - q11 + q22 - q33);<NEW_LINE>mat.set(2, 2, <MASK><NEW_LINE>// 0,1 and 1,0 elements<NEW_LINE>float q03 = q0 * q3;<NEW_LINE>float q12 = q1 * q2;<NEW_LINE>mat.set(0, 1, 2.0f * (q12 - q03));<NEW_LINE>mat.set(1, 0, 2.0f * (q03 + q12));<NEW_LINE>// 0,2 and 2,0 elements<NEW_LINE>float q02 = q0 * q2;<NEW_LINE>float q13 = q1 * q3;<NEW_LINE>mat.set(0, 2, 2.0f * (q02 + q13));<NEW_LINE>mat.set(2, 0, 2.0f * (q13 - q02));<NEW_LINE>// 1,2 and 2,1 elements<NEW_LINE>float q01 = q0 * q1;<NEW_LINE>float q23 = q2 * q3;<NEW_LINE>mat.set(1, 2, 2.0f * (q23 - q01));<NEW_LINE>mat.set(2, 1, 2.0f * (q01 + q23));<NEW_LINE>}
q00 - q11 - q22 + q33);
1,471,194
private static void saveEslintError(SensorContext context, EslintError eslintError, InputFile inputFile, String originalFilePath) {<NEW_LINE>String eslintKey = eslintError.ruleId;<NEW_LINE>if (eslintKey == null) {<NEW_LINE>LOG.warn("Parse error issue from ESLint will not be imported, file " + inputFile.uri());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>TextRange <MASK><NEW_LINE>TextPointer start = location.start();<NEW_LINE>ExternalRuleLoader ruleLoader = EslintRulesDefinition.loader(eslintKey);<NEW_LINE>RuleType ruleType = ruleLoader.ruleType(eslintKey);<NEW_LINE>Severity severity = ruleLoader.ruleSeverity(eslintKey);<NEW_LINE>Long effortInMinutes = ruleLoader.ruleConstantDebtMinutes(eslintKey);<NEW_LINE>LOG.debug("Saving external ESLint issue { file:\"{}\", id:{}, message:\"{}\", line:{}, offset:{}, type: {}, severity:{}, remediation:{} }", originalFilePath, eslintKey, eslintError.message, start.line(), start.lineOffset(), ruleType, severity, effortInMinutes);<NEW_LINE>NewExternalIssue newExternalIssue = context.newExternalIssue();<NEW_LINE>NewIssueLocation primaryLocation = newExternalIssue.newLocation().message(eslintError.message).on(inputFile).at(location);<NEW_LINE>newExternalIssue.at(primaryLocation).engineId(EslintRulesDefinition.REPOSITORY_KEY).ruleId(eslintKey).type(ruleType).severity(severity).remediationEffortMinutes(effortInMinutes).save();<NEW_LINE>}
location = getLocation(eslintError, inputFile);
1,578,952
final GetRoomResult executeGetRoom(GetRoomRequest getRoomRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getRoomRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetRoomRequest> request = null;<NEW_LINE>Response<GetRoomResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetRoomRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getRoomRequest));<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, "Alexa For Business");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetRoom");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetRoomResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetRoomResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
endClientExecution(awsRequestMetrics, request, response);
1,820,901
public static SweepableCellsRowResult of(RowResult<byte[]> rowResult) {<NEW_LINE>SweepableCellsRow rowName = SweepableCellsRow.BYTES_HYDRATOR.hydrateFromBytes(rowResult.getRowName());<NEW_LINE>Set<SweepableCellsColumnValue> columnValues = Sets.newHashSetWithExpectedSize(rowResult.getColumns().size());<NEW_LINE>for (Entry<byte[], byte[]> e : rowResult.getColumns().entrySet()) {<NEW_LINE>SweepableCellsColumn col = SweepableCellsColumn.BYTES_HYDRATOR.hydrateFromBytes(e.getKey());<NEW_LINE>com.palantir.atlasdb.keyvalue.api.StoredWriteReference value = SweepableCellsColumnValue.hydrateValue(e.getValue());<NEW_LINE>columnValues.add(SweepableCellsColumnValue.of(col, value));<NEW_LINE>}<NEW_LINE>return new SweepableCellsRowResult(rowName<MASK><NEW_LINE>}
, ImmutableSet.copyOf(columnValues));
1,449,397
final UntagResourceResult executeUntagResource(UntagResourceRequest untagResourceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(untagResourceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UntagResourceRequest> request = null;<NEW_LINE>Response<UntagResourceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UntagResourceRequestProtocolMarshaller(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, "DataBrew");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UntagResource");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UntagResourceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UntagResourceResultJsonUnmarshaller());<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(untagResourceRequest));
344,460
public void save(File directory) throws WebBrowserException {<NEW_LINE>File dir = directory;<NEW_LINE>if (dir == null) {<NEW_LINE>// may return null<NEW_LINE>dir = this.getBrowser().getResultDirectory();<NEW_LINE>}<NEW_LINE>if (dir == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// start with a human-readable String for this instance<NEW_LINE>String name = this.toString();<NEW_LINE>// replace the non-word characters with the empty String<NEW_LINE>// "\W" is a regular expression for a non-word character; the opposite is "\w"=[a-zA-Z_0-9]<NEW_LINE>name = name.replaceAll("\\W", "");<NEW_LINE>// chose an extension that matches the content type (only supports XML and HTML)<NEW_LINE>List<String> contentTypeList = this.getResponseHeader("Content-Type", true);<NEW_LINE>String contentType = (contentTypeList == null || contentTypeList.size() == 0) ? null : contentTypeList.get(0);<NEW_LINE>// default to html<NEW_LINE>String ext = (contentType != null && contentType.contains<MASK><NEW_LINE>// write the response body to the File<NEW_LINE>File body = new File(dir, name + "Body" + ext);<NEW_LINE>this.saveResponseBody(body);<NEW_LINE>// write response information to the File<NEW_LINE>File info = new File(dir, name + "Info.txt");<NEW_LINE>this.saveResponseInformation(info);<NEW_LINE>}
("text/xml")) ? ".xml" : ".html";
1,088,112
ActionResult<Wo> execute(EffectivePerson effectivePerson, String id, JsonElement jsonElement) throws Exception {<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>ActionResult<Wo> result = new ActionResult<>();<NEW_LINE>Wi wi = this.convertToWrapIn(jsonElement, Wi.class);<NEW_LINE>Business business = new Business(emc);<NEW_LINE>Meeting meeting = emc.find(id, Meeting.class);<NEW_LINE>if (null == meeting) {<NEW_LINE>throw new ExceptionMeetingNotExist(id);<NEW_LINE>}<NEW_LINE>if (!business.meetingEditAvailable(effectivePerson, meeting)) {<NEW_LINE>throw new ExceptionAccessDenied(effectivePerson);<NEW_LINE>}<NEW_LINE>List<String> inviteDelPersonList = this.convertToPerson(business, ListTools.trim(wi.getInvitePersonList(), true, true));<NEW_LINE>emc.beginTransaction(Meeting.class);<NEW_LINE>List<String> invitePersonList = ListUtils.subtract(meeting.getInvitePersonList(), inviteDelPersonList);<NEW_LINE>meeting.setInvitePersonList(invitePersonList);<NEW_LINE>List<String<MASK><NEW_LINE>originalList.addAll(inviteDelPersonList);<NEW_LINE>originalList = ListTools.trim(originalList, true, true);<NEW_LINE>meeting.setInviteDelPersonList(originalList);<NEW_LINE>emc.check(meeting, CheckPersistType.all);<NEW_LINE>emc.commit();<NEW_LINE>if (ConfirmStatus.allow.equals(meeting.getConfirmStatus())) {<NEW_LINE>for (String _s : inviteDelPersonList) {<NEW_LINE>MessageFactory.meeting_deleteInvitePerson(_s, meeting);<NEW_LINE>}<NEW_LINE>// this.notifyMeetingInviteMessage(business, meeting);<NEW_LINE>}<NEW_LINE>Wo wo = new Wo();<NEW_LINE>wo.setId(meeting.getId());<NEW_LINE>result.setData(wo);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>}
> originalList = meeting.getInviteDelPersonList();
593,809
public HibernatePagingItemReader<T> build() {<NEW_LINE>Assert.notNull(this.sessionFactory, "A SessionFactory must be provided");<NEW_LINE>Assert.state(this.fetchSize >= 0, "fetchSize must not be negative");<NEW_LINE>if (this.saveState) {<NEW_LINE>Assert.hasText(this.name, "A name is required when saveState is set to true");<NEW_LINE>}<NEW_LINE>if (this.queryProvider == null) {<NEW_LINE>Assert.state(StringUtils.hasText(queryString) ^ StringUtils.hasText(queryName), "queryString or queryName must be set");<NEW_LINE>}<NEW_LINE>HibernatePagingItemReader<T> reader = new HibernatePagingItemReader<>();<NEW_LINE>reader.setSessionFactory(this.sessionFactory);<NEW_LINE>reader.setSaveState(this.saveState);<NEW_LINE>reader.setMaxItemCount(this.maxItemCount);<NEW_LINE>reader.setCurrentItemCount(this.currentItemCount);<NEW_LINE>reader.setName(this.name);<NEW_LINE><MASK><NEW_LINE>reader.setParameterValues(this.parameterValues);<NEW_LINE>reader.setQueryName(this.queryName);<NEW_LINE>reader.setQueryProvider(this.queryProvider);<NEW_LINE>reader.setQueryString(this.queryString);<NEW_LINE>reader.setPageSize(this.pageSize);<NEW_LINE>reader.setUseStatelessSession(this.statelessSession);<NEW_LINE>return reader;<NEW_LINE>}
reader.setFetchSize(this.fetchSize);
362,755
static <A, O, I extends AttributeIndex<A, O>> boolean supportsQueryInternal(I backingIndex, Query<O> filterQuery, Query<O> rootQuery, Query<O> branchQuery, QueryOptions queryOptions) {<NEW_LINE>if (!backingIndex.supportsQuery(branchQuery, queryOptions)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// Check: rootQuery equals filterQuery<NEW_LINE>if (filterQuery.equals(rootQuery)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (!(rootQuery instanceof And)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// Check: rootQuery (r) is an And query, which has filterQuery (f) as any one of its direct children:<NEW_LINE>// r = and(x, y, f, z)<NEW_LINE>And<O> rootAndQuery = (And<O>) rootQuery;<NEW_LINE>if (rootAndQuery.getChildQueries().contains(filterQuery)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>// Check: rootQuery (r) is an And query and filterQuery (f) is an And query,<NEW_LINE>// and the direct children of f are also the direct children of r:<NEW_LINE>// f = and(a, b), r = and(x, a, y, b)<NEW_LINE>if (!(filterQuery instanceof And)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>And<O> filterAndQuery = (<MASK><NEW_LINE>return rootAndQuery.getChildQueries().containsAll(filterAndQuery.getChildQueries());<NEW_LINE>}
(And<O>) filterQuery);
468,358
public void init(int WindowNo, FormFrame frame) {<NEW_LINE>m_WindowNo = WindowNo;<NEW_LINE>m_frame = frame;<NEW_LINE>// Layout<NEW_LINE>frame.getContentPane().add(this, BorderLayout.CENTER);<NEW_LINE>this.setLayout(new BorderLayout());<NEW_LINE>this.add(tabbedPane, BorderLayout.CENTER);<NEW_LINE>this.add(confirmPanel, BorderLayout.SOUTH);<NEW_LINE>tabbedPane.addChangeListener(this);<NEW_LINE>confirmPanel.setActionListener(this);<NEW_LINE>//<NEW_LINE>tabbedPane.add(selectPanel, Msg.getMsg(Env.getCtx(), "Selection"));<NEW_LINE>selectPanel.add(attributeLabel1, new ALayoutConstraint(0, 0));<NEW_LINE>m_attributes = retrieveAttributes(Env.getCtx(), true, true);<NEW_LINE>Vector<KeyNamePair> vector = new Vector<>();<NEW_LINE>vector.add(new KeyNamePair(0, "", null));<NEW_LINE>for (MAttribute m_attribute : m_attributes) {<NEW_LINE>vector.add(toKeyNamePair(m_attribute));<NEW_LINE>}<NEW_LINE>attributeCombo1 = new CComboBox(vector);<NEW_LINE><MASK><NEW_LINE>selectPanel.add(attributeLabel2, new ALayoutConstraint(1, 0));<NEW_LINE>attributeCombo2 = new CComboBox(vector);<NEW_LINE>selectPanel.add(attributeCombo2, null);<NEW_LINE>//<NEW_LINE>fillPicks();<NEW_LINE>selectPanel.add(labelPriceList, new ALayoutConstraint(2, 0));<NEW_LINE>selectPanel.add(pickPriceList);<NEW_LINE>selectPanel.add(labelWarehouse, new ALayoutConstraint(3, 0));<NEW_LINE>selectPanel.add(pickWarehouse);<NEW_LINE>//<NEW_LINE>selectPanel.setPreferredSize(new Dimension(300, 200));<NEW_LINE>//<NEW_LINE>// Grid<NEW_LINE>tabbedPane.add(gridPanel, "AttributeGrid");<NEW_LINE>modePanel.add(modeLabel);<NEW_LINE>modePanel.add(modeCombo);<NEW_LINE>modeCombo.addActionListener(this);<NEW_LINE>}
selectPanel.add(attributeCombo1, null);
429,663
private void addDetailedThreadMetrics(long timestamp, MetricList metrics) {<NEW_LINE>ThreadMXBean bean = ManagementFactory.getThreadMXBean();<NEW_LINE>if (!bean.isThreadContentionMonitoringSupported()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!bean.isThreadContentionMonitoringEnabled()) {<NEW_LINE>bean.setThreadContentionMonitoringEnabled(true);<NEW_LINE>}<NEW_LINE>ThreadInfo[] threadInfo = bean.dumpAllThreads(false, false);<NEW_LINE>Arrays.sort(threadInfo, (a, b) -> {<NEW_LINE>long diff = b.getThreadId() - a.getThreadId();<NEW_LINE>return ((diff == 0L) ? 0 : (diff < 0L) ? -1 : 1);<NEW_LINE>});<NEW_LINE>long[] stateCounts <MASK><NEW_LINE>for (int i = 0; i < stateCounts.length; i++) {<NEW_LINE>stateCounts[i] = 0L;<NEW_LINE>}<NEW_LINE>long blockedCount = 0L;<NEW_LINE>long blockedTime = 0L;<NEW_LINE>long waitedCount = 0L;<NEW_LINE>long waitedTime = 0L;<NEW_LINE>int l = lastThreadInfos.length - 1;<NEW_LINE>for (int i = threadInfo.length - 1; i >= 0; i--) {<NEW_LINE>long currId = threadInfo[i].getThreadId();<NEW_LINE>while (l >= 0 && lastThreadInfos[l].getThreadId() < currId) {<NEW_LINE>--l;<NEW_LINE>}<NEW_LINE>if (l >= 0 && lastThreadInfos[l].getThreadId() > currId) {<NEW_LINE>BASE_THREAD_COUNTS[IDX_BLOCKED_COUNT] += lastThreadInfos[l].getBlockedCount();<NEW_LINE>BASE_THREAD_COUNTS[IDX_BLOCKED_TIME] += lastThreadInfos[l].getBlockedTime();<NEW_LINE>BASE_THREAD_COUNTS[IDX_WAITED_COUNT] += lastThreadInfos[l].getWaitedCount();<NEW_LINE>BASE_THREAD_COUNTS[IDX_WAITED_TIME] += lastThreadInfos[l].getWaitedTime();<NEW_LINE>}<NEW_LINE>stateCounts[STATE_LOOKUP.get(threadInfo[i].getThreadState())]++;<NEW_LINE>blockedCount += threadInfo[i].getBlockedCount();<NEW_LINE>blockedTime += threadInfo[i].getBlockedTime();<NEW_LINE>waitedCount += threadInfo[i].getWaitedCount();<NEW_LINE>waitedTime += threadInfo[i].getWaitedTime();<NEW_LINE>}<NEW_LINE>metrics.add(new Metric(THREAD_BLOCKED_COUNT, timestamp, blockedCount + BASE_THREAD_COUNTS[IDX_BLOCKED_COUNT]));<NEW_LINE>metrics.add(new Metric(THREAD_BLOCKED_TIME, timestamp, (blockedTime + BASE_THREAD_COUNTS[IDX_BLOCKED_TIME]) / 1000));<NEW_LINE>metrics.add(new Metric(THREAD_WAITED_COUNT, timestamp, waitedCount + BASE_THREAD_COUNTS[IDX_WAITED_COUNT]));<NEW_LINE>metrics.add(new Metric(THREAD_WAITED_TIME, timestamp, (waitedTime + BASE_THREAD_COUNTS[IDX_WAITED_TIME]) / 1000));<NEW_LINE>for (int i = 0; i < stateCounts.length; i++) {<NEW_LINE>metrics.add(new Metric(THREAD_COUNTS[i], timestamp, stateCounts[i]));<NEW_LINE>}<NEW_LINE>lastThreadInfos = threadInfo;<NEW_LINE>}
= new long[VALID_STATES.length];
737,215
public void initialize() {<NEW_LINE>if (initialized) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// put initialization code here<NEW_LINE>initValues(startPackage);<NEW_LINE>if (newName != null) {<NEW_LINE>FileObject fob;<NEW_LINE>do {<NEW_LINE>// NOI18N<NEW_LINE>fob = <MASK><NEW_LINE>if (fob != null) {<NEW_LINE>// NOI18N<NEW_LINE>newName += "1";<NEW_LINE>}<NEW_LINE>} while (fob != null);<NEW_LINE>newNameField.setText(newName);<NEW_LINE>newNameField.setSelectionStart(0);<NEW_LINE>newNameField.setSelectionEnd(newNameField.getText().length());<NEW_LINE>}<NEW_LINE>rootComboBox.addActionListener(this);<NEW_LINE>packageComboBox.addActionListener(this);<NEW_LINE>projectsComboBox.addActionListener(this);<NEW_LINE>Object textField = packageComboBox.getEditor().getEditorComponent();<NEW_LINE>if (textField instanceof JTextField) {<NEW_LINE>((JTextField) textField).getDocument().addDocumentListener(this);<NEW_LINE>}<NEW_LINE>newNameField.getDocument().addDocumentListener(this);<NEW_LINE>initialized = true;<NEW_LINE>}
fo.getFileObject(newName + ".java");
1,130,238
public TableAnswerElement answer(NetworkSnapshot snapshot) {<NEW_LINE>UndefinedReferencesQuestion question = (UndefinedReferencesQuestion) _question;<NEW_LINE>// Find all the filenames that produced the queried nodes. This might have false positives if<NEW_LINE>// a file produced multiple nodes, but that was already mis-handled before. Need to rewrite<NEW_LINE>// this question as a TableAnswerElement.<NEW_LINE>Set<String> includeNodes = question.getNodeSpecifier().resolve(_batfish.specifierContext(snapshot));<NEW_LINE>Multimap<String, String> hostnameFilenameMap = _batfish.loadParseVendorConfigurationAnswerElement(snapshot).getFileMap();<NEW_LINE>Set<String> includeFiles = hostnameFilenameMap.entries().stream().filter(e -> includeNodes.contains(e.getKey())).map(Entry::getValue).collect(Collectors.toSet());<NEW_LINE>Multiset<Row<MASK><NEW_LINE>SortedMap<String, SortedMap<String, SortedMap<String, SortedMap<String, SortedSet<Integer>>>>> undefinedReferences = _batfish.loadConvertConfigurationAnswerElementOrReparse(snapshot).getUndefinedReferences();<NEW_LINE>undefinedReferences.entrySet().stream().filter(e -> includeFiles.contains(e.getKey())).forEach(e -> rows.addAll(processEntryToRows(e)));<NEW_LINE>TableAnswerElement table = new TableAnswerElement(createMetadata());<NEW_LINE>table.postProcessAnswer(_question, rows);<NEW_LINE>return table;<NEW_LINE>}
> rows = LinkedHashMultiset.create();
14,819
public Invoker<T> select(final InvokeContext invocation) throws NoInvokerException {<NEW_LINE>long hash = Math.abs(StringUtils.convertLong(invocation.getAttachment(<MASK><NEW_LINE>long consistentHash = Math.abs(StringUtils.convertLong(invocation.getAttachment(Constants.TARS_CONSISTENT_HASH), 0));<NEW_LINE>if (consistentHash > 0) {<NEW_LINE>if (consistentHashLoadBalance == null) {<NEW_LINE>synchronized (consistentHashLoadBalanceLock) {<NEW_LINE>if (consistentHashLoadBalance == null) {<NEW_LINE>HmilyConsistentHashLoadBalance<T> tmp = new HmilyConsistentHashLoadBalance<T>(config);<NEW_LINE>tmp.refresh(lastRefreshInvokers);<NEW_LINE>consistentHashLoadBalance = tmp;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return consistentHashLoadBalance.select(invocation);<NEW_LINE>}<NEW_LINE>if (hash > 0) {<NEW_LINE>if (hashLoadBalance == null) {<NEW_LINE>synchronized (hashLoadBalanceLock) {<NEW_LINE>if (hashLoadBalance == null) {<NEW_LINE>HmilyHashLoadBalance<T> tmp = new HmilyHashLoadBalance<T>(config);<NEW_LINE>tmp.refresh(lastRefreshInvokers);<NEW_LINE>hashLoadBalance = tmp;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return hashLoadBalance.select(invocation);<NEW_LINE>}<NEW_LINE>return hmilyRoundRobinLoadBalance.select(invocation);<NEW_LINE>}
Constants.TARS_HASH), 0));
971,384
public void showDialog(UUID roomId) {<NEW_LINE>this.roomId = roomId;<NEW_LINE>if (!lastSessionId.equals(SessionHandler.getSessionId())) {<NEW_LINE>lastSessionId = SessionHandler.getSessionId();<NEW_LINE>this.player1Panel.setPlayerName(SessionHandler.getUserName());<NEW_LINE>// no computer<NEW_LINE>this.player1Panel.showLevel(false);<NEW_LINE>cbTournamentType.setModel(new DefaultComboBoxModel(SessionHandler.getTournamentTypes().toArray()));<NEW_LINE>cbGameType.setModel(new DefaultComboBoxModel(SessionHandler.getTournamentGameTypes().toArray()));<NEW_LINE>cbDeckType.setModel(new DefaultComboBoxModel<MASK><NEW_LINE>cbTimeLimit.setModel(new DefaultComboBoxModel(MatchTimeLimit.values()));<NEW_LINE>cbSkillLevel.setModel(new DefaultComboBoxModel(SkillLevel.values()));<NEW_LINE>cbDraftCube.setModel(new DefaultComboBoxModel(SessionHandler.getDraftCubes()));<NEW_LINE>cbDraftTiming.setModel(new DefaultComboBoxModel(Arrays.stream(TimingOption.values()).filter(o -> !o.equals(TimingOption.NONE)).toArray()));<NEW_LINE>// update player types<NEW_LINE>int i = 2;<NEW_LINE>for (TournamentPlayerPanel tournamentPlayerPanel : players) {<NEW_LINE>tournamentPlayerPanel.init(i++);<NEW_LINE>}<NEW_LINE>cbAllowSpectators.setSelected(true);<NEW_LINE>cbPlaneChase.setSelected(false);<NEW_LINE>this.setModal(true);<NEW_LINE>this.setLocation(150, 100);<NEW_LINE>}<NEW_LINE>onLoadSettings(0);<NEW_LINE>this.setVisible(true);<NEW_LINE>}
(SessionHandler.getDeckTypes()));
384,198
public // for each jar/zip file, call convertJar<NEW_LINE>int processArgumentsAndCheckEnvironment(String[] args) {<NEW_LINE><MASK><NEW_LINE>int rc = Config.checkRealTimeEnvironment();<NEW_LINE>if (rc != 0) {<NEW_LINE>if (config().requiresRealTimeEnvironment()) {<NEW_LINE>System.err.println(config().myName() + " must be run with the -Xrealtime flag on a real-time environment");<NEW_LINE>System.err.println(config().myName() + " doesn't run in a non-realtime environment\n");<NEW_LINE>config().usage();<NEW_LINE>System.exit(Main.sNonRealtimeEnv);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>rc = config().parseArgumentsForCorrectness(args);<NEW_LINE>if (rc != 0) {<NEW_LINE>return rc;<NEW_LINE>}<NEW_LINE>if (config().verbose() || config().version()) {<NEW_LINE>showVersion();<NEW_LINE>}<NEW_LINE>// Parse the arguments<NEW_LINE>if (config().parseArguments(args) != 0) {<NEW_LINE>return parseArgumentsError;<NEW_LINE>}
config().preliminaryCheck(args);
1,374,729
public ServiceResponse serviceImpl(Query call, HttpServletResponse response, Authorization authorization, final JsonObjectWithDefault permissions) throws APIException {<NEW_LINE>if (authorization.getIdentity() == null) {<NEW_LINE>throw new APIException(422, "Bad access token.");<NEW_LINE>}<NEW_LINE>JSONObject result = new JSONObject();<NEW_LINE>List<JSONObject> draftBotList = new ArrayList<JSONObject>();<NEW_LINE>Collection<ClientIdentity> authorized = DAO.getAuthorizedClients();<NEW_LINE>for (Client client : authorized) {<NEW_LINE>String email = client.toString().substring(6);<NEW_LINE>JSONObject json = client.toJSON();<NEW_LINE>ClientIdentity identity = new ClientIdentity(ClientIdentity.Type.<MASK><NEW_LINE>Authorization userAuthorization = DAO.getAuthorization(identity);<NEW_LINE>Map<String, DAO.Draft> map = DAO.readDrafts(userAuthorization.getIdentity());<NEW_LINE>JSONObject drafts = new JSONObject();<NEW_LINE>for (Map.Entry<String, DAO.Draft> entry : map.entrySet()) {<NEW_LINE>JSONObject val = new JSONObject();<NEW_LINE>val.put("object", entry.getValue().getObject());<NEW_LINE>val.put("created", DateParser.iso8601Format.format(entry.getValue().getCreated()));<NEW_LINE>val.put("modified", DateParser.iso8601Format.format(entry.getValue().getModified()));<NEW_LINE>drafts.put(entry.getKey(), val);<NEW_LINE>}<NEW_LINE>Iterator<?> keys = drafts.keySet().iterator();<NEW_LINE>while (keys.hasNext()) {<NEW_LINE>String key = (String) keys.next();<NEW_LINE>if (drafts.get(key) instanceof JSONObject) {<NEW_LINE>JSONObject draft = new JSONObject(drafts.get(key).toString());<NEW_LINE>draft.put("id", key);<NEW_LINE>draft.put("email", email);<NEW_LINE>draftBotList.add(draft);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>result.put("draftBots", draftBotList);<NEW_LINE>return new ServiceResponse(result);<NEW_LINE>}
email, client.getName());
638,510
public String bulkEdit(@RequestParam(required = false) String[] selectedUsers, @RequestParam(required = false) final String[] selectedSpaces, HttpServletRequest req) {<NEW_LINE>Profile authUser = utils.getAuthUser(req);<NEW_LINE>boolean <MASK><NEW_LINE>String operation = req.getParameter("operation");<NEW_LINE>String selection = req.getParameter("selection");<NEW_LINE>if (isAdmin && ("all".equals(selection) || selectedUsers != null)) {<NEW_LINE>// find all user objects even if there are more than 10000 users in the system<NEW_LINE>Pager pager = new Pager(1, "_docid", false, ScooldUtils.getConfig().maxItemsPerPage());<NEW_LINE>List<Profile> profiles;<NEW_LINE>LinkedList<Map<String, Object>> toUpdate = new LinkedList<>();<NEW_LINE>List<String> spaces = (selectedSpaces == null || selectedSpaces.length == 0) ? Collections.emptyList() : Arrays.asList(selectedSpaces);<NEW_LINE>do {<NEW_LINE>String query = (selection == null || "selected".equals(selection)) ? Config._ID + ":(\"" + String.join("\" \"", selectedUsers) + "\")" : "*";<NEW_LINE>profiles = pc.findQuery(Utils.type(Profile.class), query, pager);<NEW_LINE>profiles.stream().filter(p -> !utils.isMod(p)).forEach(p -> {<NEW_LINE>if ("add".equals(operation)) {<NEW_LINE>p.getSpaces().addAll(spaces);<NEW_LINE>} else if ("remove".equals(operation)) {<NEW_LINE>p.getSpaces().removeAll(spaces);<NEW_LINE>} else {<NEW_LINE>p.setSpaces(new HashSet<String>(spaces));<NEW_LINE>}<NEW_LINE>Map<String, Object> profile = new HashMap<>();<NEW_LINE>profile.put(Config._ID, p.getId());<NEW_LINE>profile.put("spaces", p.getSpaces());<NEW_LINE>toUpdate.add(profile);<NEW_LINE>});<NEW_LINE>} while (!profiles.isEmpty());<NEW_LINE>// always patch outside the loop because we modify _docid values!!!<NEW_LINE>LinkedList<Map<String, Object>> batch = new LinkedList<>();<NEW_LINE>while (!toUpdate.isEmpty()) {<NEW_LINE>batch.add(toUpdate.pop());<NEW_LINE>if (batch.size() >= 100) {<NEW_LINE>// partial batch update<NEW_LINE>pc.invokePatch("_batch", batch, Map.class);<NEW_LINE>batch.clear();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!batch.isEmpty()) {<NEW_LINE>pc.invokePatch("_batch", batch, Map.class);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return "redirect:" + PEOPLELINK + (isAdmin ? "?" + req.getQueryString() : "");<NEW_LINE>}
isAdmin = utils.isAdmin(authUser);
234,395
public void resolve(final ResolveContext resolveContext, final DependencyGraphVisitor modelVisitor, boolean includeSyntheticDependencies) {<NEW_LINE>IdGenerator<Long> idGenerator = new LongIdGenerator();<NEW_LINE>DefaultBuildableComponentResolveResult rootModule = new DefaultBuildableComponentResolveResult();<NEW_LINE>moduleResolver.resolve(resolveContext, rootModule);<NEW_LINE>int graphSize = estimateSize(resolveContext);<NEW_LINE><MASK><NEW_LINE>List<? extends DependencyMetadata> syntheticDependencies = includeSyntheticDependencies ? syntheticDependenciesOf(rootModule, resolveContext.getName()) : Collections.emptyList();<NEW_LINE>final ResolveState resolveState = new ResolveState(idGenerator, rootModule, resolveContext.getName(), idResolver, metaDataResolver, edgeFilter, attributesSchema, moduleExclusions, componentSelectorConverter, attributesFactory, dependencySubstitutionApplicator, versionSelectorScheme, versionComparator, versionParser, moduleConflictHandler.getResolver(), graphSize, resolveContext.getResolutionStrategy().getConflictResolution(), syntheticDependencies, conflictTracker);<NEW_LINE>Map<ModuleVersionIdentifier, ComponentIdentifier> componentIdentifierCache = Maps.newHashMapWithExpectedSize(graphSize / 2);<NEW_LINE>traverseGraph(resolveState, componentIdentifierCache);<NEW_LINE>validateGraph(resolveState, resolutionStrategy.isFailingOnDynamicVersions(), resolutionStrategy.isFailingOnChangingVersions());<NEW_LINE>assembleResult(resolveState, modelVisitor);<NEW_LINE>}
ResolutionStrategyInternal resolutionStrategy = resolveContext.getResolutionStrategy();
545,721
private List<City> fillWithCities(String name, final ResultMatcher<City> resultMatcher, final List<Integer> typeFilter) throws IOException {<NEW_LINE>List<City> result = new ArrayList<City>();<NEW_LINE>ResultMatcher<MapObject> matcher = new ResultMatcher<MapObject>() {<NEW_LINE><NEW_LINE>List<City> cache = new ArrayList<City>();<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean publish(MapObject o) {<NEW_LINE>City c = (City) o;<NEW_LINE>City.CityType type = c.getType();<NEW_LINE>if (type != null && type.ordinal() >= City.CityType.VILLAGE.ordinal()) {<NEW_LINE>if (c.getLocation() != null) {<NEW_LINE>City ct = getClosestCity(c.getLocation(), cache);<NEW_LINE>c.setClosestCity(ct);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return resultMatcher.publish(c);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean isCancelled() {<NEW_LINE>return resultMatcher.isCancelled();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>List<MapObject> foundCities = <MASK><NEW_LINE>for (MapObject o : foundCities) {<NEW_LINE>result.add((City) o);<NEW_LINE>if (resultMatcher.isCancelled()) {<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
searchMapObjectsByName(name, matcher, typeFilter);
346,400
public void onAuthenticationFailure(HttpServletRequest request, HttpServletResponse response, AuthenticationException exception) throws IOException, ServletException {<NEW_LINE>String failureUrlParam = StringUtil.cleanseUrlString(request.getParameter("failureUrl"));<NEW_LINE>String successUrlParam = StringUtil.cleanseUrlString(request.getParameter("successUrl"));<NEW_LINE>String failureUrl = (failureUrlParam != null) ? failureUrlParam.trim() : null;<NEW_LINE>Boolean sessionTimeout = (<MASK><NEW_LINE>if (StringUtils.isEmpty(failureUrl) && BooleanUtils.isNotTrue(sessionTimeout)) {<NEW_LINE>failureUrl = defaultFailureUrl;<NEW_LINE>}<NEW_LINE>if (BooleanUtils.isTrue(sessionTimeout)) {<NEW_LINE>failureUrl = "?sessionTimeout=true";<NEW_LINE>}<NEW_LINE>if (StringUtils.isEmpty(successUrlParam)) {<NEW_LINE>// Grab url the user, was redirected from<NEW_LINE>successUrlParam = request.getHeader("referer");<NEW_LINE>}<NEW_LINE>if (failureUrl != null) {<NEW_LINE>if (!StringUtils.isEmpty(successUrlParam)) {<NEW_LINE>// Preserve the original successUrl from the referer. If there is one, it must be the last url segment<NEW_LINE>int successUrlPos = successUrlParam.indexOf("successUrl");<NEW_LINE>if (successUrlPos >= 0) {<NEW_LINE>successUrlParam = successUrlParam.substring(successUrlPos);<NEW_LINE>} else {<NEW_LINE>successUrlParam = "successUrl=" + successUrlParam;<NEW_LINE>}<NEW_LINE>if (!failureUrl.contains("?")) {<NEW_LINE>failureUrl += "?" + successUrlParam;<NEW_LINE>} else {<NEW_LINE>failureUrl += "&" + successUrlParam;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>saveException(request, exception);<NEW_LINE>getRedirectStrategy().sendRedirect(request, response, failureUrl);<NEW_LINE>} else {<NEW_LINE>super.onAuthenticationFailure(request, response, exception);<NEW_LINE>}<NEW_LINE>}
Boolean) request.getAttribute("sessionTimeout");
1,777,909
public void sendEventToConsumers(EventRegistryEvent eventRegistryEvent) {<NEW_LINE>Collection<EventRegistryEventConsumer> engineEventRegistryEventConsumers = engineConfiguration.getEventRegistryEventConsumers().values();<NEW_LINE>EventRegistryProcessingInfo eventRegistryProcessingInfo = null;<NEW_LINE>for (EventRegistryEventConsumer eventConsumer : engineEventRegistryEventConsumers) {<NEW_LINE>EventRegistryProcessingInfo processingInfo = eventConsumer.eventReceived(eventRegistryEvent);<NEW_LINE>if (processingInfo != null && processingInfo.getEventConsumerInfos() != null && !processingInfo.getEventConsumerInfos().isEmpty()) {<NEW_LINE>if (eventRegistryProcessingInfo == null) {<NEW_LINE>eventRegistryProcessingInfo = new EventRegistryProcessingInfo();<NEW_LINE>}<NEW_LINE>eventRegistryProcessingInfo.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>if ((eventRegistryProcessingInfo == null || !eventRegistryProcessingInfo.eventHandled()) && engineConfiguration.getNonMatchingEventConsumer() != null) {<NEW_LINE>engineConfiguration.getNonMatchingEventConsumer().handleNonMatchingEvent(eventRegistryEvent, eventRegistryProcessingInfo);<NEW_LINE>}<NEW_LINE>}
setEventConsumerInfos(processingInfo.getEventConsumerInfos());
675,890
// DO NOT MODIFY THIS CODE, GENERATED AUTOMATICALLY<NEW_LINE>public static com.sun.jdi.request.MonitorWaitRequest createMonitorWaitRequest(com.sun.jdi.request.EventRequestManager a) throws org.netbeans.modules.debugger.jpda.jdi.InternalExceptionWrapper, org.netbeans.modules.debugger.jpda.jdi.VMDisconnectedExceptionWrapper {<NEW_LINE>if (org.netbeans.modules.debugger.jpda.JDIExceptionReporter.isLoggable()) {<NEW_LINE>org.netbeans.modules.debugger.jpda.JDIExceptionReporter.logCallStart("com.sun.jdi.request.EventRequestManager", "createMonitorWaitRequest", "JDI CALL: com.sun.jdi.request.EventRequestManager({0}).createMonitorWaitRequest()", new Object[] { a });<NEW_LINE>}<NEW_LINE>Object retValue = null;<NEW_LINE>try {<NEW_LINE>com.sun.jdi.request.MonitorWaitRequest ret;<NEW_LINE>ret = a.createMonitorWaitRequest();<NEW_LINE>retValue = ret;<NEW_LINE>return ret;<NEW_LINE>} catch (com.sun.jdi.InternalException ex) {<NEW_LINE>retValue = ex;<NEW_LINE>org.netbeans.modules.debugger.jpda.JDIExceptionReporter.report(ex);<NEW_LINE>throw new org.netbeans.modules.debugger.<MASK><NEW_LINE>} catch (com.sun.jdi.VMDisconnectedException ex) {<NEW_LINE>retValue = ex;<NEW_LINE>if (a instanceof com.sun.jdi.Mirror) {<NEW_LINE>com.sun.jdi.VirtualMachine vm = ((com.sun.jdi.Mirror) a).virtualMachine();<NEW_LINE>try {<NEW_LINE>vm.dispose();<NEW_LINE>} catch (com.sun.jdi.VMDisconnectedException vmdex) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>throw new org.netbeans.modules.debugger.jpda.jdi.VMDisconnectedExceptionWrapper(ex);<NEW_LINE>} catch (Error err) {<NEW_LINE>retValue = err;<NEW_LINE>throw err;<NEW_LINE>} catch (RuntimeException rex) {<NEW_LINE>retValue = rex;<NEW_LINE>throw rex;<NEW_LINE>} finally {<NEW_LINE>if (org.netbeans.modules.debugger.jpda.JDIExceptionReporter.isLoggable()) {<NEW_LINE>org.netbeans.modules.debugger.jpda.JDIExceptionReporter.logCallEnd("com.sun.jdi.request.EventRequestManager", "createMonitorWaitRequest", retValue);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
jpda.jdi.InternalExceptionWrapper(ex);
652,230
public CreateResponse create(ComplexKeyGroupMembership groupMembership) {<NEW_LINE>// For create construct a key based on the memberID and groupID in the membership<NEW_LINE>// object<NEW_LINE>if (!groupMembership.getId().hasMemberID() || !groupMembership.getId().hasGroupID()) {<NEW_LINE>throw new RestLiServiceException(S_400_BAD_REQUEST, "groupID and memberID fields must be set while creating a ComplexKeyGroupMembership.");<NEW_LINE>}<NEW_LINE>GroupMembershipKey groupMembershipKey = new GroupMembershipKey();<NEW_LINE>groupMembershipKey.setMemberID(groupMembership.getId().getMemberID());<NEW_LINE>groupMembershipKey.setGroupID(groupMembership.getId().getGroupID());<NEW_LINE>ComplexResourceKey<GroupMembershipKey, GroupMembershipParam> complexResourceKey = new ComplexResourceKey<>(groupMembershipKey, new GroupMembershipParam());<NEW_LINE>groupMembership.setId(complexResourceKey.getKey());<NEW_LINE>_app.getMembershipMgr().save(toGroupMembership(groupMembership));<NEW_LINE>return new <MASK><NEW_LINE>}
CreateResponse(complexResourceKey, HttpStatus.S_201_CREATED);
1,636,959
private static SequenceQuery<AbstractInsnNode> conditionalAtStart() {<NEW_LINE>final Slot<Integer> counterVariable = <MASK><NEW_LINE>final Slot<LabelNode> loopStart = Slot.create(LabelNode.class);<NEW_LINE>final Slot<LabelNode> loopEnd = Slot.create(LabelNode.class);<NEW_LINE>return // .then(anIntegerConstant().and(debug("constant"))) // skip this?<NEW_LINE>QueryStart.any(AbstractInsnNode.class).then(anIStore(counterVariable.write()).and(debug("store"))).then(aLabelNode(loopStart.write()).and(debug("label"))).then(// optionally put object on stack<NEW_LINE>anILoadOf(counterVariable.read()).and(debug("load"))).// optionally put object on stack<NEW_LINE>zeroOrMore(QueryStart.match(opCode(Opcodes.ALOAD))).then(loadsAnIntegerToCompareTo().and(debug("push"))).then(jumpsTo(loopEnd.write()).and(aConditionalJump())).then(isA(LabelNode.class)).zeroOrMore(anything()).then(targetInstruction(counterVariable).and(debug("target"))).then(jumpsTo(loopStart.read()).and(debug("jump"))).then(labelNode(loopEnd.read())).zeroOrMore(anything());<NEW_LINE>}
Slot.create(Integer.class);
1,605,947
public static boolean deleteOldies(File dir, int maxLifeInSeconds, String prefix, boolean root) {<NEW_LINE>Date currentDate = new Date();<NEW_LINE><MASK><NEW_LINE>boolean empty = true;<NEW_LINE>boolean success = true;<NEW_LINE>long threasholdMillisec = currentDateMillisec - (maxLifeInSeconds * 1000);<NEW_LINE>if (dir.isDirectory() && (StringUtils.isEmpty(prefix) || dir.getName().startsWith(prefix))) {<NEW_LINE>File[] children = dir.listFiles();<NEW_LINE>for (int i = 0; i < children.length; i++) {<NEW_LINE>if ((StringUtils.isEmpty(prefix) || children[i].getName().startsWith(prefix))) {<NEW_LINE>long millisec = children[i].lastModified();<NEW_LINE>if (millisec < threasholdMillisec) {<NEW_LINE>success = deleteOldies(children[i], maxLifeInSeconds, prefix, false);<NEW_LINE>if (!success)<NEW_LINE>return false;<NEW_LINE>} else<NEW_LINE>empty = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// if the dir is a file or if the directory is empty and it is no the root dir, we delete it<NEW_LINE>if (!root && (empty || (!dir.isDirectory()))) {<NEW_LINE>if (StringUtils.isEmpty(prefix) || dir.getName().startsWith(prefix))<NEW_LINE>success = dir.delete();<NEW_LINE>}<NEW_LINE>return success;<NEW_LINE>}
long currentDateMillisec = currentDate.getTime();
272,827
public SuccessResponseEntity addContainer(@AuditParam("namespace") @PathVariable String namespace, AddContainerModel addContainerModel, HttpServletRequest request) throws SaturnJobConsoleException {<NEW_LINE>if (addContainerModel.getContainerToken() == null) {<NEW_LINE>throw new SaturnJobConsoleException("Please input container token");<NEW_LINE>}<NEW_LINE>marathonService.checkContainerTokenNotNull(namespace, addContainerModel.getContainerToken());<NEW_LINE>marathonService.saveOrUpdateContainerTokenIfNecessary(namespace, addContainerModel.getContainerToken());<NEW_LINE>ContainerConfig containerConfig = new ContainerConfig();<NEW_LINE>containerConfig.setTaskId(addContainerModel.getTaskId());<NEW_LINE>containerConfig.setCmd(addContainerModel.getCmd());<NEW_LINE>containerConfig.setCpus(addContainerModel.getCpus());<NEW_LINE>containerConfig.setMem(addContainerModel.getMem());<NEW_LINE>containerConfig.setInstances(addContainerModel.getInstances());<NEW_LINE>containerConfig.setConstraints(addContainerModel.getConstraints());<NEW_LINE>containerConfig.setEnv(addContainerModel.getEnv());<NEW_LINE>containerConfig.setPrivileged(addContainerModel.getPrivileged() == null ? false : addContainerModel.getPrivileged());<NEW_LINE>containerConfig.setForcePullImage(addContainerModel.getForcePullImage() == null ? true : addContainerModel.getForcePullImage());<NEW_LINE>containerConfig.setParameters(addContainerModel.getParameters());<NEW_LINE>containerConfig.setVolumes(addContainerModel.getVolumes());<NEW_LINE>containerConfig.setImage(addContainerModel.getImage());<NEW_LINE>containerConfig.setCreateTime(System.currentTimeMillis());<NEW_LINE>String imageNew = "";<NEW_LINE>String vipSaturnDcosRegistryUri = SaturnEnvProperties.VIP_SATURN_DCOS_REGISTRY_URI;<NEW_LINE>if (vipSaturnDcosRegistryUri == null || vipSaturnDcosRegistryUri.trim().length() == 0) {<NEW_LINE>throw new SaturnJobConsoleException("VIP_SATURN_DCOS_REGISTRY_URI is not configured");<NEW_LINE>} else {<NEW_LINE>if (vipSaturnDcosRegistryUri.startsWith("http://")) {<NEW_LINE>String tmp = vipSaturnDcosRegistryUri.substring("http://".length());<NEW_LINE>while (tmp.endsWith("/")) {<NEW_LINE>tmp = tmp.substring(0, <MASK><NEW_LINE>}<NEW_LINE>imageNew = tmp + "/" + addContainerModel.getImage();<NEW_LINE>} else if (vipSaturnDcosRegistryUri.startsWith("https://")) {<NEW_LINE>String tmp = vipSaturnDcosRegistryUri.substring("https://".length());<NEW_LINE>while (tmp.endsWith("/")) {<NEW_LINE>tmp = tmp.substring(0, tmp.length() - 1);<NEW_LINE>}<NEW_LINE>imageNew = tmp + "/" + addContainerModel.getImage();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>containerConfig.setImage(imageNew);<NEW_LINE>if (containerConfig.getEnv() == null) {<NEW_LINE>containerConfig.setEnv(new HashMap<String, String>());<NEW_LINE>}<NEW_LINE>if (!containerConfig.getEnv().containsKey(SaturnEnvProperties.NAME_VIP_SATURN_ZK_CONNECTION)) {<NEW_LINE>containerConfig.getEnv().put(SaturnEnvProperties.NAME_VIP_SATURN_ZK_CONNECTION, getCurrentZkAddr(request.getSession()));<NEW_LINE>}<NEW_LINE>marathonService.addContainer(namespace, containerConfig);<NEW_LINE>return new SuccessResponseEntity();<NEW_LINE>}
tmp.length() - 1);
1,749,652
public void testBytesMessageStringBuffer(HttpServletRequest request, HttpServletResponse response) throws Throwable {<NEW_LINE><MASK><NEW_LINE>emptyQueue(jmsQCFBindings, jmsQueue);<NEW_LINE>boolean failedTest = false;<NEW_LINE>BytesMessage msgOut = jmsContext.createBytesMessage();<NEW_LINE>msgOut.writeByte((byte) 55);<NEW_LINE>msgOut.writeInt(10);<NEW_LINE>try {<NEW_LINE>msgOut.getBody(StringBuffer.class);<NEW_LINE>failedTest = true;<NEW_LINE>} catch (MessageFormatException ex) {<NEW_LINE>ex.printStackTrace();<NEW_LINE>}<NEW_LINE>jmsContext.createProducer().send(jmsQueue, msgOut);<NEW_LINE>BytesMessage msgIn = (BytesMessage) jmsContext.createConsumer(jmsQueue).receive(1000);<NEW_LINE>try {<NEW_LINE>msgIn.getBody(StringBuffer.class);<NEW_LINE>failedTest = true;<NEW_LINE>} catch (MessageFormatException ex) {<NEW_LINE>ex.printStackTrace();<NEW_LINE>}<NEW_LINE>if (failedTest) {<NEW_LINE>throw new Exception("testBytesMessage failed: Expected exception not seen");<NEW_LINE>}<NEW_LINE>}
JMSContext jmsContext = jmsQCFBindings.createContext();
1,235,286
public static void replaceLinks(final ODocument iVertex, final String iFieldName, final OIdentifiable iVertexToRemove, final OIdentifiable iNewVertex) {<NEW_LINE>if (iVertex == null)<NEW_LINE>return;<NEW_LINE>final Object fieldValue = iVertexToRemove != null ? iVertex.field(iFieldName) : iVertex.removeField(iFieldName);<NEW_LINE>if (fieldValue == null)<NEW_LINE>return;<NEW_LINE>if (fieldValue instanceof OIdentifiable) {<NEW_LINE>// SINGLE RECORD<NEW_LINE>if (iVertexToRemove != null) {<NEW_LINE>if (!fieldValue.equals(iVertexToRemove)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>iVertex.field(iFieldName, iNewVertex);<NEW_LINE>}<NEW_LINE>} else if (fieldValue instanceof ORidBag) {<NEW_LINE>// COLLECTION OF RECORDS: REMOVE THE ENTRY<NEW_LINE><MASK><NEW_LINE>boolean found = false;<NEW_LINE>final Iterator<OIdentifiable> it = bag.rawIterator();<NEW_LINE>while (it.hasNext()) {<NEW_LINE>if (it.next().equals(iVertexToRemove)) {<NEW_LINE>// REMOVE THE OLD ENTRY<NEW_LINE>found = true;<NEW_LINE>it.remove();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (found)<NEW_LINE>// ADD THE NEW ONE<NEW_LINE>bag.add(iNewVertex);<NEW_LINE>} else if (fieldValue instanceof Collection) {<NEW_LINE>final Collection col = (Collection) fieldValue;<NEW_LINE>if (col.remove(iVertexToRemove))<NEW_LINE>col.add(iNewVertex);<NEW_LINE>}<NEW_LINE>iVertex.save();<NEW_LINE>}
final ORidBag bag = (ORidBag) fieldValue;
1,720,198
public RequestTimeline takeTimelineSnapshot() {<NEW_LINE>Instant now = Instant.now();<NEW_LINE><MASK><NEW_LINE>Instant timeAcquired = this.timeAcquired();<NEW_LINE>Instant timeConnected = this.timeConnected();<NEW_LINE>Instant timeConfigured = this.timeConfigured();<NEW_LINE>Instant timeSent = this.timeSent();<NEW_LINE>Instant timeReceived = this.timeReceived();<NEW_LINE>Instant timeCompleted = this.timeCompleted();<NEW_LINE>Instant timeCompletedOrNow = timeCompleted == null ? now : timeCompleted;<NEW_LINE>if (this.timeConnected() != null) {<NEW_LINE>return RequestTimeline.of(new RequestTimeline.Event("connectionCreated", timeCreated, timeConnected() == null ? timeCompletedOrNow : timeConnected), new RequestTimeline.Event("connectionConfigured", timeConnected, timeConfigured == null ? timeCompletedOrNow : timeConfigured), new RequestTimeline.Event("requestSent", timeConfigured, timeSent == null ? timeCompletedOrNow : timeSent), new RequestTimeline.Event("transitTime", timeSent, timeReceived == null ? timeCompletedOrNow : timeReceived), new RequestTimeline.Event("received", timeReceived, timeCompletedOrNow));<NEW_LINE>} else {<NEW_LINE>return RequestTimeline.of(new RequestTimeline.Event("connectionAcquired", timeCreated, timeAcquired() == null ? timeCompletedOrNow : timeAcquired), new RequestTimeline.Event("connectionConfigured", timeAcquired, timeConfigured == null ? timeCompletedOrNow : timeConfigured), new RequestTimeline.Event("requestSent", timeConfigured, timeSent == null ? timeCompletedOrNow : timeSent), new RequestTimeline.Event("transitTime", timeSent, timeReceived == null ? timeCompletedOrNow : timeReceived), new RequestTimeline.Event("received", timeReceived, timeCompletedOrNow));<NEW_LINE>}<NEW_LINE>}
Instant timeCreated = this.timeCreated();
735,376
private static List<OptionItem> fromPresets(Context context, VideoPreset[] presets, PlayerData playerData, Runnable onFormatSelected) {<NEW_LINE>List<OptionItem> result = new ArrayList<>();<NEW_LINE>FormatItem selectedFormat = playerData.getFormat(FormatItem.TYPE_VIDEO);<NEW_LINE>boolean isPresetSelection = selectedFormat <MASK><NEW_LINE>for (VideoPreset preset : presets) {<NEW_LINE>result.add(0, UiOptionItem.from(preset.name, option -> setFormat(preset.format, playerData, onFormatSelected), isPresetSelection && preset.format.equals(selectedFormat)));<NEW_LINE>}<NEW_LINE>result.add(0, UiOptionItem.from(context.getString(R.string.video_preset_disabled), optionItem -> setFormat(playerData.getDefaultVideoFormat(), playerData, onFormatSelected), !isPresetSelection));<NEW_LINE>return result;<NEW_LINE>}
!= null && selectedFormat.isPreset();
1,372,443
public static boolean canAccessInfo(String infoWindowName) {<NEW_LINE>boolean result = false;<NEW_LINE>int roleid = Env.getAD_Role_ID(Env.getCtx());<NEW_LINE>String sqlRolePermission = "Select COUNT(AD_ROLE_ID) AS ROWCOUNT FROM AD_ROLE WHERE AD_ROLE_ID=" + roleid + " AND ALLOW_INFO_" + infoWindowName + "='Y'";<NEW_LINE>log.config(sqlRolePermission);<NEW_LINE>PreparedStatement prolestmt = null;<NEW_LINE>ResultSet rs = null;<NEW_LINE>try {<NEW_LINE>prolestmt = DB.prepareStatement(sqlRolePermission, null);<NEW_LINE>rs = prolestmt.executeQuery();<NEW_LINE>rs.next();<NEW_LINE>if (rs.getInt("ROWCOUNT") > 0) {<NEW_LINE>result = true;<NEW_LINE>} else {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>System.out.println(e);<NEW_LINE>log.log(Level.SEVERE, "(1)", e);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>rs = null;<NEW_LINE>prolestmt = null;<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
DB.close(rs, prolestmt);
48,649
private HttpServerOptions createDefaultHttpServerOptions() {<NEW_LINE>HttpServerOptions serverOptions = new HttpServerOptions();<NEW_LINE>serverOptions.setIdleTimeout(TransportConfig.getConnectionIdleTimeoutInSeconds());<NEW_LINE>serverOptions.setCompressionSupported(TransportConfig.getCompressed());<NEW_LINE>serverOptions.setMaxHeaderSize(TransportConfig.getMaxHeaderSize());<NEW_LINE>serverOptions.setMaxFormAttributeSize(TransportConfig.getMaxFormAttributeSize());<NEW_LINE>serverOptions.setCompressionLevel(TransportConfig.getCompressionLevel());<NEW_LINE>serverOptions.setMaxChunkSize(TransportConfig.getMaxChunkSize());<NEW_LINE>serverOptions.setDecompressionSupported(TransportConfig.getDecompressionSupported());<NEW_LINE>serverOptions.setDecoderInitialBufferSize(TransportConfig.getDecoderInitialBufferSize());<NEW_LINE>serverOptions.<MASK><NEW_LINE>serverOptions.setMaxInitialLineLength(TransportConfig.getMaxInitialLineLength());<NEW_LINE>if (endpointObject.isHttp2Enabled()) {<NEW_LINE>serverOptions.setUseAlpn(TransportConfig.getUseAlpn()).setInitialSettings(new Http2Settings().setPushEnabled(TransportConfig.getPushEnabled()).setMaxConcurrentStreams(TransportConfig.getMaxConcurrentStreams()).setHeaderTableSize(TransportConfig.getHttp2HeaderTableSize()).setInitialWindowSize(TransportConfig.getInitialWindowSize()).setMaxFrameSize(TransportConfig.getMaxFrameSize()).setMaxHeaderListSize(TransportConfig.getMaxHeaderListSize()));<NEW_LINE>}<NEW_LINE>if (endpointObject.isSslEnabled()) {<NEW_LINE>SSLOptionFactory factory = SSLOptionFactory.createSSLOptionFactory(SSL_KEY, null);<NEW_LINE>SSLOption sslOption;<NEW_LINE>if (factory == null) {<NEW_LINE>sslOption = SSLOption.buildFromYaml(SSL_KEY);<NEW_LINE>} else {<NEW_LINE>sslOption = factory.createSSLOption();<NEW_LINE>}<NEW_LINE>SSLCustom sslCustom = SSLCustom.createSSLCustom(sslOption.getSslCustomClass());<NEW_LINE>VertxTLSBuilder.buildNetServerOptions(sslOption, sslCustom, serverOptions);<NEW_LINE>}<NEW_LINE>return serverOptions;<NEW_LINE>}
setHttp2ConnectionWindowSize(TransportConfig.getHttp2ConnectionWindowSize());
165,906
private void exportTasksIntoSystemClipboard() {<NEW_LINE>Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();<NEW_LINE>// We create a copy of the task model here, to allow for manipulations with the tasks when builing<NEW_LINE>// an instance of the external document flavor.<NEW_LINE>// See issue https://github.com/bardsoftware/ganttproject/issues/2050<NEW_LINE>// Test case: GanttChartSelectionTest::testStartMoveTransactionAndExternalDocumentFlavor_Issue2050<NEW_LINE>var exportedTaskManager = myTaskManager.emptyClone();<NEW_LINE>var customDefMap = new HashMap<CustomPropertyDefinition, CustomPropertyDefinition>();<NEW_LINE>for (var def : myTaskManager.getCustomPropertyManager().getDefinitions()) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>exportedTaskManager.importData(myTaskManager, customDefMap);<NEW_LINE>clipboard.setContents(new GPTransferable(new ClipboardContents(exportedTaskManager)), this);<NEW_LINE>}
customDefMap.put(def, def);
1,192,607
public void onEvent(Event event) {<NEW_LINE>if (RpcRunningState.isUnitTestMode() || lookoutCollectDisable) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Class eventClass = event.getClass();<NEW_LINE>if (eventClass == ClientEndInvokeEvent.class) {<NEW_LINE>ClientEndInvokeEvent clientEndInvokeEvent = (ClientEndInvokeEvent) event;<NEW_LINE>RpcClientLookoutModel rpcClientMetricsModel = createClientMetricsModel(clientEndInvokeEvent.getRequest(), clientEndInvokeEvent.getResponse());<NEW_LINE>rpcMetrics.collectClient(rpcClientMetricsModel);<NEW_LINE>} else if (eventClass == ServerSendEvent.class) {<NEW_LINE>ServerSendEvent serverSendEvent = (ServerSendEvent) event;<NEW_LINE>RpcServerLookoutModel rpcServerMetricsModel = createServerMetricsModel(serverSendEvent.getRequest(), serverSendEvent.getResponse());<NEW_LINE>rpcMetrics.collectServer(rpcServerMetricsModel);<NEW_LINE>} else if (eventClass == ServerStartedEvent.class) {<NEW_LINE>ServerStartedEvent serverStartedEvent = (ServerStartedEvent) event;<NEW_LINE>rpcMetrics.collectThreadPool(serverStartedEvent.getServerConfig(), serverStartedEvent.getThreadPoolExecutor());<NEW_LINE>} else if (eventClass == ServerStoppedEvent.class) {<NEW_LINE>ServerStoppedEvent serverStartedEvent = (ServerStoppedEvent) event;<NEW_LINE>rpcMetrics.<MASK><NEW_LINE>} else if (eventClass == ProviderPubEvent.class) {<NEW_LINE>ProviderPubEvent providerPubEvent = (ProviderPubEvent) event;<NEW_LINE>rpcMetrics.collectProvderPubInfo(providerPubEvent.getProviderConfig());<NEW_LINE>} else if (eventClass == ConsumerSubEvent.class) {<NEW_LINE>ConsumerSubEvent consumerSubEvent = (ConsumerSubEvent) event;<NEW_LINE>rpcMetrics.collectConsumerSubInfo(consumerSubEvent.getConsumerConfig());<NEW_LINE>}<NEW_LINE>}
removeThreadPool(serverStartedEvent.getServerConfig());
1,027,217
protected boolean copyObject(String source, String destination) {<NEW_LINE>LOG.<MASK><NEW_LINE>// Retry copy for a few times, in case some Swift internal errors happened during copy.<NEW_LINE>for (int i = 0; i < NUM_RETRIES; i++) {<NEW_LINE>try {<NEW_LINE>Container container = mAccount.getContainer(mContainerName);<NEW_LINE>container.getObject(source).copyObject(container, container.getObject(destination));<NEW_LINE>return true;<NEW_LINE>} catch (CommandException e) {<NEW_LINE>LOG.error("Source path {} does not exist", source);<NEW_LINE>return false;<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.error("Failed to copy file {} to {}", source, destination, e);<NEW_LINE>if (i != NUM_RETRIES - 1) {<NEW_LINE>LOG.error("Retrying copying file {} to {}", source, destination);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>LOG.error("Failed to copy file {} to {}, after {} retries", source, destination, NUM_RETRIES);<NEW_LINE>return false;<NEW_LINE>}
debug("copy from {} to {}", source, destination);
683,088
public static boolean checkPathExist(String remotePath, BrokerDesc brokerDesc) throws UserException {<NEW_LINE>Pair<TFileBrokerService.Client, TNetworkAddress> pair = getBrokerAddressAndClient(brokerDesc, ClientPool.brokerTimeoutMs);<NEW_LINE>TFileBrokerService.Client client = pair.first;<NEW_LINE>TNetworkAddress address = pair.second;<NEW_LINE>boolean failed = true;<NEW_LINE>try {<NEW_LINE>TBrokerCheckPathExistRequest req = new TBrokerCheckPathExistRequest(TBrokerVersion.VERSION_ONE, remotePath, brokerDesc.getProperties());<NEW_LINE>TBrokerCheckPathExistResponse <MASK><NEW_LINE>if (rep.getOpStatus().getStatusCode() != TBrokerOperationStatusCode.OK) {<NEW_LINE>throw new UserException("Broker check path exist failed. path=" + remotePath + ", broker=" + address + ", msg=" + rep.getOpStatus().getMessage());<NEW_LINE>}<NEW_LINE>failed = false;<NEW_LINE>return rep.isPathExist;<NEW_LINE>} catch (TException e) {<NEW_LINE>LOG.warn("Broker check path exist failed, path={}, address={}, exception={}", remotePath, address, e);<NEW_LINE>throw new UserException("Broker check path exist exception. path=" + remotePath + ",broker=" + address);<NEW_LINE>} finally {<NEW_LINE>returnClient(client, address, failed);<NEW_LINE>}<NEW_LINE>}
rep = client.checkPathExist(req);
458,708
public PublishBatchResultEntry unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>PublishBatchResultEntry publishBatchResultEntry = new PublishBatchResultEntry();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>if (context.isStartOfDocument())<NEW_LINE>targetDepth += 2;<NEW_LINE>while (true) {<NEW_LINE><MASK><NEW_LINE>if (xmlEvent == XmlPullParser.END_DOCUMENT)<NEW_LINE>break;<NEW_LINE>if (xmlEvent == XmlPullParser.START_TAG) {<NEW_LINE>if (context.testExpression("Id", targetDepth)) {<NEW_LINE>publishBatchResultEntry.setId(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("MessageId", targetDepth)) {<NEW_LINE>publishBatchResultEntry.setMessageId(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("SequenceNumber", targetDepth)) {<NEW_LINE>publishBatchResultEntry.setSequenceNumber(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent == XmlPullParser.END_TAG) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return publishBatchResultEntry;<NEW_LINE>}
int xmlEvent = context.nextEvent();
422,157
private Object returnVMInfo(ObjectOutput o) throws IOException {<NEW_LINE>Map<String, String> result = new HashMap<String, String>();<NEW_LINE>Properties props = System.getProperties();<NEW_LINE>for (String s : props.stringPropertyNames()) {<NEW_LINE>if (!s.startsWith("java")) {<NEW_LINE>// NOI18N<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>result.put(s, props.getProperty(s));<NEW_LINE>}<NEW_LINE>LOG.log(Level.FINE, "Sending properties: " + props);<NEW_LINE>StringBuilder cp = new StringBuilder();<NEW_LINE>for (URL u : loader.getURLs()) {<NEW_LINE>try {<NEW_LINE>File f = new File(u.toURI());<NEW_LINE>String s = f.getPath();<NEW_LINE>if (EXCLUDE_CLASSPATH_ITEMS.matcher(s).find()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (cp.length() > 0) {<NEW_LINE>// NOI18N<NEW_LINE>cp.append(":");<NEW_LINE>}<NEW_LINE>cp.<MASK><NEW_LINE>} catch (URISyntaxException ex) {<NEW_LINE>cp.append(u.toExternalForm());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (String s : props.getProperty("java.class.path").split(File.pathSeparator)) {<NEW_LINE>// NOI18N<NEW_LINE>if (s.isEmpty()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (EXCLUDE_CLASSPATH_ITEMS.matcher(s).find()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (cp.length() > 0) {<NEW_LINE>// NOI18N<NEW_LINE>cp.append(":");<NEW_LINE>}<NEW_LINE>cp.append(s);<NEW_LINE>}<NEW_LINE>LOG.log(Level.FINE, "Classloader path: " + cp);<NEW_LINE>// NOI18N<NEW_LINE>result.put("nb.class.path", cp.toString());<NEW_LINE>return result;<NEW_LINE>}
append(f.getPath());
1,677,739
protected GHResponse routeVia(GHRequest request, Solver solver) {<NEW_LINE>GHResponse ghRsp = new GHResponse();<NEW_LINE>StopWatch sw = new StopWatch().start();<NEW_LINE>DirectedEdgeFilter directedEdgeFilter = solver.createDirectedEdgeFilter();<NEW_LINE>List<Snap> snaps = ViaRouting.lookup(encodingManager, request.getPoints(), solver.createSnapFilter(), locationIndex, request.getSnapPreventions(), request.getPointHints(), directedEdgeFilter, request.getHeadings());<NEW_LINE>ghRsp.addDebugInfo("idLookup:" + sw.stop().getSeconds() + "s");<NEW_LINE>// (base) query graph used to resolve headings, curbsides etc. this is not necessarily the same thing as<NEW_LINE>// the (possibly implementation specific) query graph used by PathCalculator<NEW_LINE>QueryGraph queryGraph = QueryGraph.create(graph, snaps);<NEW_LINE>PathCalculator pathCalculator = solver.createPathCalculator(queryGraph);<NEW_LINE>boolean passThrough = getPassThrough(request.getHints());<NEW_LINE>boolean forceCurbsides = getForceCurbsides(request.getHints());<NEW_LINE>ViaRouting.Result result = ViaRouting.calcPaths(request.getPoints(), queryGraph, snaps, directedEdgeFilter, pathCalculator, request.getCurbsides(), forceCurbsides, request.getHeadings(), passThrough);<NEW_LINE>if (request.getPoints().size() != result.paths.size() + 1)<NEW_LINE>throw new RuntimeException("There should be exactly one more point than paths. points:" + request.getPoints().size() + ", paths:" + result.paths.size());<NEW_LINE>// here each path represents one leg of the via-route and we merge them all together into one response path<NEW_LINE>ResponsePath responsePath = concatenatePaths(request, solver.weighting, queryGraph, result<MASK><NEW_LINE>responsePath.addDebugInfo(result.debug);<NEW_LINE>ghRsp.add(responsePath);<NEW_LINE>ghRsp.getHints().putObject("visited_nodes.sum", result.visitedNodes);<NEW_LINE>ghRsp.getHints().putObject("visited_nodes.average", (float) result.visitedNodes / (snaps.size() - 1));<NEW_LINE>return ghRsp;<NEW_LINE>}
.paths, getWaypoints(snaps));
1,429,437
private static Request prepareReindexRequest(ReindexRequest reindexRequest, boolean waitForCompletion) {<NEW_LINE>String endpoint = new EndpointBuilder().addPathPart("_reindex").build();<NEW_LINE>Request request = new Request(HttpMethod.POST.name(), endpoint);<NEW_LINE>Params params = new Params(request).withWaitForCompletion(waitForCompletion).withRefresh(reindexRequest.isRefresh()).withTimeout(reindexRequest.getTimeout()).withWaitForActiveShards(reindexRequest.getWaitForActiveShards()).<MASK><NEW_LINE>if (reindexRequest.getDestination().isRequireAlias()) {<NEW_LINE>params.putParam("require_alias", Boolean.TRUE.toString());<NEW_LINE>}<NEW_LINE>if (reindexRequest.getScrollTime() != null) {<NEW_LINE>params.putParam("scroll", reindexRequest.getScrollTime());<NEW_LINE>}<NEW_LINE>params.putParam("slices", Integer.toString(reindexRequest.getSlices()));<NEW_LINE>if (reindexRequest.getMaxDocs() > -1) {<NEW_LINE>params.putParam("max_docs", Integer.toString(reindexRequest.getMaxDocs()));<NEW_LINE>}<NEW_LINE>request.setEntity(createEntity(reindexRequest, REQUEST_BODY_CONTENT_TYPE));<NEW_LINE>return request;<NEW_LINE>}
withRequestsPerSecond(reindexRequest.getRequestsPerSecond());
510,556
public void syncAttributesToASIAware(@NonNull final IAttributeSet attributeSet, @NonNull final IAttributeSetInstanceAware asiAware) {<NEW_LINE>final AttributeSetInstanceId oldAsiId = AttributeSetInstanceId.ofRepoIdOrNone(asiAware.getM_AttributeSetInstance_ID());<NEW_LINE>final AttributeSetInstanceId asiId;<NEW_LINE>if (oldAsiId.isRegular()) {<NEW_LINE>final I_M_AttributeSetInstance asiCopy = ASICopy.newInstance(oldAsiId).copy();<NEW_LINE>asiId = AttributeSetInstanceId.<MASK><NEW_LINE>} else {<NEW_LINE>final I_M_AttributeSetInstance asiNew = createASI(ProductId.ofRepoId(asiAware.getM_Product_ID()));<NEW_LINE>asiId = AttributeSetInstanceId.ofRepoId(asiNew.getM_AttributeSetInstance_ID());<NEW_LINE>}<NEW_LINE>for (final I_M_Attribute attributeRecord : attributeSet.getAttributes()) {<NEW_LINE>setAttributeInstanceValue(asiId, AttributeCode.ofString(attributeRecord.getValue()), attributeSet.getValue(attributeRecord));<NEW_LINE>}<NEW_LINE>asiAware.setM_AttributeSetInstance_ID(asiId.getRepoId());<NEW_LINE>}
ofRepoId(asiCopy.getM_AttributeSetInstance_ID());
764,235
public static String encodeToString(byte[] challenge) throws Exception {<NEW_LINE>if (Platform.isAndroid()) {<NEW_LINE>// Base64.encodeToString(sha256_HMAC.doFinal(challenge), Base64.DEFAULT).trim()<NEW_LINE>// Equivalent of the above commented line of code but using reflections<NEW_LINE>// so that this class works on both android and non-android systems.<NEW_LINE>Class base64Class = getBase64ClassAndroid();<NEW_LINE>Method method = base64Class.getMethod("encodeToString", byte[<MASK><NEW_LINE>Field field = base64Class.getField("DEFAULT");<NEW_LINE>String result = (String) method.invoke(null, challenge, field.getInt(base64Class));<NEW_LINE>return result.trim();<NEW_LINE>} else {<NEW_LINE>// Base64.getEncoder().encodeToString(sha256_HMAC.doFinal(challenge)).trim();<NEW_LINE>Class base64Class = getBase64ClassJava8();<NEW_LINE>Object encoderObject = base64Class.getMethod("getEncoder").invoke(null);<NEW_LINE>String result = (String) encoderObject.getClass().getMethod("encodeToString", byte[].class).invoke(encoderObject, challenge);<NEW_LINE>return result.trim();<NEW_LINE>}<NEW_LINE>}
].class, int.class);
1,159,187
protected void consumeMethodHeaderNameWithTypeParameters(boolean isAnnotationMethod) {<NEW_LINE>// MethodHeaderName ::= Modifiersopt TypeParameters Type 'Identifier' '('<NEW_LINE>// AnnotationMethodHeaderName ::= Modifiersopt TypeParameters Type 'Identifier' '('<NEW_LINE>// RecoveryMethodHeaderName ::= Modifiersopt TypeParameters Type 'Identifier' '('<NEW_LINE>MethodDeclaration md = null;<NEW_LINE>if (isAnnotationMethod) {<NEW_LINE>md = new AnnotationMethodDeclaration(this.compilationUnit.compilationResult);<NEW_LINE>this.recordStringLiterals = false;<NEW_LINE>} else {<NEW_LINE>md = new MethodDeclaration(this.compilationUnit.compilationResult);<NEW_LINE>}<NEW_LINE>// name<NEW_LINE>md.selector = this.identifierStack[this.identifierPtr];<NEW_LINE>long selectorSource = this<MASK><NEW_LINE>this.identifierLengthPtr--;<NEW_LINE>// type<NEW_LINE>md.returnType = getTypeReference(this.intStack[this.intPtr--]);<NEW_LINE>if (isAnnotationMethod)<NEW_LINE>rejectIllegalLeadingTypeAnnotations(md.returnType);<NEW_LINE>md.bits |= (md.returnType.bits & ASTNode.HasTypeAnnotations);<NEW_LINE>// consume type parameters<NEW_LINE>int length = this.genericsLengthStack[this.genericsLengthPtr--];<NEW_LINE>this.genericsPtr -= length;<NEW_LINE>System.arraycopy(this.genericsStack, this.genericsPtr + 1, md.typeParameters = new TypeParameter[length], 0, length);<NEW_LINE>// modifiers<NEW_LINE>md.declarationSourceStart = this.intStack[this.intPtr--];<NEW_LINE>md.modifiersSourceStart = this.intStack[this.intPtr--];<NEW_LINE>md.modifiers = this.intStack[this.intPtr--];<NEW_LINE>// consume annotations<NEW_LINE>if ((length = this.expressionLengthStack[this.expressionLengthPtr--]) != 0) {<NEW_LINE>System.arraycopy(this.expressionStack, (this.expressionPtr -= length) + 1, md.annotations = new Annotation[length], 0, length);<NEW_LINE>}<NEW_LINE>// javadoc<NEW_LINE>md.javadoc = this.javadoc;<NEW_LINE>this.javadoc = null;<NEW_LINE>// highlight starts at selector start<NEW_LINE>md.sourceStart = (int) (selectorSource >>> 32);<NEW_LINE>pushOnAstStack(md);<NEW_LINE>md.sourceEnd = this.lParenPos;<NEW_LINE>md.bodyStart = this.lParenPos + 1;<NEW_LINE>// initialize this.listLength before reading parameters/throws<NEW_LINE>this.listLength = 0;<NEW_LINE>// recovery<NEW_LINE>if (this.currentElement != null) {<NEW_LINE>boolean isType;<NEW_LINE>if (// || md.modifiers != 0<NEW_LINE>(isType = this.currentElement instanceof RecoveredType) || (Util.getLineNumber(md.returnType.sourceStart, this.scanner.lineEnds, 0, this.scanner.linePtr) == Util.getLineNumber(md.sourceStart, this.scanner.lineEnds, 0, this.scanner.linePtr))) {<NEW_LINE>if (isType) {<NEW_LINE>((RecoveredType) this.currentElement).pendingTypeParameters = null;<NEW_LINE>}<NEW_LINE>this.lastCheckPoint = md.bodyStart;<NEW_LINE>this.currentElement = this.currentElement.add(md, 0);<NEW_LINE>this.lastIgnoredToken = -1;<NEW_LINE>} else {<NEW_LINE>this.lastCheckPoint = md.sourceStart;<NEW_LINE>this.restartRecovery = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.identifierPositionStack[this.identifierPtr--];
943,233
public <T> Subscriber<T> wrapPublisherSubscriberAndSubscription(final Subscriber<T> subscriber, final ContextMap context) {<NEW_LINE>if (subscriber instanceof ContextPreservingSubscriber) {<NEW_LINE>final ContextPreservingSubscriber<T> s <MASK><NEW_LINE>if (s.saved == context) {<NEW_LINE>return subscriber instanceof ContextPreservingSubscriberAndSubscription ? subscriber : new ContextPreservingSubscriberAndSubscription<>(s.subscriber, context);<NEW_LINE>}<NEW_LINE>} else if (subscriber instanceof ContextPreservingSubscriptionSubscriber) {<NEW_LINE>final ContextPreservingSubscriptionSubscriber<T> s = (ContextPreservingSubscriptionSubscriber<T>) subscriber;<NEW_LINE>if (s.saved == context) {<NEW_LINE>return new ContextPreservingSubscriberAndSubscription<>(s.subscriber, context);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new ContextPreservingSubscriberAndSubscription<>(subscriber, context);<NEW_LINE>}
= (ContextPreservingSubscriber<T>) subscriber;
881,816
final ActivateUserResult executeActivateUser(ActivateUserRequest activateUserRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(activateUserRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ActivateUserRequest> request = null;<NEW_LINE>Response<ActivateUserResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ActivateUserRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(activateUserRequest));<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, "WorkDocs");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ActivateUser");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ActivateUserResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ActivateUserResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.endEvent(Field.RequestMarshallTime);