idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
1,599,032
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {<NEW_LINE>this.<MASK><NEW_LINE>getDialog().getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));<NEW_LINE>View rootView = inflater.inflate(R.layout.dialog_fragment_no_entries, container);<NEW_LINE>TV_no_entries_create = (TextView) rootView.findViewById(R.id.TV_no_entries_create);<NEW_LINE>TV_no_entries_create.setOnClickListener(this);<NEW_LINE>SpannableString content = new SpannableString(TV_no_entries_create.getText());<NEW_LINE>content.setSpan(new UnderlineSpan(), 0, content.length(), 0);<NEW_LINE>TV_no_entries_create.setText(content);<NEW_LINE>TV_no_entries_create.setTextColor(ThemeManager.getInstance().getThemeMainColor(getActivity()));<NEW_LINE>return rootView;<NEW_LINE>}
getDialog().setCanceledOnTouchOutside(true);
455,648
public VaultLockPolicy unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>VaultLockPolicy vaultLockPolicy = new VaultLockPolicy();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("Policy", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>vaultLockPolicy.setPolicy(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return vaultLockPolicy;<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
202,296
public void marshall(CreateDataRepositoryAssociationRequest createDataRepositoryAssociationRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (createDataRepositoryAssociationRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(createDataRepositoryAssociationRequest.getFileSystemId(), FILESYSTEMID_BINDING);<NEW_LINE>protocolMarshaller.marshall(createDataRepositoryAssociationRequest.getFileSystemPath(), FILESYSTEMPATH_BINDING);<NEW_LINE>protocolMarshaller.marshall(createDataRepositoryAssociationRequest.getDataRepositoryPath(), DATAREPOSITORYPATH_BINDING);<NEW_LINE>protocolMarshaller.marshall(createDataRepositoryAssociationRequest.getBatchImportMetaDataOnCreate(), BATCHIMPORTMETADATAONCREATE_BINDING);<NEW_LINE>protocolMarshaller.marshall(createDataRepositoryAssociationRequest.getImportedFileChunkSize(), IMPORTEDFILECHUNKSIZE_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(createDataRepositoryAssociationRequest.getClientRequestToken(), CLIENTREQUESTTOKEN_BINDING);<NEW_LINE>protocolMarshaller.marshall(createDataRepositoryAssociationRequest.getTags(), TAGS_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
createDataRepositoryAssociationRequest.getS3(), S3_BINDING);
1,536,595
public List<SFormatSerializerMap> listAvailableOutputFormats(Long poid) throws ServerException, UserException {<NEW_LINE>Map<String, SFormatSerializerMap> <MASK><NEW_LINE>try (DatabaseSession session = getBimServer().getDatabase().createSession(OperationType.READ_ONLY)) {<NEW_LINE>Project project = session.get(poid, OldQuery.getDefault());<NEW_LINE>try {<NEW_LINE>List<SSerializerPluginConfiguration> allSerializersForPoids = getServiceMap().get(PluginInterface.class).getAllSerializersForPoids(true, Collections.singleton(poid));<NEW_LINE>for (SSerializerPluginConfiguration pluginConfiguration : allSerializersForPoids) {<NEW_LINE>PluginDescriptor pluginDescriptor = session.get(pluginConfiguration.getPluginDescriptorId(), OldQuery.getDefault());<NEW_LINE>Plugin plugin = getBimServer().getPluginManager().getPlugin(pluginDescriptor.getIdentifier(), true);<NEW_LINE>String outputFormat = null;<NEW_LINE>// TODO For now only streaming serializers<NEW_LINE>if (plugin instanceof StreamingSerializerPlugin) {<NEW_LINE>outputFormat = ((StreamingSerializerPlugin) plugin).getOutputFormat(Schema.valueOf(project.getSchema().toUpperCase()));<NEW_LINE>}<NEW_LINE>if (outputFormat != null) {<NEW_LINE>SFormatSerializerMap map = outputs.get(outputFormat);<NEW_LINE>if (map == null) {<NEW_LINE>map = new SFormatSerializerMap();<NEW_LINE>map.setFormat(outputFormat);<NEW_LINE>outputs.put(outputFormat, map);<NEW_LINE>}<NEW_LINE>map.getSerializers().add(pluginConfiguration);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (ServerException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>} catch (UserException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>return new ArrayList<>(outputs.values());<NEW_LINE>} catch (BimserverDatabaseException e) {<NEW_LINE>return handleException(e);<NEW_LINE>}<NEW_LINE>}
outputs = new HashMap<>();
1,242,805
public Record unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>AwsJsonReader reader = context.getReader();<NEW_LINE>if (!reader.isContainer()) {<NEW_LINE>reader.skipValue();<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Record record = new Record();<NEW_LINE>reader.beginObject();<NEW_LINE>while (reader.hasNext()) {<NEW_LINE>String name = reader.nextName();<NEW_LINE>if (name.equals("SequenceNumber")) {<NEW_LINE>record.setSequenceNumber(StringJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("ApproximateArrivalTimestamp")) {<NEW_LINE>record.setApproximateArrivalTimestamp(DateJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("Data")) {<NEW_LINE>record.setData(ByteBufferJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("PartitionKey")) {<NEW_LINE>record.setPartitionKey(StringJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("EncryptionType")) {<NEW_LINE>record.setEncryptionType(StringJsonUnmarshaller.getInstance<MASK><NEW_LINE>} else {<NEW_LINE>reader.skipValue();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>reader.endObject();<NEW_LINE>return record;<NEW_LINE>}
().unmarshall(context));
1,355,967
private void processEntryForLogSegmentBucket(ScanResults results, IndexEntry indexEntry, Map<StoreKey, IndexFinalState> keyFinalStates) {<NEW_LINE>IndexValue indexValue = indexEntry.getValue();<NEW_LINE>results.updateLogSegmentBaseBucket(indexValue.getOffset().getName(), indexValue.getSize());<NEW_LINE>if (indexValue.isPut()) {<NEW_LINE>long expiresAtMs = indexValue.getExpiresAtMs();<NEW_LINE>long deleteAtMs = Utils.Infinite_Time;<NEW_LINE>IndexFinalState finalState = keyFinalStates.get(indexEntry.getKey());<NEW_LINE>if (finalState != null && finalState.isDelete()) {<NEW_LINE>deleteAtMs = finalState.getOperationTime();<NEW_LINE>}<NEW_LINE>if (expiresAtMs == Utils.Infinite_Time && deleteAtMs != Utils.Infinite_Time) {<NEW_LINE>handleLogSegmentDeletedBucketUpdate(results, indexValue, deleteAtMs, SUBTRACT);<NEW_LINE>} else if (expiresAtMs != Utils.Infinite_Time && deleteAtMs == Utils.Infinite_Time) {<NEW_LINE>handleLogSegmentExpiredBucketUpdate(results, indexValue, expiresAtMs, SUBTRACT);<NEW_LINE>} else if (expiresAtMs != Utils.Infinite_Time && deleteAtMs != Utils.Infinite_Time) {<NEW_LINE>if (expiresAtMs < deleteAtMs) {<NEW_LINE>handleLogSegmentExpiredBucketUpdate(results, indexValue, expiresAtMs, SUBTRACT);<NEW_LINE>} else {<NEW_LINE>handleLogSegmentDeletedBucketUpdate(results, indexValue, deleteAtMs, SUBTRACT);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (!indexValue.isDelete() && !indexValue.isUndelete() && indexValue.isTtlUpdate()) {<NEW_LINE>IndexFinalState finalState = keyFinalStates.get(indexEntry.getKey());<NEW_LINE>if (finalState != null && finalState.isDelete()) {<NEW_LINE>Offset beginningOfThisLogSegment = new Offset(indexValue.getOffset().getName(), LogSegment.HEADER_SIZE);<NEW_LINE>FileSpan fileSpan = new FileSpan(beginningOfThisLogSegment, indexValue.getOffset());<NEW_LINE>try {<NEW_LINE>IndexValue putValue = index.findKey(indexEntry.getKey(), fileSpan, EnumSet.of(PersistentIndex.IndexEntryType.PUT));<NEW_LINE>if (putValue != null) {<NEW_LINE>// When the Put IndexValue is in the same log segment as the TTL_UPDATE value, then TTL_UPDATE value is invalid.<NEW_LINE>handleLogSegmentDeletedBucketUpdate(results, indexValue, <MASK><NEW_LINE>}<NEW_LINE>} catch (StoreException e) {<NEW_LINE>logger.error("Failed to find PUT IndexEntry for key {} in filespan {}", indexEntry.getKey(), fileSpan, e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
finalState.getOperationTime(), SUBTRACT);
1,684,765
public void parseContent(String content) {<NEW_LINE>Matcher matcher = attPattern.matcher(content);<NEW_LINE>String value;<NEW_LINE>int bidx;<NEW_LINE>int eidx;<NEW_LINE>while (matcher.find()) {<NEW_LINE>bidx = matcher.start(2) + 1;<NEW_LINE>eidx = matcher.end(2) - 1;<NEW_LINE>addParameter(matcher.group(1), bidx, eidx, false, false);<NEW_LINE>}<NEW_LINE>matcher = tagPattern.matcher(content);<NEW_LINE>while (matcher.find()) {<NEW_LINE>// if it is a CDATA content dequeue<NEW_LINE>// the trailer and the footer from the param string<NEW_LINE>value = matcher.group(2);<NEW_LINE><MASK><NEW_LINE>eidx = matcher.end(2);<NEW_LINE>if (value.startsWith("<![CDATA[") && value.endsWith("]]>")) {<NEW_LINE>// <![CDATA[ //]]><NEW_LINE>value = value.substring(9, value.length() - 3);<NEW_LINE>} else {<NEW_LINE>value = getUnescapedValue(value);<NEW_LINE>}<NEW_LINE>addParameter(matcher.group(1), bidx, eidx, false, value);<NEW_LINE>}<NEW_LINE>}
bidx = matcher.start(2);
609,245
public Hover provideHover(ASTNode node, TypeDeclaration typeDeclaration, ITypeBinding type, int offset, TextDocument doc, IJavaProject project, SpringProcessLiveData[] processLiveData) {<NEW_LINE>if (processLiveData.length > 0 && !isComponentAnnotatedType(typeDeclaration)) {<NEW_LINE>ITypeBinding beanType = typeDeclaration.resolveBinding();<NEW_LINE>if (beanType != null) {<NEW_LINE>String id = getBeanId(null, beanType, Flags.isStatic(typeDeclaration.getModifiers()));<NEW_LINE>Hover hover = assembleHover(project, processLiveData, app -> definedBean(app, getBeanType(beanType), id), typeDeclaration, true, true);<NEW_LINE>if (hover != null) {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>hover.setRange(doc.toRange(name.getStartPosition(), name.getLength()));<NEW_LINE>} catch (BadLocationException e) {<NEW_LINE>LOG.error("", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return hover;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
SimpleName name = typeDeclaration.getName();
108,156
public void main() {<NEW_LINE>RFloat gShadowValue = (<MASK><NEW_LINE>RVec4 color = (RVec4) getGlobal(DefaultShaderVar.G_COLOR);<NEW_LINE>RVec3 ambientColor = (RVec3) getGlobal(LightsShaderVar.G_AMBIENT_COLOR);<NEW_LINE>RVec3 eyeDir = (RVec3) getGlobal(DefaultShaderVar.V_EYE_DIR);<NEW_LINE>RVec3 normal = (RVec3) getGlobal(DefaultShaderVar.G_NORMAL);<NEW_LINE>RVec3 viewDir = new RVec3("viewDir");<NEW_LINE>viewDir.assign(normalize(eyeDir.multiply(-1)));<NEW_LINE>RFloat NdotV = new RFloat("NdotV");<NEW_LINE>NdotV.assign(clamp(dot(normal, viewDir), 0, 1));<NEW_LINE>RFloat sinNV = new RFloat("sinNV");<NEW_LINE>sinNV.assign("sqrt(1.0 - NdotV * NdotV)");<NEW_LINE>RVec3 diffuse = new RVec3("diffuse");<NEW_LINE>diffuse.assign(0);<NEW_LINE>RFloat power = new RFloat("power");<NEW_LINE>power.assign(0.0f);<NEW_LINE>RFloat roughness2 = new RFloat("roughness2");<NEW_LINE>roughness2.assign(mRoughness * mRoughness);<NEW_LINE>RFloat A = new RFloat("A");<NEW_LINE>A.assign("1.0 - 0.5 * roughness2 / (roughness2 + 0.33)");<NEW_LINE>RFloat B = new RFloat("B");<NEW_LINE>B.assign("0.45 * roughness2 / (roughness2 + 0.09)");<NEW_LINE>for (int i = 0; i < mLights.size(); i++) {<NEW_LINE>RFloat attenuation = (RFloat) getGlobal(LightsShaderVar.V_LIGHT_ATTENUATION, i);<NEW_LINE>RFloat lightPower = (RFloat) getGlobal(LightsShaderVar.U_LIGHT_POWER, i);<NEW_LINE>RVec3 lightColor = (RVec3) getGlobal(LightsShaderVar.U_LIGHT_COLOR, i);<NEW_LINE>RVec3 lightDir = new RVec3("lightDir" + i);<NEW_LINE>RFloat NdotL = mgNdotL[i];<NEW_LINE>NdotL.assign(clamp(dot(normal, lightDir), 0, 1));<NEW_LINE>// cos(phi_v, phi_l)<NEW_LINE>RFloat cosPhi = new RFloat("cosPhi" + i);<NEW_LINE>cosPhi.assign(dot(new ShaderVar(normalize(viewDir.subtract(NdotV).multiply(normal)), DataType.VEC3), new ShaderVar(normalize(lightDir.subtract(NdotL).multiply(normal)), DataType.VEC3)));<NEW_LINE>RFloat sinNL = new RFloat("sinNL" + i);<NEW_LINE>sinNL.assign("sqrt(1.0 - NdotL" + i + " * NdotL" + i + ")");<NEW_LINE>// sin(max(theta_v, theta_l))<NEW_LINE>RFloat s = new RFloat("s" + i);<NEW_LINE>s.assign("NdotV < NdotL" + i + " ? sinNV : sinNL" + i);<NEW_LINE>// tan(min(theta_v, theta_l))<NEW_LINE>RFloat t = new RFloat("t" + i);<NEW_LINE>t.assign("NdotV > NdotL" + i + " ? sinNV / NdotV : sinNL" + i + " / NdotL" + i);<NEW_LINE>//<NEW_LINE>// -- power = uLightPower * NdotL * (A + B * cosPhi * s * t) * vAttenuation;<NEW_LINE>//<NEW_LINE>power.assign(lightPower.multiply(NdotL).multiply(enclose(A.add(B.multiply(cosPhi).multiply(s).multiply(t)))).multiply(attenuation));<NEW_LINE>//<NEW_LINE>// -- diffuse.rgb += uLightColor * power;<NEW_LINE>//<NEW_LINE>diffuse.assignAdd(lightColor.multiply(power));<NEW_LINE>}<NEW_LINE>color.rgb().assign(diffuse.multiply(color.rgb()).add(ambientColor));<NEW_LINE>color.rgb().assignMultiply(new RFloat("1.0").subtract(gShadowValue));<NEW_LINE>}
RFloat) getGlobal(DefaultShaderVar.G_SHADOW_VALUE);
1,063,480
public static void printLocationArrays(String data) {<NEW_LINE>ArrayList<String> countries = getCountries(data);<NEW_LINE>ArrayList<Country> array = new ArrayList<Country>();<NEW_LINE>// set up the main array with the list of countries<NEW_LINE>for (String s : countries) {<NEW_LINE>array.add(new Country(s));<NEW_LINE>}<NEW_LINE>JSONArray jsonArray = new JSONArray(data);<NEW_LINE>for (int i = 0; i < jsonArray.length(); i++) {<NEW_LINE>JSONObject jsonObject = jsonArray.getJSONObject(i);<NEW_LINE>String countName = jsonObject.getString("country");<NEW_LINE>// add the city to the country<NEW_LINE>for (int j = 0; j < countries.size(); j++) {<NEW_LINE>if (countName.equals(countries.get(j))) {<NEW_LINE>String <MASK><NEW_LINE>if (n.equals(countName)) {<NEW_LINE>n = "All Cities";<NEW_LINE>}<NEW_LINE>array.get(j).citys.add(new City(n, jsonObject.getInt("woeid")));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (Country c : array) {<NEW_LINE>System.out.print("public static String[][] " + c.name.toLowerCase().replaceAll(" ", "_") + " = {\n");<NEW_LINE>ArrayList<City> cities = c.citys;<NEW_LINE>Collections.sort(cities, new Comparator<City>() {<NEW_LINE><NEW_LINE>public int compare(City result1, City result2) {<NEW_LINE>return result1.name.compareTo(result2.name);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>for (int i = 0; i < cities.size(); i++) {<NEW_LINE>City s = cities.get(i);<NEW_LINE>System.out.print("{\"" + s.name + "\", \"" + s.woeid + "\"}" + (i == cities.size() - 1 ? "\n" : ",\n"));<NEW_LINE>}<NEW_LINE>System.out.println("};\n");<NEW_LINE>}<NEW_LINE>}
n = jsonObject.getString("name");
813,844
public void visitContextParam(WebAppContext context, Descriptor descriptor, XmlParser.Node node) {<NEW_LINE>String name = node.getString("param-name", false, true);<NEW_LINE>String value = node.getString("param-value", false, true);<NEW_LINE>Origin origin = context.getMetaData().getOrigin("context-param." + name);<NEW_LINE>switch(origin) {<NEW_LINE>case NotSet:<NEW_LINE>{<NEW_LINE>// just set it<NEW_LINE>context.getInitParams(<MASK><NEW_LINE>context.getMetaData().setOrigin("context-param." + name, descriptor);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case WebXml:<NEW_LINE>case WebDefaults:<NEW_LINE>case WebOverride:<NEW_LINE>{<NEW_LINE>// previously set by a web xml, allow other web xml files to override<NEW_LINE>if (!(descriptor instanceof FragmentDescriptor)) {<NEW_LINE>context.getInitParams().put(name, value);<NEW_LINE>context.getMetaData().setOrigin("context-param." + name, descriptor);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case WebFragment:<NEW_LINE>{<NEW_LINE>// previously set by a web-fragment, this fragment's value must be the same<NEW_LINE>if (descriptor instanceof FragmentDescriptor) {<NEW_LINE>if (!((String) context.getInitParams().get(name)).equals(value))<NEW_LINE>throw new IllegalStateException("Conflicting context-param " + name + "=" + value + " in " + descriptor.getResource());<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>default:<NEW_LINE>unknownOrigin(origin);<NEW_LINE>}<NEW_LINE>if (LOG.isDebugEnabled())<NEW_LINE>LOG.debug("ContextParam: {}={}", name, value);<NEW_LINE>}
).put(name, value);
1,041,987
public boolean onContextItemSelected(MenuItem item) {<NEW_LINE>if (selectedUrl == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>final int itemId = item.getItemId();<NEW_LINE>if (itemId == R.id.open_in_browser_item) {<NEW_LINE>IntentUtils.openInBrowser(getContext(), selectedUrl);<NEW_LINE>} else if (itemId == R.id.share_url_item) {<NEW_LINE>ShareUtils.shareLink(getContext(), selectedUrl);<NEW_LINE>} else if (itemId == R.id.copy_url_item) {<NEW_LINE>ClipData clipData = ClipData.newPlainText(selectedUrl, selectedUrl);<NEW_LINE>ClipboardManager cm = (ClipboardManager) getContext().getSystemService(Context.CLIPBOARD_SERVICE);<NEW_LINE>cm.setPrimaryClip(clipData);<NEW_LINE>Snackbar s = Snackbar.make(this, R.string.copied_url_msg, Snackbar.LENGTH_LONG);<NEW_LINE>ViewCompat.setElevation(s.getView(), 100);<NEW_LINE>s.show();<NEW_LINE>} else if (itemId == R.id.go_to_position_item) {<NEW_LINE>if (Timeline.isTimecodeLink(selectedUrl) && timecodeSelectedListener != null) {<NEW_LINE>timecodeSelectedListener.accept<MASK><NEW_LINE>} else {<NEW_LINE>Log.e(TAG, "Selected go_to_position_item, but URL was no timecode link: " + selectedUrl);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>selectedUrl = null;<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>selectedUrl = null;<NEW_LINE>return true;<NEW_LINE>}
(Timeline.getTimecodeLinkTime(selectedUrl));
1,755,005
public static StepResult fromKarateJson(File workingDir, Scenario scenario, Map<String, Object> map) {<NEW_LINE>Map<String, Object> stepMap = (Map) map.get("step");<NEW_LINE>Step step = Step.fromKarateJson(scenario, stepMap);<NEW_LINE>Result result = Result.fromKarateJson((Map) map.get("result"));<NEW_LINE>StepResult sr = new StepResult(step, result);<NEW_LINE>Boolean hidden = (<MASK><NEW_LINE>if (hidden != null) {<NEW_LINE>sr.setHidden(hidden);<NEW_LINE>}<NEW_LINE>String stepLog = (String) map.get("stepLog");<NEW_LINE>sr.setStepLog(stepLog);<NEW_LINE>List<Map<String, Object>> embedsList = (List) map.get("embeds");<NEW_LINE>if (embedsList != null) {<NEW_LINE>List<Embed> embeds = new ArrayList(embedsList.size());<NEW_LINE>for (Map<String, Object> embedMap : embedsList) {<NEW_LINE>Embed embed = Embed.fromKarateJson(embedMap);<NEW_LINE>embeds.add(embed);<NEW_LINE>}<NEW_LINE>sr.addEmbeds(embeds);<NEW_LINE>}<NEW_LINE>sr.setCallResultsFromKarateJson(workingDir, (List) map.get("callResults"));<NEW_LINE>return sr;<NEW_LINE>}
Boolean) map.get("hidden");
660,712
public NDArrayMessage reassemble(String id) {<NEW_LINE>List<NDArrayMessageChunk> chunkList = chunks.get(id);<NEW_LINE>if (chunkList.size() != chunkList.get(0).getNumChunks())<NEW_LINE>throw new IllegalStateException("Unable to reassemble message chunk " + id + " missing " + (chunkList.get(0).getNumChunks() - chunkList.size()) + "chunks");<NEW_LINE>// ensure the chunks are in contiguous ordering according to their chunk index<NEW_LINE>NDArrayMessageChunk[] inOrder = new NDArrayMessageChunk[chunkList.size()];<NEW_LINE>for (NDArrayMessageChunk chunk : chunkList) {<NEW_LINE>inOrder[<MASK><NEW_LINE>}<NEW_LINE>// reassemble the in order chunks<NEW_LINE>NDArrayMessage message = NDArrayMessage.fromChunks(inOrder);<NEW_LINE>chunkList.clear();<NEW_LINE>chunks.remove(id);<NEW_LINE>return message;<NEW_LINE>}
chunk.getChunkIndex()] = chunk;
976,693
protected Slf4jReporter createInstance() {<NEW_LINE>final Slf4jReporter.Builder reporter = Slf4jReporter.forRegistry(getMetricRegistry());<NEW_LINE>if (hasProperty(DURATION_UNIT)) {<NEW_LINE>reporter.convertDurationsTo(getProperty(DURATION_UNIT, TimeUnit.class));<NEW_LINE>}<NEW_LINE>if (hasProperty(RATE_UNIT)) {<NEW_LINE>reporter.convertRatesTo(getProperty(RATE_UNIT, TimeUnit.class));<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>reporter.prefixedWith(getPrefix());<NEW_LINE>if (hasProperty(MARKER)) {<NEW_LINE>reporter.markWith(MarkerFactory.getMarker(getProperty(MARKER)));<NEW_LINE>}<NEW_LINE>if (hasProperty(LOGGER)) {<NEW_LINE>reporter.outputTo(LoggerFactory.getLogger(getProperty(LOGGER)));<NEW_LINE>}<NEW_LINE>if (hasProperty(LEVEL)) {<NEW_LINE>reporter.withLoggingLevel(getProperty(LEVEL, LoggingLevel.class));<NEW_LINE>}<NEW_LINE>return reporter.build();<NEW_LINE>}
reporter.filter(getMetricFilter());
1,448,951
public static <T, M extends Classifier<T>> ClassificationMetrics of(double fitTime, M model, T[] testx, int[] testy) {<NEW_LINE>int k = MathEx.unique(testy).length;<NEW_LINE>long start = System.nanoTime();<NEW_LINE>if (model.soft()) {<NEW_LINE>double[][] posteriori = new double[testx.length][k];<NEW_LINE>int[] prediction = model.predict(testx, posteriori);<NEW_LINE>double scoreTime = (System.nanoTime() - start) / 1E6;<NEW_LINE>return ClassificationMetrics.of(fitTime, scoreTime, testy, prediction, posteriori);<NEW_LINE>} else {<NEW_LINE>int[] prediction = model.predict(testx);<NEW_LINE>double scoreTime = (System.<MASK><NEW_LINE>return ClassificationMetrics.of(fitTime, scoreTime, testy, prediction);<NEW_LINE>}<NEW_LINE>}
nanoTime() - start) / 1E6;
1,287,581
public static DescribeVsPullStreamInfoConfigResponse unmarshall(DescribeVsPullStreamInfoConfigResponse describeVsPullStreamInfoConfigResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeVsPullStreamInfoConfigResponse.setRequestId(_ctx.stringValue("DescribeVsPullStreamInfoConfigResponse.RequestId"));<NEW_LINE>List<LiveAppRecord> liveAppRecordList = new ArrayList<LiveAppRecord>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeVsPullStreamInfoConfigResponse.LiveAppRecordList.Length"); i++) {<NEW_LINE>LiveAppRecord liveAppRecord = new LiveAppRecord();<NEW_LINE>liveAppRecord.setDomainName(_ctx.stringValue("DescribeVsPullStreamInfoConfigResponse.LiveAppRecordList[" + i + "].DomainName"));<NEW_LINE>liveAppRecord.setAppName(_ctx.stringValue("DescribeVsPullStreamInfoConfigResponse.LiveAppRecordList[" + i + "].AppName"));<NEW_LINE>liveAppRecord.setStreamName(_ctx.stringValue("DescribeVsPullStreamInfoConfigResponse.LiveAppRecordList[" + i + "].StreamName"));<NEW_LINE>liveAppRecord.setSourceUrl(_ctx.stringValue("DescribeVsPullStreamInfoConfigResponse.LiveAppRecordList[" + i + "].SourceUrl"));<NEW_LINE>liveAppRecord.setStartTime(_ctx.stringValue<MASK><NEW_LINE>liveAppRecord.setEndTime(_ctx.stringValue("DescribeVsPullStreamInfoConfigResponse.LiveAppRecordList[" + i + "].EndTime"));<NEW_LINE>liveAppRecordList.add(liveAppRecord);<NEW_LINE>}<NEW_LINE>describeVsPullStreamInfoConfigResponse.setLiveAppRecordList(liveAppRecordList);<NEW_LINE>return describeVsPullStreamInfoConfigResponse;<NEW_LINE>}
("DescribeVsPullStreamInfoConfigResponse.LiveAppRecordList[" + i + "].StartTime"));
584,628
public UserVm destroyVm(DestroyVMCmd cmd) throws ResourceUnavailableException, ConcurrentOperationException {<NEW_LINE><MASK><NEW_LINE>long vmId = cmd.getId();<NEW_LINE>boolean expunge = cmd.getExpunge();<NEW_LINE>// When trying to expunge, permission is denied when the caller is not an admin and the AllowUserExpungeRecoverVm is false for the caller.<NEW_LINE>if (expunge && !_accountMgr.isAdmin(ctx.getCallingAccount().getId()) && !AllowUserExpungeRecoverVm.valueIn(cmd.getEntityOwnerId())) {<NEW_LINE>throw new PermissionDeniedException("Parameter " + ApiConstants.EXPUNGE + " can be passed by Admin only. Or when the allow.user.expunge.recover.vm key is set.");<NEW_LINE>}<NEW_LINE>// check if VM exists<NEW_LINE>UserVmVO vm = _vmDao.findById(vmId);<NEW_LINE>if (vm == null || vm.getRemoved() != null) {<NEW_LINE>throw new InvalidParameterValueException("unable to find a virtual machine with id " + vmId);<NEW_LINE>}<NEW_LINE>if ((vm.getState() == State.Destroyed && !expunge) || vm.getState() == State.Expunging) {<NEW_LINE>s_logger.debug("Vm id=" + vmId + " is already destroyed");<NEW_LINE>return vm;<NEW_LINE>}<NEW_LINE>// check if there are active volume snapshots tasks<NEW_LINE>s_logger.debug("Checking if there are any ongoing snapshots on the ROOT volumes associated with VM with ID " + vmId);<NEW_LINE>if (checkStatusOfVolumeSnapshots(vmId, Volume.Type.ROOT)) {<NEW_LINE>throw new CloudRuntimeException("There is/are unbacked up snapshot(s) on ROOT volume, vm destroy is not permitted, please try again later.");<NEW_LINE>}<NEW_LINE>s_logger.debug("Found no ongoing snapshots on volume of type ROOT, for the vm with id " + vmId);<NEW_LINE>List<VolumeVO> volumesToBeDeleted = getVolumesFromIds(cmd);<NEW_LINE>checkForUnattachedVolumes(vmId, volumesToBeDeleted);<NEW_LINE>validateVolumes(volumesToBeDeleted);<NEW_LINE>final ControlledEntity[] volumesToDelete = volumesToBeDeleted.toArray(new ControlledEntity[0]);<NEW_LINE>_accountMgr.checkAccess(ctx.getCallingAccount(), null, true, volumesToDelete);<NEW_LINE>stopVirtualMachine(vmId, VmDestroyForcestop.value());<NEW_LINE>// Detach all data disks from VM<NEW_LINE>List<VolumeVO> dataVols = _volsDao.findByInstanceAndType(vmId, Volume.Type.DATADISK);<NEW_LINE>detachVolumesFromVm(dataVols);<NEW_LINE>UserVm destroyedVm = destroyVm(vmId, expunge);<NEW_LINE>if (expunge) {<NEW_LINE>if (!expunge(vm, ctx.getCallingUserId(), ctx.getCallingAccount())) {<NEW_LINE>throw new CloudRuntimeException("Failed to expunge vm " + destroyedVm);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>deleteVolumesFromVm(volumesToBeDeleted, expunge);<NEW_LINE>return destroyedVm;<NEW_LINE>}
CallContext ctx = CallContext.current();
1,411,089
private boolean advanceLeft(TSource left, TKey leftKey) {<NEW_LINE>lefts.clear();<NEW_LINE>lefts.add(left);<NEW_LINE>while (getLeftEnumerator().moveNext()) {<NEW_LINE>left = getLeftEnumerator().current();<NEW_LINE>TKey leftKey2 = outerKeySelector.apply(left);<NEW_LINE>if (leftKey2 == null && joinType != JoinType.LEFT) {<NEW_LINE>// mergeJoin assumes inputs sorted in ascending order with nulls last,<NEW_LINE>// if we reach a null key, we are done (except LEFT join, that needs to process LHS fully)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>int c = compare(leftKey, leftKey2);<NEW_LINE>if (c != 0) {<NEW_LINE>if (c > 0) {<NEW_LINE>throw new IllegalStateException("mergeJoin assumes inputs sorted in ascending order, " + "however '" + <MASK><NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>lefts.add(left);<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
leftKey + "' is greater than '" + leftKey2 + "'");
586,524
public static EventReader<Event> createEventReader(byte[] magic, InputStream is) throws IOException {<NEW_LINE>if (Arrays.equals(magic, StackTraceCodec.MAGIC)) {<NEW_LINE><MASK><NEW_LINE>EventReader<Event> reader = new LegacyThreadEventReader(lreader);<NEW_LINE>return reader;<NEW_LINE>}<NEW_LINE>if (Arrays.equals(magic, StackTraceCodec.MAGIC2)) {<NEW_LINE>StackTraceReader lreader = new StackTraceReaderV2(is);<NEW_LINE>EventReader<Event> reader = new LegacyThreadEventReader(lreader);<NEW_LINE>return reader;<NEW_LINE>} else // MAGIC3 is not used<NEW_LINE>if (Arrays.equals(magic, StackTraceCodec.MAGIC4)) {<NEW_LINE>EventReader<Event> reader = new StackTraceEventReaderV4(is).morph(new ThreadSnapshotExpander());<NEW_LINE>return reader;<NEW_LINE>} else {<NEW_LINE>throw new IOException("Unknown magic '" + new String(magic) + "'");<NEW_LINE>}<NEW_LINE>}
StackTraceReader lreader = new StackTraceReaderV1(is);
1,077,150
final GetUserPoolMfaConfigResult executeGetUserPoolMfaConfig(GetUserPoolMfaConfigRequest getUserPoolMfaConfigRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getUserPoolMfaConfigRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetUserPoolMfaConfigRequest> request = null;<NEW_LINE>Response<GetUserPoolMfaConfigResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new GetUserPoolMfaConfigRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getUserPoolMfaConfigRequest));<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, "Cognito Identity Provider");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetUserPoolMfaConfig");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetUserPoolMfaConfigResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetUserPoolMfaConfigResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
1,714,493
public boolean addNonLeafEntry(final int index, final byte[] key, final long leftChild, final long rightChild, final boolean updateNeighbours) {<NEW_LINE>assert !isLeaf();<NEW_LINE>final int entrySize = key.length + 2 * OLongSerializer.LONG_SIZE;<NEW_LINE>int size = size();<NEW_LINE>int freePointer = getIntValue(FREE_POINTER_OFFSET);<NEW_LINE>if (freePointer - entrySize < (size + 1) * OIntegerSerializer.INT_SIZE + POSITIONS_ARRAY_OFFSET)<NEW_LINE>return false;<NEW_LINE>if (index <= size - 1) {<NEW_LINE>moveData(POSITIONS_ARRAY_OFFSET + index * OIntegerSerializer.INT_SIZE, POSITIONS_ARRAY_OFFSET + (index + 1) * OIntegerSerializer.INT_SIZE, (size - index) * OIntegerSerializer.INT_SIZE);<NEW_LINE>}<NEW_LINE>freePointer -= entrySize;<NEW_LINE>setIntValue(FREE_POINTER_OFFSET, freePointer);<NEW_LINE>setIntValue(POSITIONS_ARRAY_OFFSET + index * OIntegerSerializer.INT_SIZE, freePointer);<NEW_LINE>setIntValue(SIZE_OFFSET, size + 1);<NEW_LINE>freePointer += setLongValue(freePointer, leftChild);<NEW_LINE>freePointer += setLongValue(freePointer, rightChild);<NEW_LINE>setBinaryValue(freePointer, key);<NEW_LINE>size++;<NEW_LINE>int prevChild = -1;<NEW_LINE>if (updateNeighbours && size > 1) {<NEW_LINE>if (index < size - 1) {<NEW_LINE>final int nextEntryPosition = getIntValue(POSITIONS_ARRAY_OFFSET + (index + 1) * OIntegerSerializer.INT_SIZE);<NEW_LINE>prevChild <MASK><NEW_LINE>setLongValue(nextEntryPosition, rightChild);<NEW_LINE>}<NEW_LINE>if (index > 0) {<NEW_LINE>final int prevEntryPosition = getIntValue(POSITIONS_ARRAY_OFFSET + (index - 1) * OIntegerSerializer.INT_SIZE);<NEW_LINE>prevChild = (int) getLongValue(prevEntryPosition + OLongSerializer.LONG_SIZE);<NEW_LINE>setLongValue(prevEntryPosition + OLongSerializer.LONG_SIZE, leftChild);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>addPageOperation(new SBTreeBucketV2AddNonLeafEntryPO(index, key, updateNeighbours, (int) leftChild, (int) rightChild, prevChild));<NEW_LINE>return true;<NEW_LINE>}
= (int) getLongValue(nextEntryPosition);
724,663
private void saveTrackInfo() {<NEW_LINE>GPXFile gpxFile = selectedGpxFile.getGpxFile();<NEW_LINE>if (gpxFile.showCurrentTrack) {<NEW_LINE>settings.CURRENT_TRACK_COLOR.set(trackDrawInfo.getColor());<NEW_LINE>settings.CURRENT_TRACK_COLORING_TYPE.set(trackDrawInfo.getColoringType());<NEW_LINE>settings.CURRENT_TRACK_ROUTE_INFO_ATTRIBUTE.set(trackDrawInfo.getRouteInfoAttribute());<NEW_LINE>settings.CURRENT_TRACK_WIDTH.set(trackDrawInfo.getWidth());<NEW_LINE>settings.CURRENT_TRACK_SHOW_ARROWS.set(trackDrawInfo.isShowArrows());<NEW_LINE>settings.CURRENT_TRACK_SHOW_START_FINISH.set(trackDrawInfo.isShowStartFinish());<NEW_LINE>} else if (gpxDataItem != null) {<NEW_LINE>GpxSplitType splitType = GpxSplitType.getSplitTypeByTypeId(trackDrawInfo.getSplitType());<NEW_LINE>gpxDbHelper.updateColor(gpxDataItem, trackDrawInfo.getColor());<NEW_LINE>gpxDbHelper.updateWidth(gpxDataItem, trackDrawInfo.getWidth());<NEW_LINE>gpxDbHelper.updateShowArrows(<MASK><NEW_LINE>// gpxDbHelper.updateShowStartFinish(gpxDataItem, trackDrawInfo.isShowStartFinish());<NEW_LINE>gpxDbHelper.updateSplit(gpxDataItem, splitType, trackDrawInfo.getSplitInterval());<NEW_LINE>ColoringType coloringType = trackDrawInfo.getColoringType();<NEW_LINE>String routeInfoAttribute = trackDrawInfo.getRouteInfoAttribute();<NEW_LINE>gpxDbHelper.updateColoringType(gpxDataItem, coloringType.getName(routeInfoAttribute));<NEW_LINE>}<NEW_LINE>}
gpxDataItem, trackDrawInfo.isShowArrows());
1,102,992
public void reset() {<NEW_LINE>if (this.root != this) {<NEW_LINE>this.root.reset();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>this.knownModules = new HashtableOfModule();<NEW_LINE>this.UnNamedModule = new ModuleBinding.UnNamedModule(this);<NEW_LINE>this.module = this.UnNamedModule;<NEW_LINE>this.JavaBaseModule = null;<NEW_LINE>// assume the default package always exists<NEW_LINE>this.defaultPackage = new PackageBinding(this);<NEW_LINE>this.defaultImports = null;<NEW_LINE>this.knownPackages = new HashtableOfPackage();<NEW_LINE>this.accessRestrictions = new HashMap(3);<NEW_LINE>this.verifier = null;<NEW_LINE>// NOTE: remember to fix #updateCaches(...) when adding unique binding caches<NEW_LINE>this.uniqueParameterizedGenericMethodBindings = new SimpleLookupTable(3);<NEW_LINE>this.uniquePolymorphicMethodBindings = new SimpleLookupTable(3);<NEW_LINE>this.uniqueGetClassMethodBinding = null;<NEW_LINE>this.missingTypes = null;<NEW_LINE><MASK><NEW_LINE>for (int i = this.units.length; --i >= 0; ) this.units[i] = null;<NEW_LINE>this.lastUnitIndex = -1;<NEW_LINE>this.lastCompletedUnitIndex = -1;<NEW_LINE>// in case AbortException occurred<NEW_LINE>this.unitBeingCompleted = null;<NEW_LINE>this.classFilePool.reset();<NEW_LINE>this.typeSystem.reset();<NEW_LINE>// name environment has a longer life cycle, and must be reset in<NEW_LINE>// the code which created it.<NEW_LINE>}
this.typesBeingConnected = new HashSet();
139,517
public void scrollSmoothTo(int x, int y) {<NEW_LINE>// Ensure newHOffset and newVOffset are within the appropriate ranges<NEW_LINE>x = verifyScrollBarOffset(getViewport().getHorizontalRangeModel(), x);<NEW_LINE>y = verifyScrollBarOffset(getViewport().getVerticalRangeModel(), y);<NEW_LINE>int oldX = getViewport().getViewLocation().x;<NEW_LINE>int oldY = getViewport().getViewLocation().y;<NEW_LINE>int dx = x - oldX;<NEW_LINE>int dy = y - oldY;<NEW_LINE>if (dx == 0 && dy == 0)<NEW_LINE>// Nothing to do.<NEW_LINE>return;<NEW_LINE>Dimension viewingArea = getViewport().getClientArea().getSize();<NEW_LINE>int minFrames = 3;<NEW_LINE>int maxFrames = 6;<NEW_LINE>if (dx == 0 || dy == 0) {<NEW_LINE>minFrames = 6;<NEW_LINE>maxFrames = 13;<NEW_LINE>}<NEW_LINE>int frames = (Math.abs(dx) + Math.abs(dy)) / 15;<NEW_LINE>frames = Math.max(frames, minFrames);<NEW_LINE>frames = Math.min(frames, maxFrames);<NEW_LINE>int stepX = Math.min((dx / frames), (viewingArea.width / 3));<NEW_LINE>int stepY = Math.min((dy / frames), <MASK><NEW_LINE>for (int i = 1; i < frames; i++) {<NEW_LINE>scrollTo(oldX + i * stepX, oldY + i * stepY);<NEW_LINE>getViewport().getUpdateManager().performUpdate();<NEW_LINE>}<NEW_LINE>scrollTo(x, y);<NEW_LINE>}
(viewingArea.height / 3));
619,066
private void buildSpecFromRow(Elements row, List<Spec> specs) {<NEW_LINE>Set<Column> available = new HashSet<>();<NEW_LINE>Collections.<MASK><NEW_LINE>for (int ii = 0; ii < row.size(); ii++) {<NEW_LINE>Element element = row.get(ii);<NEW_LINE>if (// $NON-NLS-1$<NEW_LINE>element.hasAttr("colspan")) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>int colspan = Integer.valueOf(element.attr("colspan"));<NEW_LINE>// remove attribute<NEW_LINE>// $NON-NLS-1$<NEW_LINE>element.removeAttr("colspan");<NEW_LINE>// add copies of this column to the header to align header with<NEW_LINE>// columns in table<NEW_LINE>for (int c = 1; c < colspan; c++) {<NEW_LINE>row.add(ii, element);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (Column column : available) {<NEW_LINE>if (column.matches(element)) {<NEW_LINE>specs.add(new Spec(column, ii));<NEW_LINE>available.remove(column);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
addAll(available, getColumns());
871,418
public Object translateQueryParametersIntoServerArgument(RequestDetails theRequest, BaseMethodBinding<?> theMethodBinding) throws InternalErrorException, InvalidRequestException {<NEW_LINE>String ctValue = defaultString(theRequest.getHeader(Constants.HEADER_CONTENT_TYPE));<NEW_LINE>Reader requestReader = createRequestReader(theRequest);<NEW_LINE>// Trim off "; charset=FOO" from the content-type header<NEW_LINE>int semicolonIdx = ctValue.indexOf(';');<NEW_LINE>if (semicolonIdx != -1) {<NEW_LINE>ctValue = ctValue.substring(0, semicolonIdx);<NEW_LINE>}<NEW_LINE>ctValue = trim(ctValue);<NEW_LINE>if (CT_JSON.equals(ctValue)) {<NEW_LINE>try {<NEW_LINE>ObjectMapper mapper = new ObjectMapper();<NEW_LINE>JsonNode <MASK><NEW_LINE>if (jsonNode != null && jsonNode.get("query") != null) {<NEW_LINE>return jsonNode.get("query").asText();<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new InternalErrorException(Msg.code(356) + e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (CT_GRAPHQL.equals(ctValue)) {<NEW_LINE>try {<NEW_LINE>return IOUtils.toString(requestReader);<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new InternalErrorException(Msg.code(357) + e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
jsonNode = mapper.readTree(requestReader);
1,800,569
public Serializer createSerializer() {<NEW_LINE>return new StreamSerializer<DeferredMap>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public int getTypeId() {<NEW_LINE>return SerializerHookConstants.DEFERRED_MAP;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void write(ObjectDataOutput out, DeferredMap deferredMap) throws IOException {<NEW_LINE>out.writeInt(deferredMap.size());<NEW_LINE>for (Map.Entry<String, Object> entry : deferredMap.entrySet()) {<NEW_LINE>out.writeUTF(entry.getKey());<NEW_LINE>out.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public DeferredMap read(ObjectDataInput in) throws IOException {<NEW_LINE>int size = in.readInt();<NEW_LINE>DeferredMap deferredMap = new DeferredMap(false, size);<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>deferredMap.put(in.readUTF(), in.readObject());<NEW_LINE>}<NEW_LINE>return deferredMap;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
writeObject(entry.getValue());
852,853
final ResumeWorkflowRunResult executeResumeWorkflowRun(ResumeWorkflowRunRequest resumeWorkflowRunRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(resumeWorkflowRunRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ResumeWorkflowRunRequest> request = null;<NEW_LINE>Response<ResumeWorkflowRunResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ResumeWorkflowRunRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(resumeWorkflowRunRequest));<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, "Glue");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ResumeWorkflowRun");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ResumeWorkflowRunResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ResumeWorkflowRunResultJsonUnmarshaller());<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);
1,117,186
public static DescribeLoadBalancerSpecResponse unmarshall(DescribeLoadBalancerSpecResponse describeLoadBalancerSpecResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeLoadBalancerSpecResponse.setRequestId(_ctx.stringValue("DescribeLoadBalancerSpecResponse.RequestId"));<NEW_LINE>describeLoadBalancerSpecResponse.setPageNumber(_ctx.integerValue("DescribeLoadBalancerSpecResponse.PageNumber"));<NEW_LINE>describeLoadBalancerSpecResponse.setPageSize(_ctx.integerValue("DescribeLoadBalancerSpecResponse.PageSize"));<NEW_LINE>describeLoadBalancerSpecResponse.setTotalCount<MASK><NEW_LINE>List<LoadBalancerSpecsItem> loadBalancerSpecs = new ArrayList<LoadBalancerSpecsItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeLoadBalancerSpecResponse.LoadBalancerSpecs.Length"); i++) {<NEW_LINE>LoadBalancerSpecsItem loadBalancerSpecsItem = new LoadBalancerSpecsItem();<NEW_LINE>loadBalancerSpecsItem.setDisplayName(_ctx.stringValue("DescribeLoadBalancerSpecResponse.LoadBalancerSpecs[" + i + "].DisplayName"));<NEW_LINE>loadBalancerSpecsItem.setLoadBalancerSpec(_ctx.stringValue("DescribeLoadBalancerSpecResponse.LoadBalancerSpecs[" + i + "].LoadBalancerSpec"));<NEW_LINE>loadBalancerSpecs.add(loadBalancerSpecsItem);<NEW_LINE>}<NEW_LINE>describeLoadBalancerSpecResponse.setLoadBalancerSpecs(loadBalancerSpecs);<NEW_LINE>return describeLoadBalancerSpecResponse;<NEW_LINE>}
(_ctx.integerValue("DescribeLoadBalancerSpecResponse.TotalCount"));
1,288,845
protected void onCreate(final Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>setContentView(R.layout.split_street_view_panorama_and_map_demo);<NEW_LINE>final LatLng markerPosition;<NEW_LINE>if (savedInstanceState == null) {<NEW_LINE>markerPosition = SYDNEY;<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>SupportStreetViewPanoramaFragment streetViewPanoramaFragment = (SupportStreetViewPanoramaFragment) getSupportFragmentManager().findFragmentById(R.id.streetviewpanorama);<NEW_LINE>streetViewPanoramaFragment.getStreetViewPanoramaAsync(new OnStreetViewPanoramaReadyCallback() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onStreetViewPanoramaReady(StreetViewPanorama panorama) {<NEW_LINE>streetViewPanorama = panorama;<NEW_LINE>streetViewPanorama.setOnStreetViewPanoramaChangeListener(SplitStreetViewPanoramaAndMapDemoActivity.this);<NEW_LINE>// Only need to set the position once as the streetview fragment will maintain<NEW_LINE>// its state.<NEW_LINE>if (savedInstanceState == null) {<NEW_LINE>streetViewPanorama.setPosition(SYDNEY);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map);<NEW_LINE>mapFragment.getMapAsync(new OnMapReadyCallback() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onMapReady(GoogleMap map) {<NEW_LINE>map.setOnMarkerDragListener(SplitStreetViewPanoramaAndMapDemoActivity.this);<NEW_LINE>// Creates a draggable marker. Long press to drag.<NEW_LINE>marker = map.addMarker(new MarkerOptions().position(markerPosition).icon(BitmapDescriptorFactory.fromResource(R.drawable.pegman)).draggable(true));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
markerPosition = savedInstanceState.getParcelable(MARKER_POSITION_KEY);
1,199,771
private void drawUpdates(Graphics2D g2) {<NEW_LINE>if (updateCount != 0) {<NEW_LINE><MASK><NEW_LINE>final int GAP = Toolkit.zoom(5);<NEW_LINE>final String updateLabel = "Updates";<NEW_LINE>String updatesStr = "" + updateCount;<NEW_LINE>double countWidth = font.getStringBounds(updatesStr, frc).getWidth();<NEW_LINE>if (fontAscent > countWidth) {<NEW_LINE>countWidth = fontAscent;<NEW_LINE>}<NEW_LINE>float diameter = (float) (countWidth * 1.65f);<NEW_LINE>float ex = getWidth() - Editor.RIGHT_GUTTER - diameter;<NEW_LINE>float ey = (getHeight() - diameter) / 2;<NEW_LINE>g2.setColor(updateColor);<NEW_LINE>g2.fill(new Ellipse2D.Float(ex, ey, diameter, diameter));<NEW_LINE>g2.setColor(textColor[SELECTED]);<NEW_LINE>int baseline = (getHeight() + fontAscent) / 2;<NEW_LINE>g2.drawString(updatesStr, (int) (ex + (diameter - countWidth) / 2), baseline);<NEW_LINE>double updatesWidth = font.getStringBounds(updateLabel, frc).getWidth();<NEW_LINE>g2.setColor(textColor[UNSELECTED]);<NEW_LINE>updateLeft = (int) (ex - updatesWidth - GAP);<NEW_LINE>g2.drawString(updateLabel, updateLeft, baseline);<NEW_LINE>}<NEW_LINE>}
FontRenderContext frc = g2.getFontRenderContext();
654,846
ActionResult<List<Wo>> execute(EffectivePerson effectivePerson) throws Exception {<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>ActionResult<List<Wo>> result = new ActionResult<>();<NEW_LINE>CacheKey cacheKey = new CacheKey(this.getClass());<NEW_LINE>Optional<?> optional = CacheManager.get(cacheCategory, cacheKey);<NEW_LINE>if (optional.isPresent()) {<NEW_LINE>result.setData((List<Wo>) optional.get());<NEW_LINE>} else {<NEW_LINE>final List<Wo> wos = new ArrayList<>();<NEW_LINE>List<Component> os = emc.listAll(Component.class);<NEW_LINE>os.stream().filter(o -> ListTools.contains(Components.SYSTEM_NAME_NAMES, o.getName())).sorted(Comparator.comparing(Component::getOrderNumber, Comparator.nullsLast(Integer::compareTo)).thenComparing(Component::getCreateTime, Comparator.nullsLast(Date::compareTo))).forEach(o -> {<NEW_LINE>try {<NEW_LINE>wos.add(Wo.copier.copy(o));<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.error(e);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>os.stream().filter(o -> !ListTools.contains(Components.SYSTEM_NAME_NAMES, o.getName())).sorted(Comparator.comparing(Component::getOrderNumber, Comparator.nullsLast(Integer::compareTo)).thenComparing(Component::getCreateTime, Comparator.nullsLast(Date::compareTo))).forEach(o -> {<NEW_LINE>try {<NEW_LINE>wos.add(Wo<MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.error(e);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>CacheManager.put(cacheCategory, cacheKey, wos);<NEW_LINE>result.setData(wos);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>}
.copier.copy(o));
449,537
protected void collectVisibleButtons(@NotNull final WebDockablePane dockablePane, @NotNull final DockableElement element, @NotNull final List<SidebarButton> buttons) {<NEW_LINE>if (element instanceof DockableFrameElement) {<NEW_LINE>// Frame might not yet be added to the pane so we have to be careful here<NEW_LINE>final WebDockableFrame frame = dockablePane.<MASK><NEW_LINE>if (frame != null) {<NEW_LINE>if (frame.isSidebarButtonVisible()) {<NEW_LINE>buttons.add(frame.getSidebarButton());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (element instanceof DockableContainer) {<NEW_LINE>final DockableContainer container = (DockableContainer) element;<NEW_LINE>for (int i = 0; i < container.getElementCount(); i++) {<NEW_LINE>collectVisibleButtons(dockablePane, container.get(i), buttons);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
findFrame(element.getId());
833,193
public void onBindViewHolderCursor(BudgetViewHolder holder, Cursor cursor) {<NEW_LINE>final Budget budget = mBudgetsDbAdapter.buildModelInstance(cursor);<NEW_LINE>holder.budgetId = mBudgetsDbAdapter.getID(budget.getUID());<NEW_LINE>holder.budgetName.<MASK><NEW_LINE>AccountsDbAdapter accountsDbAdapter = AccountsDbAdapter.getInstance();<NEW_LINE>String accountString;<NEW_LINE>int numberOfAccounts = budget.getNumberOfAccounts();<NEW_LINE>if (numberOfAccounts == 1) {<NEW_LINE>accountString = accountsDbAdapter.getAccountFullName(budget.getBudgetAmounts().get(0).getAccountUID());<NEW_LINE>} else {<NEW_LINE>accountString = numberOfAccounts + " budgeted accounts";<NEW_LINE>}<NEW_LINE>holder.accountName.setText(accountString);<NEW_LINE>holder.budgetRecurrence.setText(budget.getRecurrence().getRepeatString() + " - " + budget.getRecurrence().getDaysLeftInCurrentPeriod() + " days left");<NEW_LINE>BigDecimal spentAmountValue = BigDecimal.ZERO;<NEW_LINE>for (BudgetAmount budgetAmount : budget.getCompactedBudgetAmounts()) {<NEW_LINE>Money balance = accountsDbAdapter.getAccountBalance(budgetAmount.getAccountUID(), budget.getStartofCurrentPeriod(), budget.getEndOfCurrentPeriod());<NEW_LINE>spentAmountValue = spentAmountValue.add(balance.asBigDecimal());<NEW_LINE>}<NEW_LINE>Money budgetTotal = budget.getAmountSum();<NEW_LINE>Commodity commodity = budgetTotal.getCommodity();<NEW_LINE>String usedAmount = commodity.getSymbol() + spentAmountValue + " of " + budgetTotal.formattedString();<NEW_LINE>holder.budgetAmount.setText(usedAmount);<NEW_LINE>double budgetProgress = spentAmountValue.divide(budgetTotal.asBigDecimal(), commodity.getSmallestFractionDigits(), RoundingMode.HALF_EVEN).doubleValue();<NEW_LINE>holder.budgetIndicator.setProgress((int) (budgetProgress * 100));<NEW_LINE>holder.budgetAmount.setTextColor(BudgetsActivity.getBudgetProgressColor(1 - budgetProgress));<NEW_LINE>holder.itemView.setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>onClickBudget(budget.getUID());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
setText(budget.getName());
1,044,657
public void run(WorkingCopy copy) throws IOException {<NEW_LINE>copy.toPhase(JavaSource.Phase.RESOLVED);<NEW_LINE>javax.lang.model.element.Modifier[] modifiers = JavaUtil.PROTECTED;<NEW_LINE>String type = Constants.VOID;<NEW_LINE>// NOI18N<NEW_LINE>String comment = "\n";<NEW_LINE>for (String param : parameters) {<NEW_LINE>// NOI18N<NEW_LINE>comment += "@param $PARAM$ resource URI parameter\n".replace("$PARAM$", param);<NEW_LINE>}<NEW_LINE>// NOI18N<NEW_LINE>comment += "@return an instance of " + type;<NEW_LINE>ClassTree <MASK><NEW_LINE>ClassTree tree = // NOI18N<NEW_LINE>JavaSourceHelper.// NOI18N<NEW_LINE>addMethod(// NOI18N<NEW_LINE>copy, // NOI18N<NEW_LINE>initial, // NOI18N<NEW_LINE>modifiers, // NOI18N<NEW_LINE>null, // NOI18N<NEW_LINE>null, // NOI18N<NEW_LINE>methodName, // NOI18N<NEW_LINE>type, // NOI18N<NEW_LINE>parameters, // NOI18N<NEW_LINE>paramTypes, // NOI18N<NEW_LINE>null, // NOI18N<NEW_LINE>null, // NOI18N<NEW_LINE>new String[] { "javax.servlet.ServletException", "java.io.IOException" }, // NOI18N<NEW_LINE>bodyText, comment);<NEW_LINE>copy.rewrite(initial, tree);<NEW_LINE>}
initial = JavaSourceHelper.getTopLevelClassTree(copy);
268,609
public void close() throws IOException {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINE)) {<NEW_LINE>// 306998.15<NEW_LINE>logger.entering(CLASS_NAME, "close", "total=" + total + ",limit=" + limit);<NEW_LINE>}<NEW_LINE>// begin 280584.3 6021: Cleanup of defect 280584.2 WAS.webcontainer<NEW_LINE>// finish();<NEW_LINE>// in.close();<NEW_LINE>try {<NEW_LINE>finish();<NEW_LINE>} finally {<NEW_LINE>in.close();<NEW_LINE>// F003449 Start<NEW_LINE>if (obs != null) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINE)) {<NEW_LINE>// 306998.15<NEW_LINE>logger.logp(Level.<MASK><NEW_LINE>}<NEW_LINE>obs.alertClose();<NEW_LINE>// ensure future reads return -1 until restart() is called.<NEW_LINE>// requried for multi read of post data when<NEW_LINE>// SRTServletResponse.isSkipInputStreamRead() returns true<NEW_LINE>// ssee finish().<NEW_LINE>total = limit;<NEW_LINE>}<NEW_LINE>// F003449 End<NEW_LINE>}<NEW_LINE>// end 280584.3 6021: Cleanup of defect 280584.2 WAS.webcontainer<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINE)) {<NEW_LINE>// 306998.15<NEW_LINE>logger.exiting(CLASS_NAME, "close", "total=" + total + ",limit=" + limit);<NEW_LINE>}<NEW_LINE>}
FINE, CLASS_NAME, "close", "Notify observer that input stream has been closed.");
185,396
final DeleteUserPoolClientResult executeDeleteUserPoolClient(DeleteUserPoolClientRequest deleteUserPoolClientRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteUserPoolClientRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteUserPoolClientRequest> request = null;<NEW_LINE>Response<DeleteUserPoolClientResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteUserPoolClientRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteUserPoolClientRequest));<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, "Cognito Identity Provider");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteUserPoolClient");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteUserPoolClientResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteUserPoolClientResultJsonUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
invoke(request, responseHandler, executionContext);
636,634
public void captureRef(int tag, ReadableMap options, Promise promise) {<NEW_LINE>final ReactApplicationContext context = getReactApplicationContext();<NEW_LINE>final DisplayMetrics dm = context.getResources().getDisplayMetrics();<NEW_LINE>final String extension = options.getString("format");<NEW_LINE>final int imageFormat = "jpg".equals(extension) ? Formats.JPEG : "webm".equals(extension) ? Formats.WEBP : "raw".equals(extension) ? Formats.RAW : Formats.PNG;<NEW_LINE>final double quality = options.getDouble("quality");<NEW_LINE>final Integer scaleWidth = options.hasKey("width") ? (int) (dm.density * options.getDouble("width")) : null;<NEW_LINE>final Integer scaleHeight = options.hasKey("height") ? (int) (dm.density * options.getDouble("height")) : null;<NEW_LINE>final String resultStreamFormat = options.getString("result");<NEW_LINE>final Boolean snapshotContentContainer = options.getBoolean("snapshotContentContainer");<NEW_LINE>try {<NEW_LINE>File outputFile = null;<NEW_LINE>if (Results.TEMP_FILE.equals(resultStreamFormat)) {<NEW_LINE>outputFile = createTempFile(mScopedContext, extension);<NEW_LINE>}<NEW_LINE>final Activity activity = getCurrentActivity();<NEW_LINE>final UIManagerModule uiManager = this.<MASK><NEW_LINE>uiManager.addUIBlock(new ViewShot(tag, extension, imageFormat, quality, scaleWidth, scaleHeight, outputFile, resultStreamFormat, snapshotContentContainer, reactContext, activity, promise));<NEW_LINE>} catch (final Throwable ex) {<NEW_LINE>Log.e(RNVIEW_SHOT, "Failed to snapshot view tag " + tag, ex);<NEW_LINE>promise.reject(ViewShot.ERROR_UNABLE_TO_SNAPSHOT, "Failed to snapshot view tag " + tag);<NEW_LINE>}<NEW_LINE>}
reactContext.getNativeModule(UIManagerModule.class);
1,404,050
private void sortSelectedMarkersDoorToDoor(final MapActivity mapActivity, final boolean startFromLoc, final Location myLoc) {<NEW_LINE>new AsyncTask<Void, Void, List<MapMarker>>() {<NEW_LINE><NEW_LINE>private ProgressDialog dialog;<NEW_LINE><NEW_LINE>private long startDialogTime;<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void onPreExecute() {<NEW_LINE>startDialogTime = System.currentTimeMillis();<NEW_LINE>dialog = new ProgressDialog(mapActivity);<NEW_LINE>dialog.setTitle("");<NEW_LINE>dialog.setMessage(mapActivity.getString(R.string.intermediate_items_sort_by_distance));<NEW_LINE>dialog.setCancelable(false);<NEW_LINE>dialog.show();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected List<MapMarker> doInBackground(Void... voids) {<NEW_LINE>MapMarkersHelper markersHelper = mapActivity.getMyApplication().getMapMarkersHelper();<NEW_LINE>List<MapMarker> selectedMarkers = markersHelper.getSelectedMarkers();<NEW_LINE>List<LatLon> selectedLatLon = markersHelper.getSelectedMarkersLatLon();<NEW_LINE>LatLon start = startFromLoc ? new LatLon(myLoc.getLatitude(), myLoc.getLongitude()) : selectedLatLon.remove(0);<NEW_LINE>int[] sequence = new TspAnt().readGraph(selectedLatLon, <MASK><NEW_LINE>List<MapMarker> res = new ArrayList<>();<NEW_LINE>for (int i = 0; i < sequence.length; i++) {<NEW_LINE>if (i == 0 && startFromLoc) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>int index = sequence[i];<NEW_LINE>res.add(selectedMarkers.get(startFromLoc ? index - 1 : index));<NEW_LINE>}<NEW_LINE>return res;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void onPostExecute(List<MapMarker> res) {<NEW_LINE>if (dialog != null) {<NEW_LINE>long t = System.currentTimeMillis();<NEW_LINE>if (t - startDialogTime < 500) {<NEW_LINE>mapActivity.getMyApplication().runInUIThread(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>dialog.dismiss();<NEW_LINE>}<NEW_LINE>}, 500 - (t - startDialogTime));<NEW_LINE>} else {<NEW_LINE>dialog.dismiss();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>mapActivity.getMyApplication().getMapMarkersHelper().addSelectedMarkersToTop(res);<NEW_LINE>adapter.reloadData();<NEW_LINE>adapter.notifyDataSetChanged();<NEW_LINE>planRouteContext.recreateSnapTrkSegment(false);<NEW_LINE>}<NEW_LINE>}.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);<NEW_LINE>}
start, null).solve();
921,769
final DescribeEndpointResult executeDescribeEndpoint(DescribeEndpointRequest describeEndpointRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeEndpointRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeEndpointRequest> request = null;<NEW_LINE>Response<DescribeEndpointResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeEndpointRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeEndpointRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "SageMaker");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeEndpointResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeEndpointResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeEndpoint");
680,401
public StreamEvent find(StateEvent matchingEvent, IndexedEventHolder indexedEventHolder, StreamEventCloner storeEventCloner) {<NEW_LINE>Collection<StreamEvent> notStreamEvents = notCollectionExecutor.findEvents(matchingEvent, indexedEventHolder);<NEW_LINE>if (notStreamEvents == null) {<NEW_LINE>return exhaustiveCollectionExecutor.find(matchingEvent, indexedEventHolder, storeEventCloner);<NEW_LINE>} else if (notStreamEvents.size() == 0) {<NEW_LINE>ComplexEventChunk<StreamEvent> returnEventChunk = new ComplexEventChunk<StreamEvent>();<NEW_LINE>Collection<StreamEvent> storeEventSet = indexedEventHolder.getAllEvents();<NEW_LINE>for (StreamEvent storeEvent : storeEventSet) {<NEW_LINE>if (storeEventCloner != null) {<NEW_LINE>returnEventChunk.add(storeEventCloner.copyStreamEvent(storeEvent));<NEW_LINE>} else {<NEW_LINE>returnEventChunk.add(storeEvent);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return returnEventChunk.getFirst();<NEW_LINE>} else {<NEW_LINE>Collection<StreamEvent<MASK><NEW_LINE>ComplexEventChunk<StreamEvent> returnEventChunk = new ComplexEventChunk<StreamEvent>();<NEW_LINE>for (StreamEvent aEvent : allEvents) {<NEW_LINE>if (!notStreamEvents.contains(aEvent)) {<NEW_LINE>if (storeEventCloner != null) {<NEW_LINE>returnEventChunk.add(storeEventCloner.copyStreamEvent(aEvent));<NEW_LINE>} else {<NEW_LINE>returnEventChunk.add(aEvent);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return returnEventChunk.getFirst();<NEW_LINE>}<NEW_LINE>}
> allEvents = indexedEventHolder.getAllEvents();
1,130,723
public Request<ListGroupsForUserRequest> marshall(ListGroupsForUserRequest listGroupsForUserRequest) {<NEW_LINE>if (listGroupsForUserRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>Request<ListGroupsForUserRequest> request = new DefaultRequest<ListGroupsForUserRequest>(listGroupsForUserRequest, "AmazonIdentityManagement");<NEW_LINE>request.addParameter("Action", "ListGroupsForUser");<NEW_LINE>request.addParameter("Version", "2010-05-08");<NEW_LINE><MASK><NEW_LINE>if (listGroupsForUserRequest.getUserName() != null) {<NEW_LINE>request.addParameter("UserName", StringUtils.fromString(listGroupsForUserRequest.getUserName()));<NEW_LINE>}<NEW_LINE>if (listGroupsForUserRequest.getMarker() != null) {<NEW_LINE>request.addParameter("Marker", StringUtils.fromString(listGroupsForUserRequest.getMarker()));<NEW_LINE>}<NEW_LINE>if (listGroupsForUserRequest.getMaxItems() != null) {<NEW_LINE>request.addParameter("MaxItems", StringUtils.fromInteger(listGroupsForUserRequest.getMaxItems()));<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>}
request.setHttpMethod(HttpMethodName.POST);
67,318
private void initViews(View view) {<NEW_LINE>mMore = getToolbarController().getToolbar().findViewById(R.id.more);<NEW_LINE>mMore.setOnClickListener(this);<NEW_LINE>View editsBlock = view.findViewById(R.id.block_edits);<NEW_LINE>UiUtils.show(editsBlock);<NEW_LINE>mSentBlock = editsBlock.findViewById(R.id.sent_edits);<NEW_LINE>mEditsSent = (TextView) mSentBlock.<MASK><NEW_LINE>mEditsSentDate = (TextView) mSentBlock.findViewById(R.id.date_sent);<NEW_LINE>mAuthBlock = view.findViewById(R.id.block_auth);<NEW_LINE>mRatingBlock = view.findViewById(R.id.block_rating);<NEW_LINE>mEditorRank = (TextView) mRatingBlock.findViewById(R.id.rating);<NEW_LINE>// FIXME show when it will be implemented on server<NEW_LINE>// mEditorLevelUp = mRatingBlock.findViewById(R.id.level_up_feat);<NEW_LINE>view.findViewById(R.id.about_osm).setOnClickListener(this);<NEW_LINE>}
findViewById(R.id.edits_count);
1,327,564
protected void run(URL url, Map<String, String> headers) {<NEW_LINE>this.listener = new WatcherWebSocketListener<>(this);<NEW_LINE>Builder builder = client.newWebSocketBuilder();<NEW_LINE>headers.forEach(builder::header);<NEW_LINE>builder.uri(URI.create(url.toString()));<NEW_LINE>this.websocketFuture = builder.buildAsync(this.listener).handle((w, t) -> {<NEW_LINE>if (t != null) {<NEW_LINE>if (t instanceof WebSocketHandshakeException) {<NEW_LINE>WebSocketHandshakeException wshe = (WebSocketHandshakeException) t;<NEW_LINE>HttpResponse<?<MASK><NEW_LINE>final int code = response.code();<NEW_LINE>// We do not expect a 200 in response to the websocket connection. If it occurs, we throw<NEW_LINE>// an exception and try the watch via a persistent HTTP Get.<NEW_LINE>// Newer Kubernetes might also return 503 Service Unavailable in case WebSockets are not supported<NEW_LINE>Status status = OperationSupport.createStatus(response);<NEW_LINE>if (HTTP_OK == code || HTTP_UNAVAILABLE == code) {<NEW_LINE>throw OperationSupport.requestFailure(client.newHttpRequestBuilder().url(url).build(), status, "Received " + code + " on websocket");<NEW_LINE>}<NEW_LINE>logger.warn("Exec Failure: HTTP {}, Status: {} - {}", code, status.getCode(), status.getMessage());<NEW_LINE>t = OperationSupport.requestFailure(client.newHttpRequestBuilder().url(url).build(), status);<NEW_LINE>}<NEW_LINE>if (ready) {<NEW_LINE>// if we're not ready yet, that means we're waiting on the future and there's<NEW_LINE>// no need to invoke the reconnect logic<NEW_LINE>listener.onError(w, t);<NEW_LINE>}<NEW_LINE>throw KubernetesClientException.launderThrowable(t);<NEW_LINE>}<NEW_LINE>if (w != null) {<NEW_LINE>this.ready = true;<NEW_LINE>this.websocket = w;<NEW_LINE>}<NEW_LINE>return w;<NEW_LINE>});<NEW_LINE>}
> response = wshe.getResponse();
1,639,459
private static void emitSummaryTableHeader(PrintStream out) {<NEW_LINE>// First row<NEW_LINE>out.print("<tr class=\"bg-color\">");<NEW_LINE>out.print("<th colspan=1 class=\"header-text\"><b>Span Name</b></th>");<NEW_LINE>out.print("<th colspan=1 class=\"header-text border-left-white\"><b>Running</b></th>");<NEW_LINE>out.print("<th colspan=9 class=\"header-text border-left-white\"><b>Latency Samples</b></th>");<NEW_LINE>out.print("<th colspan=1 class=\"header-text border-left-white\"><b>Error Samples</b></th>");<NEW_LINE>out.print("</tr>");<NEW_LINE>// Second row<NEW_LINE>out.print("<tr class=\"bg-color\">");<NEW_LINE>out.print("<th colspan=1></th>");<NEW_LINE>out.print("<th colspan=1 class=\"border-left-white\"></th>");<NEW_LINE>for (LatencyBoundary latencyBoundary : LatencyBoundary.values()) {<NEW_LINE>out.print("<th colspan=1 class=\"border-left-white align-center\"" + "style=\"color: #fff;\"><b>[" + LATENCY_BOUNDARIES_STRING_MAP<MASK><NEW_LINE>}<NEW_LINE>out.print("<th colspan=1 class=\"border-left-white\"></th>");<NEW_LINE>out.print("</tr>");<NEW_LINE>}
.get(latencyBoundary) + "]</b></th>");
91,780
public boolean range(PartitionField from, PartitionField to, boolean lowerBoundIncluded, boolean upperBoundIncluded) {<NEW_LINE>if (!checkBound(from, to)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>this.lowerBoundIncluded = lowerBoundIncluded;<NEW_LINE>this.upperBoundIncluded = upperBoundIncluded;<NEW_LINE>this.firstEnumerated = false;<NEW_LINE>MysqlDateTime minDatetime = from.datetimeValue(TimeParserFlags.FLAG_TIME_FUZZY_DATE, SessionProperties.empty());<NEW_LINE>MysqlDateTime maxDatetime = to.datetimeValue(TimeParserFlags.FLAG_TIME_FUZZY_DATE, SessionProperties.empty());<NEW_LINE>maxDatetime.setHour(0);<NEW_LINE>maxDatetime.setMinute(0);<NEW_LINE>maxDatetime.setHour(0);<NEW_LINE>maxDatetime.setSecond(0);<NEW_LINE>maxDatetime.setSecondPart(0);<NEW_LINE>minDatetime.setHour(0);<NEW_LINE>minDatetime.setMinute(0);<NEW_LINE>minDatetime.setHour(0);<NEW_LINE>minDatetime.setSecond(0);<NEW_LINE>minDatetime.setSecondPart(0);<NEW_LINE>// NOTE: t2 - t1<NEW_LINE>long packedLong = TimeStorage.writeTimestamp(maxDatetime);<NEW_LINE>MysqlDateTime diff = MySQLTimeCalculator.<MASK><NEW_LINE>boolean isNeg = diff.isNeg();<NEW_LINE>int sign = isNeg ? -1 : 1;<NEW_LINE>long diffSec = diff.getSecond();<NEW_LINE>// calc day<NEW_LINE>// set the status of this iterator<NEW_LINE>long dayDiff = diffSec / (3600 * 24L) * sign;<NEW_LINE>count = (int) dayDiff + 1;<NEW_LINE>if (!lowerBoundIncluded) {<NEW_LINE>count--;<NEW_LINE>}<NEW_LINE>if (!upperBoundIncluded) {<NEW_LINE>count--;<NEW_LINE>}<NEW_LINE>currentDatetime = minDatetime;<NEW_LINE>endPackedLong = packedLong;<NEW_LINE>currentCount = 0;<NEW_LINE>return true;<NEW_LINE>}
calTimeDiff(maxDatetime, minDatetime, false);
787,417
public Lookup createAdditionalLookup(Lookup baseContext) {<NEW_LINE>final InstanceContent ic = new InstanceContent();<NEW_LINE>final Project prj = baseContext.lookup(Project.class);<NEW_LINE>assert prj != null;<NEW_LINE>final AccessQueryImpl access = new AccessQueryImpl(prj);<NEW_LINE>final ForeignClassBundlerImpl bundler = new ForeignClassBundlerImpl(prj);<NEW_LINE>final RecommendedTemplates templates = new RecommendedTemplates() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String[] getRecommendedTypes() {<NEW_LINE>return new String[] { "osgi" };<NEW_LINE>}<NEW_LINE>};<NEW_LINE>NbMavenProject nbprj = prj.getLookup().lookup(NbMavenProject.class);<NEW_LINE>nbprj.addPropertyChangeListener(new PropertyChangeListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void propertyChange(PropertyChangeEvent evt) {<NEW_LINE>if (NbMavenProject.PROP_PROJECT.equals(evt.getPropertyName())) {<NEW_LINE>checkContent(prj, <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>checkContent(prj, ic, access, bundler, templates);<NEW_LINE>return new AbstractLookup(ic);<NEW_LINE>}
ic, access, bundler, templates);
437,385
private boolean handleCompressionOrder(ChannelHandlerContext ctx, ByteBuf buf) {<NEW_LINE>boolean needsCompress = false;<NEW_LINE>if (!handledCompression) {<NEW_LINE>if (ctx.pipeline().names().indexOf("compress") > ctx.pipeline().names().indexOf("via-encoder")) {<NEW_LINE>// Need to decompress this packet due to bad order<NEW_LINE>ByteBuf decompressed = BungeePipelineUtil.decompress(ctx, buf);<NEW_LINE>// Ensure the buffer wasn't reused<NEW_LINE>if (buf != decompressed) {<NEW_LINE>try {<NEW_LINE>buf.clear().writeBytes(decompressed);<NEW_LINE>} finally {<NEW_LINE>decompressed.release();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Reorder the pipeline<NEW_LINE>ChannelHandler dec = ctx.pipeline().get("via-decoder");<NEW_LINE>ChannelHandler enc = ctx.pipeline().get("via-encoder");<NEW_LINE>ctx.<MASK><NEW_LINE>ctx.pipeline().remove(enc);<NEW_LINE>ctx.pipeline().addAfter("decompress", "via-decoder", dec);<NEW_LINE>ctx.pipeline().addAfter("compress", "via-encoder", enc);<NEW_LINE>needsCompress = true;<NEW_LINE>handledCompression = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return needsCompress;<NEW_LINE>}
pipeline().remove(dec);
1,445,770
public final ProcedureParameterContext procedureParameter() throws RecognitionException {<NEW_LINE>ProcedureParameterContext _localctx = new ProcedureParameterContext(_ctx, getState());<NEW_LINE>enterRule(_localctx, 66, RULE_procedureParameter);<NEW_LINE>int _la;<NEW_LINE>try {<NEW_LINE>enterOuterAlt(_localctx, 1);<NEW_LINE>{<NEW_LINE>setState(1354);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>_la = _input.LA(1);<NEW_LINE>if (((((_la - 71)) & ~0x3f) == 0 && ((1L << (_la - 71)) & ((1L << (IN - 71)) | (1L << (INOUT - 71)) | (1L << (OUT - 71)))) != 0)) {<NEW_LINE>{<NEW_LINE>setState(1353);<NEW_LINE>((ProcedureParameterContext) _localctx).direction = _input.LT(1);<NEW_LINE>_la = _input.LA(1);<NEW_LINE>if (!(((((_la - 71)) & ~0x3f) == 0 && ((1L << (_la - 71)) & ((1L << (IN - 71)) | (1L << (INOUT - 71)) | (1L << (OUT - 71)))) != 0))) {<NEW_LINE>((ProcedureParameterContext) _localctx).direction = (Token) _errHandler.recoverInline(this);<NEW_LINE>} else {<NEW_LINE>if (_input.LA(1) == Token.EOF)<NEW_LINE>matchedEOF = true;<NEW_LINE>_errHandler.reportMatch(this);<NEW_LINE>consume();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>setState(1356);<NEW_LINE>uid();<NEW_LINE>setState(1357);<NEW_LINE>dataType();<NEW_LINE>}<NEW_LINE>} catch (RecognitionException re) {<NEW_LINE>_localctx.exception = re;<NEW_LINE>_errHandler.reportError(this, re);<NEW_LINE><MASK><NEW_LINE>} finally {<NEW_LINE>exitRule();<NEW_LINE>}<NEW_LINE>return _localctx;<NEW_LINE>}
_errHandler.recover(this, re);
886,825
final ChangePasswordResult executeChangePassword(ChangePasswordRequest changePasswordRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(changePasswordRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ChangePasswordRequest> request = null;<NEW_LINE>Response<ChangePasswordResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ChangePasswordRequestMarshaller().marshall(super.beforeMarshalling(changePasswordRequest));<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, "IAM");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<ChangePasswordResult> responseHandler = new StaxResponseHandler<ChangePasswordResult>(new ChangePasswordResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.OPERATION_NAME, "ChangePassword");
245,018
public static void define(final Ruby runtime) {<NEW_LINE>JavaExtensions.put(runtime, java.util.Enumeration.class, (proxyClass) -> Enumeration.define(runtime, proxyClass));<NEW_LINE>JavaExtensions.put(runtime, java.util.Iterator.class, (proxyClass) -> Iterator.define(runtime, proxyClass));<NEW_LINE>JavaExtensions.put(runtime, java.util.Collection.class, (proxyClass) -> Collection.define(runtime, proxyClass));<NEW_LINE>JavaExtensions.put(runtime, java.util.List.class, (proxyClass) -> List.define(runtime, proxyClass));<NEW_LINE>JavaExtensions.put(runtime, java.util.Date.class, (dateClass) -> {<NEW_LINE>dateClass.addMethod("inspect", new JavaLang.InspectValueWithTypePrefix(dateClass));<NEW_LINE>});<NEW_LINE>JavaExtensions.put(runtime, java.util.TimeZone.class, (proxyClass) -> {<NEW_LINE>proxyClass.addMethod(<MASK><NEW_LINE>});<NEW_LINE>}
"inspect", new InspectTimeZone(proxyClass));
1,211,232
private Object executeOverrideTarget(Method o, Object ctx, Object elCtx, VariableResolverFactory vars) {<NEW_LINE>// this local field is required to make sure exception block works with the same coercionNeeded value<NEW_LINE>// and it is not changed by another thread while setter is invoked<NEW_LINE>boolean attemptedCoercion = coercionNeeded;<NEW_LINE>if (!coercionNeeded) {<NEW_LINE>try {<NEW_LINE>try {<NEW_LINE>if (nextNode != null) {<NEW_LINE>return nextNode.getValue(o.invoke(ctx, executeAll(elCtx, vars, o)), elCtx, vars);<NEW_LINE>} else {<NEW_LINE>return o.invoke(ctx, executeAll(elCtx, vars, o));<NEW_LINE>}<NEW_LINE>} catch (IllegalArgumentException e) {<NEW_LINE>if (attemptedCoercion)<NEW_LINE>throw e;<NEW_LINE>coercionNeeded = true;<NEW_LINE>return executeOverrideTarget(o, ctx, elCtx, vars);<NEW_LINE>}<NEW_LINE>} catch (Exception e2) {<NEW_LINE>throw new RuntimeException("unable to invoke method", e2);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>if (nextNode != null) {<NEW_LINE>return nextNode.getValue(o.invoke(ctx, executeAndCoerce(o.getParameterTypes(), elCtx, vars, o.isVarArgs(<MASK><NEW_LINE>} else {<NEW_LINE>return o.invoke(ctx, executeAndCoerce(o.getParameterTypes(), elCtx, vars, o.isVarArgs()));<NEW_LINE>}<NEW_LINE>} catch (IllegalAccessException e) {<NEW_LINE>throw new RuntimeException("unable to invoke method (expected target: " + method.getDeclaringClass().getName() + "::" + method.getName() + "; " + "actual target: " + ctx.getClass().getName() + "::" + method.getName() + "; coercionNeeded=" + (coercionNeeded ? "yes" : "no") + ")");<NEW_LINE>} catch (Exception e2) {<NEW_LINE>throw new RuntimeException("unable to invoke method (expected target: " + method.getDeclaringClass().getName() + "::" + method.getName() + "; " + "actual target: " + ctx.getClass().getName() + "::" + method.getName() + "; coercionNeeded=" + (coercionNeeded ? "yes" : "no") + ")");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
))), elCtx, vars);
694,501
public void testSyncBulkheadSmall() throws Exception {<NEW_LINE>// the tasks notify that they are running<NEW_LINE>CountDownLatch notify = new CountDownLatch(2);<NEW_LINE>// and then wait to be released<NEW_LINE>CountDownLatch wait = new CountDownLatch(1);<NEW_LINE>// connectA has a poolSize of 2<NEW_LINE>// first two should be run straight away, in parallel<NEW_LINE>Future<Boolean> future1 = runner.call(() -> {<NEW_LINE>return bean1.connectA("One", wait, notify);<NEW_LINE>});<NEW_LINE>Future<Boolean> future2 = runner.call(() -> {<NEW_LINE>return bean1.connectA("Two", wait, notify);<NEW_LINE>});<NEW_LINE>// wait for the first two to be properly started<NEW_LINE>notify.await(TestConstants.TEST_TIMEOUT, TimeUnit.MILLISECONDS);<NEW_LINE>// next two should be reject because the bulkhead is full<NEW_LINE>Future<Boolean> future3 = runner.call(() -> {<NEW_LINE>return bean1.<MASK><NEW_LINE>});<NEW_LINE>Future<Boolean> future4 = runner.call(() -> {<NEW_LINE>return bean1.connectA("Four", wait, notify);<NEW_LINE>});<NEW_LINE>try {<NEW_LINE>future3.get(TestConstants.FUTURE_THRESHOLD, TimeUnit.MILLISECONDS);<NEW_LINE>throw new AssertionError("Exception not thrown");<NEW_LINE>} catch (ExecutionException e) {<NEW_LINE>// expected<NEW_LINE>if (!(e.getCause() instanceof BulkheadException)) {<NEW_LINE>throw new AssertionError("Cause was not a BulkheadException: " + e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>future4.get(TestConstants.FUTURE_THRESHOLD, TimeUnit.MILLISECONDS);<NEW_LINE>throw new AssertionError("Exception not thrown");<NEW_LINE>} catch (ExecutionException e) {<NEW_LINE>// expected<NEW_LINE>if (!(e.getCause() instanceof BulkheadException)) {<NEW_LINE>throw new AssertionError("Cause was not a BulkheadException: " + e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// release the first two to complete<NEW_LINE>wait.countDown();<NEW_LINE>}
connectA("Three", wait, notify);
12,149
public static BigInteger crt(BigInteger[] congs, BigInteger[] moduli) {<NEW_LINE>BigInteger prodModuli = BigInteger.ONE;<NEW_LINE>for (BigInteger mod : moduli) {<NEW_LINE>prodModuli = prodModuli.multiply(mod);<NEW_LINE>}<NEW_LINE>BigInteger[] modulus = new BigInteger[moduli.length];<NEW_LINE>for (int i = 0; i < moduli.length; i++) {<NEW_LINE>modulus[i] = prodModuli.divide(moduli[i]);<NEW_LINE>}<NEW_LINE>BigInteger retVal = BigInteger.ZERO;<NEW_LINE>for (int i = 0; i < moduli.length; i++) {<NEW_LINE>// get s value from EEA<NEW_LINE>BigInteger tmp = extendedEuclid(moduli[i]<MASK><NEW_LINE>retVal = retVal.add(congs[i].multiply(tmp).multiply(modulus[i]).mod(prodModuli));<NEW_LINE>}<NEW_LINE>return retVal.mod(prodModuli);<NEW_LINE>}
, modulus[i]).bigC;
1,029,200
public static Promise<String, Throwable, Void> generateShareMsg(final Playlist playlist) {<NEW_LINE>final ADeferredObject<String, Throwable, Void> deferred = new ADeferredObject<>();<NEW_LINE>if (playlist != null && playlist.getUserId() != null) {<NEW_LINE>final User user = User.getUserById(playlist.getUserId());<NEW_LINE>if (user != null && user.getName() != null) {<NEW_LINE>User.getSelf().done(new DoneCallback<User>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onDone(User result) {<NEW_LINE>String s;<NEW_LINE>if (user == result) {<NEW_LINE>s = TomahawkApp.getContext().getString(R.string.my_playlist);<NEW_LINE>} else {<NEW_LINE>s = TomahawkApp.getContext().getString(R.string.users_playlist_suffix, user.getName());<NEW_LINE>}<NEW_LINE>String msg = DEFAULT_SHARE_PREFIX + " " + s + ": \"" + playlist.getName() + "\"" + <MASK><NEW_LINE>deferred.resolve(msg);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} else {<NEW_LINE>deferred.resolve(null);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>deferred.resolve(null);<NEW_LINE>}<NEW_LINE>return deferred;<NEW_LINE>}
" - " + generateLink(playlist, user);
333,747
Stateful doMultiNewKeyCached(SmallMap state, Object key, Object local_state, Object computation, @Cached("key") Object cachedNewKey, @Cached(value = "state.getKeys()", dimensions = 1) Object[] cachedOldKeys, @Cached("state.indexOf(key)") int index, @Cached(value = "buildNewKeys(cachedNewKey, cachedOldKeys)", dimensions = 1) Object[] newKeys) {<NEW_LINE>Object[] newValues <MASK><NEW_LINE>System.arraycopy(state.getValues(), 0, newValues, 1, cachedOldKeys.length);<NEW_LINE>newValues[0] = local_state;<NEW_LINE>SmallMap localStateMap = new SmallMap(newKeys, newValues);<NEW_LINE>Stateful res = thunkExecutorNode.executeThunk(computation, localStateMap, BaseNode.TailStatus.NOT_TAIL);<NEW_LINE>SmallMap resultStateMap = (SmallMap) res.getState();<NEW_LINE>Object[] resultValues = new Object[cachedOldKeys.length];<NEW_LINE>System.arraycopy(resultStateMap.getValues(), 1, resultValues, 0, cachedOldKeys.length);<NEW_LINE>return new Stateful(new SmallMap(cachedOldKeys, resultValues), res.getValue());<NEW_LINE>}
= new Object[newKeys.length];
261,750
public static // begin begin_end_body end<NEW_LINE>boolean begin_end_expression(PsiBuilder b, int l) {<NEW_LINE>if (!recursion_guard_(b, l, "begin_end_expression"))<NEW_LINE>return false;<NEW_LINE>if (!nextTokenIs(b, "<expression>", ERL_BEGIN))<NEW_LINE>return false;<NEW_LINE>boolean r, p;<NEW_LINE>Marker m = enter_section_(b, l, _NONE_, ERL_BEGIN_END_EXPRESSION, "<expression>");<NEW_LINE>r = consumeToken(b, ERL_BEGIN);<NEW_LINE>// pin = 1<NEW_LINE>p = r;<NEW_LINE>r = r && report_error_(b, begin_end_body<MASK><NEW_LINE>r = p && consumeToken(b, ERL_END) && r;<NEW_LINE>exit_section_(b, l, m, r, p, null);<NEW_LINE>return r || p;<NEW_LINE>}
(b, l + 1));
1,085,222
public void execute(final SourceSet sourceSet) {<NEW_LINE>String displayName = (String) InvokerHelper.invokeMethod(sourceSet, "getDisplayName", null);<NEW_LINE>Convention sourceSetConvention = (Convention) InvokerHelper.getProperty(sourceSet, "convention");<NEW_LINE>org.gradle.api.internal.tasks.DefaultScalaSourceSet scalaSourceSet = new org.gradle.api.internal.tasks.DefaultScalaSourceSet(displayName, objectFactory);<NEW_LINE>sourceSetConvention.getPlugins().put("scala", scalaSourceSet);<NEW_LINE>sourceSet.getExtensions().add(ScalaSourceDirectorySet.class, "scala", scalaSourceSet.getScala());<NEW_LINE>final SourceDirectorySet scalaDirectorySet = scalaSourceSet.getScala();<NEW_LINE>scalaDirectorySet.srcDir(project.file("src/" + sourceSet.getName() + "/scala"));<NEW_LINE>sourceSet.getAllJava().source(scalaDirectorySet);<NEW_LINE>sourceSet.getAllSource().source(scalaDirectorySet);<NEW_LINE>// Explicitly capture only a FileCollection in the lambda below for compatibility with configuration-cache.<NEW_LINE>FileCollection scalaSource = scalaDirectorySet;<NEW_LINE>sourceSet.getResources().getFilter().exclude(spec(element -> scalaSource.contains(element.getFile())));<NEW_LINE>Configuration classpath = project.getConfigurations().<MASK><NEW_LINE>Configuration incrementalAnalysis = project.getConfigurations().create("incrementalScalaAnalysisFor" + sourceSet.getName());<NEW_LINE>incrementalAnalysis.setVisible(false);<NEW_LINE>incrementalAnalysis.setDescription("Incremental compilation analysis files for " + displayName);<NEW_LINE>incrementalAnalysis.setCanBeResolved(true);<NEW_LINE>incrementalAnalysis.setCanBeConsumed(false);<NEW_LINE>incrementalAnalysis.extendsFrom(classpath);<NEW_LINE>incrementalAnalysis.getAttributes().attribute(USAGE_ATTRIBUTE, incrementalAnalysisUsage);<NEW_LINE>configureScalaCompile(project, sourceSet, incrementalAnalysis, incrementalAnalysisUsage, scalaRuntime);<NEW_LINE>}
getByName(sourceSet.getImplementationConfigurationName());
1,057,436
protected // May be called if couplingType indicates LOOSE or TIGHT or is UNSET<NEW_LINE>boolean matchBranchCoupling(int couplingType1, int couplingType2, ManagedConnectionFactory managedConnectionFactory) {<NEW_LINE>final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();<NEW_LINE>boolean matched = true;<NEW_LINE>if (isJDBC && couplingType1 != couplingType2) {<NEW_LINE>// ResourceRefInfo.BRANCH_COUPLING_UNSET can default to BRANCH_COUPLING_TIGHT or BRANCH_COUPLING_LOOSE<NEW_LINE>if (couplingType1 == ResourceRefInfo.BRANCH_COUPLING_UNSET)<NEW_LINE>couplingType1 = ((WSManagedConnectionFactory) managedConnectionFactory).getDefaultBranchCoupling();<NEW_LINE>else if (couplingType2 == ResourceRefInfo.BRANCH_COUPLING_UNSET)<NEW_LINE>couplingType2 = ((<MASK><NEW_LINE>matched = couplingType1 == couplingType2;<NEW_LINE>}<NEW_LINE>if (isTraceOn && tc.isDebugEnabled()) {<NEW_LINE>Tr.debug(this, tc, "Match coupling request for " + couplingType1 + " and " + couplingType2 + " match is " + matched);<NEW_LINE>}<NEW_LINE>return matched;<NEW_LINE>}
WSManagedConnectionFactory) managedConnectionFactory).getDefaultBranchCoupling();
1,407,222
public void handleMessage(String fromPort, Msg msg) {<NEW_LINE>synchronized (m_lastMsgReceived) {<NEW_LINE>m_lastMsgReceived = System.currentTimeMillis();<NEW_LINE>}<NEW_LINE>synchronized (m_features) {<NEW_LINE>// first update all features that are<NEW_LINE>// not status features<NEW_LINE>for (DeviceFeature f : m_features.values()) {<NEW_LINE>if (!f.isStatusFeature()) {<NEW_LINE>logger.debug(<MASK><NEW_LINE>if (f.handleMessage(msg, fromPort)) {<NEW_LINE>// handled a reply to a query,<NEW_LINE>// mark it as processed<NEW_LINE>logger.trace("handled reply of direct: {}", f);<NEW_LINE>setFeatureQueried(null);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// then update all the status features,<NEW_LINE>// e.g. when the device was last updated<NEW_LINE>for (DeviceFeature f : m_features.values()) {<NEW_LINE>if (f.isStatusFeature()) {<NEW_LINE>f.handleMessage(msg, fromPort);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
"----- applying message to feature: {}", f.getName());
342,800
final AddCustomRoutingEndpointsResult executeAddCustomRoutingEndpoints(AddCustomRoutingEndpointsRequest addCustomRoutingEndpointsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(addCustomRoutingEndpointsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<AddCustomRoutingEndpointsRequest> request = null;<NEW_LINE>Response<AddCustomRoutingEndpointsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new AddCustomRoutingEndpointsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(addCustomRoutingEndpointsRequest));<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, "Global Accelerator");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AddCustomRoutingEndpoints");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<AddCustomRoutingEndpointsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new AddCustomRoutingEndpointsResultJsonUnmarshaller());<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);
763,236
private static //<NEW_LINE>void overloading(LexerfulGrammarBuilder b) {<NEW_LINE>b.rule(operatorFunctionId).is(CxxKeyword.OPERATOR, operator);<NEW_LINE>b.rule(operator).is(// --- alternative tokens<NEW_LINE>b.// --- alternative tokens<NEW_LINE>firstOf(// --- alternative tokens<NEW_LINE>b.sequence(CxxKeyword.NEW, b.optional("[", "]")), // --- alternative tokens<NEW_LINE>b.sequence(CxxKeyword.DELETE, b.optional("[", "]")), // --- alternative tokens<NEW_LINE>CxxKeyword.CO_AWAIT, // --- alternative tokens<NEW_LINE>b.sequence("(", ")"), // --- alternative tokens<NEW_LINE>b.sequence("[", "]"), // --- alternative tokens<NEW_LINE>"->", // --- alternative tokens<NEW_LINE>"->*", // --- alternative tokens<NEW_LINE>"~", // --- alternative tokens<NEW_LINE>"!", // --- alternative tokens<NEW_LINE>"+", // --- alternative tokens<NEW_LINE>"-", // --- alternative tokens<NEW_LINE>"*", // --- alternative tokens<NEW_LINE>"/", // --- alternative tokens<NEW_LINE>"%", // --- alternative tokens<NEW_LINE>"^", // --- alternative tokens<NEW_LINE>"&", // --- alternative tokens<NEW_LINE>"|", // --- alternative tokens<NEW_LINE>"=", // --- alternative tokens<NEW_LINE>"+=", // --- alternative tokens<NEW_LINE>"-=", // --- alternative tokens<NEW_LINE>"*=", // --- alternative tokens<NEW_LINE>"/=", // --- alternative tokens<NEW_LINE>"%=", // --- alternative tokens<NEW_LINE>"^=", // --- alternative tokens<NEW_LINE>"&=", // --- alternative tokens<NEW_LINE>"|=", // --- alternative tokens<NEW_LINE>"==", // --- alternative tokens<NEW_LINE>"!=", // --- alternative tokens<NEW_LINE>"<", // --- alternative tokens<NEW_LINE>">", // --- alternative tokens<NEW_LINE>"<=", // --- alternative tokens<NEW_LINE>">=", // --- alternative tokens<NEW_LINE>"<=>", // --- alternative tokens<NEW_LINE>"&&", // --- alternative tokens<NEW_LINE>"||", // --- alternative tokens<NEW_LINE>"<<", // --- alternative tokens<NEW_LINE>">>", // --- alternative tokens<NEW_LINE>"<<=", // --- alternative tokens<NEW_LINE>">>=", // --- alternative tokens<NEW_LINE>"++", // --- alternative tokens<NEW_LINE>"--", // --- alternative tokens<NEW_LINE>",", CxxKeyword.XOR, CxxKeyword.BITAND, CxxKeyword.BITOR, CxxKeyword.COMPL, CxxKeyword.NOT, CxxKeyword.XOR_EQ, CxxKeyword.AND_EQ, CxxKeyword.OR_EQ, CxxKeyword.NOT_EQ, CxxKeyword.AND, CxxKeyword.OR));<NEW_LINE>// C++ (string-literal and user-defined-string-literal is both STRING)<NEW_LINE>b.rule(literalOperatorId).// C++ (string-literal and user-defined-string-literal is both STRING)<NEW_LINE>is(// C++ (string-literal and user-defined-string-literal is both STRING)<NEW_LINE>CxxKeyword.OPERATOR, // C++ (string-literal and user-defined-string-literal is both STRING)<NEW_LINE>STRING<MASK><NEW_LINE>}
, b.optional(IDENTIFIER));
605,133
final DisassociateSkillFromSkillGroupResult executeDisassociateSkillFromSkillGroup(DisassociateSkillFromSkillGroupRequest disassociateSkillFromSkillGroupRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(disassociateSkillFromSkillGroupRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DisassociateSkillFromSkillGroupRequest> request = null;<NEW_LINE>Response<DisassociateSkillFromSkillGroupResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DisassociateSkillFromSkillGroupRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(disassociateSkillFromSkillGroupRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Alexa For Business");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DisassociateSkillFromSkillGroup");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DisassociateSkillFromSkillGroupResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DisassociateSkillFromSkillGroupResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
1,687,026
protected void trackFeatures(I image) {<NEW_LINE>tracker.setImage(currPyr.basePyramid, currPyr.derivX, currPyr.derivY);<NEW_LINE>for (int i = active.size() - 1; i >= 0; i--) {<NEW_LINE>PyramidKltFeature t = active.get(i);<NEW_LINE>KltTrackFault <MASK><NEW_LINE>boolean success = false;<NEW_LINE>if (ret == KltTrackFault.SUCCESS) {<NEW_LINE>// discard a track if its center drifts outside the image.<NEW_LINE>if (image.isInBounds((int) t.x, (int) t.y) && tracker.setDescription(t)) {<NEW_LINE>PointTrack p = t.getCookie();<NEW_LINE>p.pixel.setTo(t.x, t.y);<NEW_LINE>p.lastSeenFrameID = frameID;<NEW_LINE>success = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!success) {<NEW_LINE>active.remove(i);<NEW_LINE>dropped.add(t);<NEW_LINE>unused.add(t);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
ret = tracker.track(t);
215,645
// DO NOT MODIFY THIS CODE, GENERATED AUTOMATICALLY<NEW_LINE>public static boolean canAddMethod(com.sun.jdi.VirtualMachine 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.VirtualMachine", "canAddMethod", "JDI CALL: com.sun.jdi.VirtualMachine({0}).canAddMethod()", new Object[] { a });<NEW_LINE>}<NEW_LINE>Object retValue = null;<NEW_LINE>try {<NEW_LINE>boolean ret;<NEW_LINE>ret = a.canAddMethod();<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.jpda.jdi.InternalExceptionWrapper(ex);<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.<MASK><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.VirtualMachine", "canAddMethod", retValue);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
Mirror) a).virtualMachine();
1,815,990
private void writeIterableResult(StreamFactory streamOpener, IterableResult<?> ri) throws IOException {<NEW_LINE>PrintStream outStream = streamOpener.openStream(getFilename(ri, Metadata.of(ri).getLongName()));<NEW_LINE>TextWriterStream out = new TextWriterStream(outStream, writers, fallback);<NEW_LINE>// hack to print collectionResult header information<NEW_LINE>if (ri instanceof CollectionResult<?>) {<NEW_LINE>final Collection<String> hdr = ((CollectionResult<?<MASK><NEW_LINE>if (hdr != null) {<NEW_LINE>for (String header : hdr) {<NEW_LINE>out.commentPrintLn(header);<NEW_LINE>}<NEW_LINE>out.flush();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Iterator<?> i = ri.iterator();<NEW_LINE>while (i.hasNext()) {<NEW_LINE>Object o = i.next();<NEW_LINE>TextWriterWriterInterface<?> writer = out.getWriterFor(o);<NEW_LINE>if (writer != null) {<NEW_LINE>writer.writeObject(out, null, o);<NEW_LINE>}<NEW_LINE>out.flush();<NEW_LINE>}<NEW_LINE>out.flush();<NEW_LINE>streamOpener.closeStream(outStream);<NEW_LINE>}
>) ri).getHeader();
1,335,410
private static EFun createFunForMethod(Method method, String module) {<NEW_LINE>assert (Modifier.isStatic<MASK><NEW_LINE>assert (!Modifier.isPrivate(method.getModifiers()));<NEW_LINE>Class<?>[] parameterTypes = method.getParameterTypes();<NEW_LINE>int ary = parameterTypes.length;<NEW_LINE>boolean proc = (ary > 0 && parameterTypes[0].equals(EProc.class));<NEW_LINE>if (proc)<NEW_LINE>ary -= 1;<NEW_LINE>String fname = erlangNameOfMethod(method);<NEW_LINE>String mname = EUtil.getJavaName(EAtom.intern(fname), ary);<NEW_LINE>boolean is_guard = isGuardBifMethod(method);<NEW_LINE>Class<?> declaringClass = method.getDeclaringClass();<NEW_LINE>Type type = Type.getType(declaringClass);<NEW_LINE>byte[] data = CompilerVisitor.make_invoker(module, fname, type, mname, method.getName(), ary, proc, true, is_guard, null, Type.getType(method.getReturnType()), true, true);<NEW_LINE>ClassLoader cl = declaringClass.getClassLoader();<NEW_LINE>// make sure we have its superclass loaded<NEW_LINE>get_fun_class(ary);<NEW_LINE>data = weave(data);<NEW_LINE>String clname = type.getClassName() + "$FN_" + mname;<NEW_LINE>clname = clname.replace('/', '.');<NEW_LINE>Class<? extends EFun> res_class = ERT.defineClass(cl, clname, data);<NEW_LINE>try {<NEW_LINE>return res_class.newInstance();<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new Error(e);<NEW_LINE>}<NEW_LINE>}
(method.getModifiers()));
1,571,334
public void run(RegressionEnvironment env) {<NEW_LINE>String stmtText = "@name('s0') select (select id from SupportBean_S1#length(1000) where p10=s0.p00) as ids1 from SupportBean_S0 as s0";<NEW_LINE>env.compileDeployAddListenerMileZero(stmtText, "s0");<NEW_LINE>env.sendEventBean(new SupportBean_S0(0));<NEW_LINE>env.assertEqualsNew("s0", "ids1", null);<NEW_LINE>env.sendEventBean(new SupportBean_S1(1, "X"));<NEW_LINE>env.sendEventBean(new SupportBean_S1(2, "Y"));<NEW_LINE>env.sendEventBean(new SupportBean_S1(3, "Z"));<NEW_LINE>env.sendEventBean(new SupportBean_S0(0));<NEW_LINE>env.assertEqualsNew("s0", "ids1", null);<NEW_LINE>env.sendEventBean(new SupportBean_S0(0, "X"));<NEW_LINE>env.<MASK><NEW_LINE>env.sendEventBean(new SupportBean_S0(0, "Y"));<NEW_LINE>env.assertEqualsNew("s0", "ids1", 2);<NEW_LINE>env.sendEventBean(new SupportBean_S0(0, "Z"));<NEW_LINE>env.assertEqualsNew("s0", "ids1", 3);<NEW_LINE>env.sendEventBean(new SupportBean_S0(0, "A"));<NEW_LINE>env.assertEqualsNew("s0", "ids1", null);<NEW_LINE>env.undeployAll();<NEW_LINE>}
assertEqualsNew("s0", "ids1", 1);
342,702
public static QueryApiAvgDurationGroupTrendResponse unmarshall(QueryApiAvgDurationGroupTrendResponse queryApiAvgDurationGroupTrendResponse, UnmarshallerContext _ctx) {<NEW_LINE>queryApiAvgDurationGroupTrendResponse.setRequestId(_ctx.stringValue("QueryApiAvgDurationGroupTrendResponse.RequestId"));<NEW_LINE>List<MetricResultItem> metricResultList = new ArrayList<MetricResultItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("QueryApiAvgDurationGroupTrendResponse.MetricResultList.Length"); i++) {<NEW_LINE>MetricResultItem metricResultItem = new MetricResultItem();<NEW_LINE>metricResultItem.setTags(_ctx.mapValue("QueryApiAvgDurationGroupTrendResponse.MetricResultList[" + i + "].Tags"));<NEW_LINE>List<Point> data <MASK><NEW_LINE>for (int j = 0; j < _ctx.lengthValue("QueryApiAvgDurationGroupTrendResponse.MetricResultList[" + i + "].Data.Length"); j++) {<NEW_LINE>Point point = new Point();<NEW_LINE>point.setData(_ctx.floatValue("QueryApiAvgDurationGroupTrendResponse.MetricResultList[" + i + "].Data[" + j + "].Data"));<NEW_LINE>point.setTime(_ctx.longValue("QueryApiAvgDurationGroupTrendResponse.MetricResultList[" + i + "].Data[" + j + "].Time"));<NEW_LINE>data.add(point);<NEW_LINE>}<NEW_LINE>metricResultItem.setData(data);<NEW_LINE>metricResultList.add(metricResultItem);<NEW_LINE>}<NEW_LINE>queryApiAvgDurationGroupTrendResponse.setMetricResultList(metricResultList);<NEW_LINE>return queryApiAvgDurationGroupTrendResponse;<NEW_LINE>}
= new ArrayList<Point>();
781,533
public static void main(String[] args) {<NEW_LINE>StanfordCoreNLP pipeline = new StanfordCoreNLP(PropertiesUtils.asProperties("annotators", "tokenize,ssplit,pos,lemma,ner"));<NEW_LINE>Annotation annotation = new Annotation("Casey is 21. Sally Atkinson's age is 30.");<NEW_LINE>pipeline.annotate(annotation);<NEW_LINE>List<CoreMap> sentences = annotation.<MASK><NEW_LINE>List<TokenSequencePattern> tokenSequencePatterns = new ArrayList<>();<NEW_LINE>String[] patterns = { "(?$who [ ner: PERSON]+ ) /is/ (?$age [ pos: CD ] )", "(?$who [ ner: PERSON]+ ) /'s/ /age/ /is/ (?$age [ pos: CD ] )" };<NEW_LINE>for (String line : patterns) {<NEW_LINE>TokenSequencePattern pattern = TokenSequencePattern.compile(line);<NEW_LINE>tokenSequencePatterns.add(pattern);<NEW_LINE>}<NEW_LINE>MultiPatternMatcher<CoreMap> multiMatcher = TokenSequencePattern.getMultiPatternMatcher(tokenSequencePatterns);<NEW_LINE>int i = 0;<NEW_LINE>for (CoreMap sentence : sentences) {<NEW_LINE>List<CoreLabel> tokens = sentence.get(CoreAnnotations.TokensAnnotation.class);<NEW_LINE>System.out.println("Sentence #" + ++i);<NEW_LINE>System.out.print(" Tokens:");<NEW_LINE>for (CoreLabel token : tokens) {<NEW_LINE>System.out.print(' ');<NEW_LINE>System.out.print(token.toShortString("Text", "PartOfSpeech", "NamedEntityTag"));<NEW_LINE>}<NEW_LINE>System.out.println();<NEW_LINE>List<SequenceMatchResult<CoreMap>> answers = multiMatcher.findNonOverlapping(tokens);<NEW_LINE>int j = 0;<NEW_LINE>for (SequenceMatchResult<CoreMap> matched : answers) {<NEW_LINE>System.out.println(" Match #" + ++j);<NEW_LINE>System.out.println(" match: " + matched.group(0));<NEW_LINE>System.out.println(" who: " + matched.group("$who"));<NEW_LINE>System.out.println(" age: " + matched.group("$age"));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
get(CoreAnnotations.SentencesAnnotation.class);
394,906
private static CodegenExpression codegenLongInternal(ReformatBetweenNonConstantParamsForge forge, CodegenExpression inner, CodegenMethodScope codegenMethodScope, ExprForgeCodegenSymbol exprSymbol, CodegenClassScope codegenClassScope) {<NEW_LINE>CodegenMethod methodNode = codegenMethodScope.makeChild(EPTypePremade.BOOLEANBOXED.getEPType(), ReformatBetweenNonConstantParamsForgeOp.class, codegenClassScope).addParam(EPTypePremade.LONGPRIMITIVE.getEPType(), "ts");<NEW_LINE>CodegenBlock block = methodNode.getBlock();<NEW_LINE>codegenLongCoercion(block, "first", forge.start, forge.startCoercer, methodNode, exprSymbol, codegenClassScope);<NEW_LINE>codegenLongCoercion(block, "second", forge.end, forge.<MASK><NEW_LINE>CodegenExpression first = ref("first");<NEW_LINE>CodegenExpression second = ref("second");<NEW_LINE>CodegenExpression ts = ref("ts");<NEW_LINE>if (forge.includeBoth) {<NEW_LINE>block.ifCondition(relational(first, LE, second)).blockReturn(and(relational(first, LE, ts), relational(ts, LE, second))).methodReturn(and(relational(second, LE, ts), relational(ts, LE, first)));<NEW_LINE>} else if (forge.includeLow != null && forge.includeHigh != null) {<NEW_LINE>block.ifCondition(relational(ts, forge.includeLow ? LT : LE, first)).blockReturn(constantFalse()).ifCondition(relational(ts, forge.includeHigh ? GT : GE, second)).blockReturn(constantFalse()).methodReturn(constantTrue());<NEW_LINE>} else {<NEW_LINE>codegenBooleanEval(block, "includeLowEndpoint", forge.includeLow, forge.forgeIncludeLow, methodNode, exprSymbol, codegenClassScope);<NEW_LINE>codegenBooleanEval(block, "includeLowHighpoint", forge.includeHigh, forge.forgeIncludeHigh, methodNode, exprSymbol, codegenClassScope);<NEW_LINE>block.methodReturn(staticMethod(ReformatBetweenNonConstantParamsForgeOp.class, "compareTimestamps", first, ts, second, ref("includeLowEndpoint"), ref("includeLowHighpoint")));<NEW_LINE>}<NEW_LINE>return localMethod(methodNode, inner);<NEW_LINE>}
secondCoercer, methodNode, exprSymbol, codegenClassScope);
80,896
private void patchActivityImplementation() {<NEW_LINE>SootClass scApplicationHolder = createOrGetApplicationHolder();<NEW_LINE>SootClass sc = Scene.v().getSootClassUnsafe("android.app.Activity");<NEW_LINE>if (sc == null || sc.resolvingLevel() < SootClass.SIGNATURES || scApplicationHolder == null)<NEW_LINE>return;<NEW_LINE>sc.setLibraryClass();<NEW_LINE>SootMethod smRun = sc.getMethodUnsafe("android.app.Application getApplication()");<NEW_LINE>if (smRun == null || (smRun.hasActiveBody() && !SystemClassHandler.v().isStubImplementation(smRun.getActiveBody())))<NEW_LINE>return;<NEW_LINE>smRun.setPhantom(false);<NEW_LINE>smRun.addTag(new FlowDroidEssentialMethodTag());<NEW_LINE>Body b = Jimple.v().newBody(smRun);<NEW_LINE>smRun.setActiveBody(b);<NEW_LINE>// add "this" local<NEW_LINE>Local thisLocal = Jimple.v().newLocal("this", sc.getType());<NEW_LINE>b.getLocals().add(thisLocal);<NEW_LINE>b.getUnits().add(Jimple.v().newIdentityStmt(thisLocal, Jimple.v().newThisRef(sc.getType())));<NEW_LINE>SootFieldRef appStaticFieldRef = scApplicationHolder.<MASK><NEW_LINE>// creating local to store the mApplication field<NEW_LINE>Local targetLocal = Jimple.v().newLocal("retApplication", appStaticFieldRef.type());<NEW_LINE>b.getLocals().add(targetLocal);<NEW_LINE>b.getUnits().add(Jimple.v().newAssignStmt(targetLocal, Jimple.v().newStaticFieldRef(appStaticFieldRef)));<NEW_LINE>Unit retStmt = Jimple.v().newReturnStmt(targetLocal);<NEW_LINE>b.getUnits().add(retStmt);<NEW_LINE>}
getFieldByName("application").makeRef();
315,259
public static ListDataServiceApplicationsResponse unmarshall(ListDataServiceApplicationsResponse listDataServiceApplicationsResponse, UnmarshallerContext _ctx) {<NEW_LINE>listDataServiceApplicationsResponse.setRequestId(_ctx.stringValue("ListDataServiceApplicationsResponse.RequestId"));<NEW_LINE>listDataServiceApplicationsResponse.setErrorCode(_ctx.stringValue("ListDataServiceApplicationsResponse.ErrorCode"));<NEW_LINE>listDataServiceApplicationsResponse.setErrorMessage(_ctx.stringValue("ListDataServiceApplicationsResponse.ErrorMessage"));<NEW_LINE>listDataServiceApplicationsResponse.setHttpStatusCode(_ctx.integerValue("ListDataServiceApplicationsResponse.HttpStatusCode"));<NEW_LINE>listDataServiceApplicationsResponse.setSuccess(_ctx.booleanValue("ListDataServiceApplicationsResponse.Success"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setPageNumber(_ctx.integerValue("ListDataServiceApplicationsResponse.Data.PageNumber"));<NEW_LINE>data.setPageSize(_ctx.integerValue("ListDataServiceApplicationsResponse.Data.PageSize"));<NEW_LINE>data.setTotalCount(_ctx.integerValue("ListDataServiceApplicationsResponse.Data.TotalCount"));<NEW_LINE>List<Application> applications = new ArrayList<Application>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListDataServiceApplicationsResponse.Data.Applications.Length"); i++) {<NEW_LINE>Application application = new Application();<NEW_LINE>application.setApplicationId(_ctx.longValue<MASK><NEW_LINE>application.setApplicationName(_ctx.stringValue("ListDataServiceApplicationsResponse.Data.Applications[" + i + "].ApplicationName"));<NEW_LINE>application.setProjectId(_ctx.longValue("ListDataServiceApplicationsResponse.Data.Applications[" + i + "].ProjectId"));<NEW_LINE>applications.add(application);<NEW_LINE>}<NEW_LINE>data.setApplications(applications);<NEW_LINE>listDataServiceApplicationsResponse.setData(data);<NEW_LINE>return listDataServiceApplicationsResponse;<NEW_LINE>}
("ListDataServiceApplicationsResponse.Data.Applications[" + i + "].ApplicationId"));
154,161
private OutputStream createEJB__CORBA_WStringValue__CORBA_WStringValue__CORBA_WStringValue__CORBA_WStringValue(org.omg.CORBA_2_3.portable.InputStream in, ResponseHandler reply) throws Throwable {<NEW_LINE>String arg0 = (String) in.read_value(String.class);<NEW_LINE>String arg1 = (String) in.read_value(String.class);<NEW_LINE>String arg2 = (String) in.read_value(String.class);<NEW_LINE>String arg3 = (String) in.read_value(String.class);<NEW_LINE>RemoteObjectInstance result;<NEW_LINE>try {<NEW_LINE>result = target.createEJB(arg0, arg1, arg2, arg3);<NEW_LINE>} catch (NamingException ex) {<NEW_LINE>String id = "IDL:javax/naming/NamingEx:1.0";<NEW_LINE>org.omg.CORBA_2_3.portable.OutputStream out = (org.omg.CORBA_2_3.portable.OutputStream) reply.createExceptionReply();<NEW_LINE>out.write_string(id);<NEW_LINE>out.<MASK><NEW_LINE>return out;<NEW_LINE>}<NEW_LINE>org.omg.CORBA_2_3.portable.OutputStream out = (org.omg.CORBA_2_3.portable.OutputStream) reply.createReply();<NEW_LINE>out.write_value((Serializable) result, RemoteObjectInstance.class);<NEW_LINE>return out;<NEW_LINE>}
write_value(ex, NamingException.class);
1,100,889
public boolean execute() throws Exception {<NEW_LINE>if (_controllerHost == null) {<NEW_LINE>_controllerHost = NetUtils.getHostAddress();<NEW_LINE>}<NEW_LINE>String stateValue = _state.toLowerCase();<NEW_LINE>if (!stateValue.equals("enable") && !stateValue.equals("disable") && !stateValue.equals("drop")) {<NEW_LINE>throw new IllegalArgumentException("Invalid value for state: " + _state + "\n Value must be one of enable|disable|drop");<NEW_LINE>}<NEW_LINE>HttpClient httpClient = new HttpClient();<NEW_LINE>URI uri = new URI(_controllerProtocol, null, _controllerHost, Integer.parseInt(_controllerPort), URI_TABLES_PATH + _tableName, "state=" + stateValue, null);<NEW_LINE>String token = makeAuthToken(_authToken, _user, _password);<NEW_LINE>GetMethod httpGet = new GetMethod(uri.toString());<NEW_LINE>if (StringUtils.isNotBlank(token)) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>int status = httpClient.executeMethod(httpGet);<NEW_LINE>if (status != 200) {<NEW_LINE>throw new RuntimeException("Failed to change table state, error: " + httpGet.getResponseBodyAsString());<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
httpGet.setRequestHeader("Authorization", token);
63,248
public double d(double[] x, double[] y) {<NEW_LINE>if (x.length != y.length) {<NEW_LINE>throw new IllegalArgumentException(String.format("Arrays have different length: x[%d], y[%d]", x.length, y.length));<NEW_LINE>}<NEW_LINE>int n = x.length;<NEW_LINE>int m = 0;<NEW_LINE>double dist = 0.0;<NEW_LINE>if (weight == null) {<NEW_LINE>for (int i = 0; i < x.length; i++) {<NEW_LINE>if (!Double.isNaN(x[i]) && !Double.isNaN(y[i])) {<NEW_LINE>m++;<NEW_LINE>double d = Math.abs(x[i] - y[i]);<NEW_LINE>dist += Math.pow(d, p);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (x.length != weight.length) {<NEW_LINE>throw new IllegalArgumentException(String.format("Input vectors and weight vector have different length: %d, %d", x.length, weight.length));<NEW_LINE>}<NEW_LINE>for (int i = 0; i < x.length; i++) {<NEW_LINE>if (!Double.isNaN(x[i]) && !Double.isNaN(y[i])) {<NEW_LINE>m++;<NEW_LINE>double d = Math.abs(x[i] - y[i]);<NEW_LINE>dist += weight[i] * Math.pow(d, p);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>dist = n * dist / m;<NEW_LINE>return Math.<MASK><NEW_LINE>}
pow(dist, 1.0 / p);
1,108,859
public void reread(Context context) {<NEW_LINE>Logger.T(TAG, "Updating screen properties");<NEW_LINE>Activity actvt = null;<NEW_LINE>try {<NEW_LINE>actvt = RhodesActivity.safeGetInstance();<NEW_LINE>} catch (Exception e) {<NEW_LINE>Logger.E(TAG, "can not get RhodesActivity !");<NEW_LINE>}<NEW_LINE>DisplayMetrics displayMetrics = new DisplayMetrics();<NEW_LINE>boolean isOK = false;<NEW_LINE>try {<NEW_LINE>if (actvt == null) {<NEW_LINE>displayMetrics = RhodesActivity.getContext().getResources().getDisplayMetrics();<NEW_LINE>isOK = true;<NEW_LINE>} else {<NEW_LINE>actvt.getWindowManager().getDefaultDisplay().getRealMetrics(displayMetrics);<NEW_LINE>isOK = true;<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>Logger.E(TAG, "can not get real DisplayMetrics !");<NEW_LINE>}<NEW_LINE>if (!isOK) {<NEW_LINE>displayMetrics = RhodesActivity.getContext().getResources().getDisplayMetrics();<NEW_LINE>}<NEW_LINE>mRealScreenHeight = displayMetrics.heightPixels;<NEW_LINE>mRealScreenWidth = displayMetrics.widthPixels;<NEW_LINE>mScreenPpiX = displayMetrics.xdpi;<NEW_LINE>mScreenPpiY = displayMetrics.ydpi;<NEW_LINE>float density = displayMetrics.density;<NEW_LINE>mScreenWidth = (int) ((float) mRealScreenWidth / density + 0.5);<NEW_LINE>mScreenHeight = (int) ((float) mRealScreenHeight / density + 0.5);<NEW_LINE>mScreenOrientation = AndroidFunctionalityManager.getAndroidFunctionality().getScreenOrientation(context);<NEW_LINE>Logger.D(TAG, "New screen properties - width: " + mScreenWidth + <MASK><NEW_LINE>}
", height: " + mScreenHeight + ", orientation: " + mScreenOrientation);
1,347,103
public synchronized void stop() {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {<NEW_LINE>Tr.event(this, tc, "stop chain " + this);<NEW_LINE>}<NEW_LINE>// When the chain is being stopped, remove the previously<NEW_LINE>// registered EndPoint created in update<NEW_LINE>endpointMgr.removeEndPoint(endpointName);<NEW_LINE>// We don't have to check enabled/disabled here: chains are always allowed to stop.<NEW_LINE>if (currentConfig == null || chainState.get() <= ChainState.QUIESCED.val)<NEW_LINE>return;<NEW_LINE>// Quiesce and then stop the chain. The CFW internally uses a StopTimer for<NEW_LINE>// the quiesce/stop operation-- the listener method will be called when the chain<NEW_LINE>// has stopped. So to see what happens next, visit chainStopped<NEW_LINE>try {<NEW_LINE>ChainData <MASK><NEW_LINE>if (cd != null) {<NEW_LINE>cfw.stopChain(cd, cfw.getDefaultChainQuiesceTimeout());<NEW_LINE>// BLOCK<NEW_LINE>stopWait.waitForStop(cfw.getDefaultChainQuiesceTimeout(), this);<NEW_LINE>try {<NEW_LINE>cfw.destroyChain(cd);<NEW_LINE>cfw.removeChain(cd);<NEW_LINE>} catch (InvalidRuntimeStateException e) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {<NEW_LINE>Tr.debug(this, tc, "Error destroying or removing chain " + chainName, this, e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (ChannelException e) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {<NEW_LINE>Tr.debug(this, tc, "Error stopping chain " + chainName, this, e);<NEW_LINE>}<NEW_LINE>} catch (ChainException e) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {<NEW_LINE>Tr.debug(this, tc, "Error stopping chain " + chainName, this, e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
cd = cfw.getChain(chainName);
1,515,367
/*<NEW_LINE>* Generate artificial tangent for un-textured face<NEW_LINE>*/<NEW_LINE>static void generateTB(Vec3f v0, Vec3f v1, Vec3f v2, Vec3f[] ntb) {<NEW_LINE><MASK><NEW_LINE>Vec3f a = instance.vec3f1;<NEW_LINE>a.sub(v1, v0);<NEW_LINE>Vec3f b = instance.vec3f2;<NEW_LINE>b.sub(v2, v0);<NEW_LINE>if (a.dot(a) > b.dot(b)) {<NEW_LINE>ntb[1].set(a);<NEW_LINE>// TODO: make sure each triangle area (size) will be considered<NEW_LINE>ntb[1].normalize();<NEW_LINE>ntb[2].cross(ntb[0], ntb[1]);<NEW_LINE>} else {<NEW_LINE>ntb[2].set(b);<NEW_LINE>// TODO: make sure each triangle area (size) will be considered<NEW_LINE>ntb[2].normalize();<NEW_LINE>ntb[1].cross(ntb[2], ntb[0]);<NEW_LINE>}<NEW_LINE>}
MeshTempState instance = MeshTempState.getInstance();
996,154
void init() {<NEW_LINE>for (EntityType<?> entity : dbf.getEntityManager().getMetamodel().getEntities()) {<NEW_LINE>Class type = entity.getJavaType();<NEW_LINE>String name = type.getSimpleName();<NEW_LINE>resourceTypeClassMap.put(name, type);<NEW_LINE>if (logger.isTraceEnabled()) {<NEW_LINE>logger.trace(String.format("discovered tag resource type[%s], class[%s]", name, type));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>// this makes sure DatabaseFacade is injected into every SystemTag object<NEW_LINE>initSystemTags();<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new CloudRuntimeException(e);<NEW_LINE>}<NEW_LINE>registrySensitiveTagHider();<NEW_LINE>Set<Class<?>> createMessageClass = BeanUtils.reflections.getTypesAnnotatedWith(TagResourceType.class).stream().filter(i -> i.isAnnotationPresent(TagResourceType.class)).collect(Collectors.toSet());<NEW_LINE>for (Class cmsgClz : createMessageClass) {<NEW_LINE>TagResourceType at = (TagResourceType) cmsgClz.getAnnotation(TagResourceType.class);<NEW_LINE>Class resType = at.value();<NEW_LINE>if (!resourceTypeClassMap.values().contains(resType)) {<NEW_LINE>throw new CloudRuntimeException(String.format("tag resource type[%s] defined in @TagResourceType of class[%s] is not a VO entity", resType.getName(), cmsgClz.getName()));<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>autoDeleteTagClasses = new ArrayList<>(BeanUtils.reflections.getTypesAnnotatedWith(AutoDeleteTag.class));<NEW_LINE>List<String> clzNames = CollectionUtils.transformToList(autoDeleteTagClasses, new Function<String, Class>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String call(Class arg) {<NEW_LINE>return arg.getSimpleName();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>logger.debug(String.format("tags of following resources are auto-deleting enabled: %s", clzNames));<NEW_LINE>}
resourceTypeCreateMessageMap.put(cmsgClz, resType);
1,601,027
private MethodDeclaration findAfter(char[] startWith, Scope s, int from, int to, int maxLineCount, boolean outsideEnclosingBlock, char[][] discouragedNames, UnresolvedReferenceNameRequestor nameRequestor) {<NEW_LINE>this.requestor = nameRequestor;<NEW_LINE>// reinitialize completion scanner to be usable as a normal scanner<NEW_LINE>this.completionScanner.cursorLocation = 0;<NEW_LINE>if (!outsideEnclosingBlock) {<NEW_LINE>// compute location of the end of the current block<NEW_LINE>this.completionScanner.<MASK><NEW_LINE>this.completionScanner.jumpOverBlock();<NEW_LINE>to = this.completionScanner.startPosition - 1;<NEW_LINE>}<NEW_LINE>int maxEnd = this.completionScanner.getLineEnd(Util.getLineNumber(from, this.completionScanner.lineEnds, 0, this.completionScanner.linePtr) + maxLineCount);<NEW_LINE>int end;<NEW_LINE>if (maxEnd < 0) {<NEW_LINE>end = to;<NEW_LINE>} else {<NEW_LINE>end = maxEnd < to ? maxEnd : to;<NEW_LINE>}<NEW_LINE>this.parser.startRecordingIdentifiers(from, end);<NEW_LINE>MethodDeclaration fakeMethod = this.parser.parseSomeStatements(from, end, outsideEnclosingBlock ? FAKE_BLOCKS_COUNT : 0, s.compilationUnitScope().referenceContext);<NEW_LINE>this.parser.stopRecordingIdentifiers();<NEW_LINE>if (!initPotentialNamesTables(discouragedNames))<NEW_LINE>return null;<NEW_LINE>this.parentsPtr = -1;<NEW_LINE>this.parents = new ASTNode[10];<NEW_LINE>return fakeMethod;<NEW_LINE>}
resetTo(from + 1, to);
1,470,342
protected final int _find(String sub, PyObject startObj, PyObject endObj) {<NEW_LINE>// Interpret the slice indices as concrete values<NEW_LINE>int[] indices = translateIndices(startObj, endObj);<NEW_LINE><MASK><NEW_LINE>if (subLen == 0) {<NEW_LINE>// Special case: an empty string may be found anywhere, ...<NEW_LINE>int start = indices[2], end = indices[3];<NEW_LINE>if (end < 0 || end < start || start > __len__()) {<NEW_LINE>// ... except ln a reverse slice or beyond the end of the string,<NEW_LINE>return -1;<NEW_LINE>} else {<NEW_LINE>// ... and will be reported at the start of the overlap.<NEW_LINE>return indices[0];<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// General case: search for first match then check against slice.<NEW_LINE>int start = indices[0], end = indices[1];<NEW_LINE>int found = getString().indexOf(sub, start);<NEW_LINE>if (found >= 0 && found + subLen <= end) {<NEW_LINE>return found;<NEW_LINE>} else {<NEW_LINE>return -1;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
int subLen = sub.length();
989,339
private void initLangPrefs() {<NEW_LINE>String[] SUPPORT_LOCALES = { "it", "es", "pt_BR", "ar", "fr", "ru", "bg", "he", "sv", "ca", "ja", "tr", "da", "ko", "uk", "de", "nl", "zh_CN", <MASK><NEW_LINE>Locale[] sortedLocales = new Locale[SUPPORT_LOCALES.length];<NEW_LINE>int count = 0;<NEW_LINE>for (String locale_code : SUPPORT_LOCALES) {<NEW_LINE>Locale l;<NEW_LINE>if (locale_code.indexOf("_") >= 0) {<NEW_LINE>String[] lang_country = locale_code.split("_");<NEW_LINE>l = new Locale(lang_country[0], lang_country[1]);<NEW_LINE>} else {<NEW_LINE>l = new Locale(locale_code);<NEW_LINE>}<NEW_LINE>sortedLocales[count++] = l;<NEW_LINE>}<NEW_LINE>Arrays.sort(sortedLocales, new Comparator<Locale>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public int compare(Locale l1, Locale l2) {<NEW_LINE>return l1.getDisplayLanguage().compareTo(l2.getDisplayLanguage());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>for (Locale l : sortedLocales) {<NEW_LINE>_cmbLang.addItem(l);<NEW_LINE>}<NEW_LINE>_cmbLang.setRenderer(new LocaleListCellRenderer());<NEW_LINE>Locale curLocale = pref.getLocale();<NEW_LINE>_cmbLang.setSelectedItem(curLocale);<NEW_LINE>if (!_cmbLang.getSelectedItem().equals(curLocale)) {<NEW_LINE>if (curLocale.getVariant().length() > 0) {<NEW_LINE>curLocale = new Locale(curLocale.getLanguage(), curLocale.getCountry());<NEW_LINE>_cmbLang.setSelectedItem(curLocale);<NEW_LINE>}<NEW_LINE>if (!_cmbLang.getSelectedItem().equals(curLocale)) {<NEW_LINE>_cmbLang.setSelectedItem(new Locale(curLocale.getLanguage()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
"en_US", "pl", "zh_TW", "ta_IN" };
1,236,520
// Yes, we extend AbstractDoCoMoResultParser since the format is very much<NEW_LINE>// like the DoCoMo MECARD format, but this is not technically one of<NEW_LINE>// DoCoMo's proposed formats<NEW_LINE>@Override<NEW_LINE>public AddressBookParsedResult parse(Result result) {<NEW_LINE>String rawText = getMassagedText(result);<NEW_LINE>if (!rawText.startsWith("BIZCARD:")) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>String firstName = matchSingleDoCoMoPrefixedField("N:", rawText, true);<NEW_LINE>String lastName = matchSingleDoCoMoPrefixedField("X:", rawText, true);<NEW_LINE>String fullName = buildName(firstName, lastName);<NEW_LINE>String title = matchSingleDoCoMoPrefixedField("T:", rawText, true);<NEW_LINE>String org = <MASK><NEW_LINE>String[] addresses = matchDoCoMoPrefixedField("A:", rawText, true);<NEW_LINE>String phoneNumber1 = matchSingleDoCoMoPrefixedField("B:", rawText, true);<NEW_LINE>String phoneNumber2 = matchSingleDoCoMoPrefixedField("M:", rawText, true);<NEW_LINE>String phoneNumber3 = matchSingleDoCoMoPrefixedField("F:", rawText, true);<NEW_LINE>String email = matchSingleDoCoMoPrefixedField("E:", rawText, true);<NEW_LINE>return new AddressBookParsedResult(maybeWrap(fullName), null, null, buildPhoneNumbers(phoneNumber1, phoneNumber2, phoneNumber3), null, maybeWrap(email), null, null, null, addresses, null, org, null, title, null, null);<NEW_LINE>}
matchSingleDoCoMoPrefixedField("C:", rawText, true);
264,108
public DescribeTrustedAdvisorCheckResultResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>DescribeTrustedAdvisorCheckResultResult describeTrustedAdvisorCheckResultResult = new DescribeTrustedAdvisorCheckResultResult();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return describeTrustedAdvisorCheckResultResult;<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("result", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>describeTrustedAdvisorCheckResultResult.setResult(TrustedAdvisorCheckResultJsonUnmarshaller.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 describeTrustedAdvisorCheckResultResult;<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
817,123
public List<StoragePool> select(DiskProfile dskCh, VirtualMachineProfile vmProfile, DeploymentPlan plan, ExcludeList avoid, int returnUpTo, boolean bypassStorageTypeCheck) {<NEW_LINE>List<StoragePool> suitablePools = new ArrayList<StoragePool>();<NEW_LINE>long dcId = plan.getDataCenterId();<NEW_LINE>Long podId = plan.getPodId();<NEW_LINE>Long clusterId = plan.getClusterId();<NEW_LINE>if (podId == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>s_logger.debug("Looking for pools in dc: " + dcId + " pod:" + podId + " cluster:" + clusterId);<NEW_LINE>List<StoragePoolVO> pools = storagePoolDao.listBy(dcId, podId, clusterId, ScopeType.CLUSTER);<NEW_LINE>if (pools.size() == 0) {<NEW_LINE>if (s_logger.isDebugEnabled()) {<NEW_LINE>s_logger.debug("No storage pools available for allocation, returning");<NEW_LINE>}<NEW_LINE>return suitablePools;<NEW_LINE>}<NEW_LINE>Collections.shuffle(pools);<NEW_LINE>if (s_logger.isDebugEnabled()) {<NEW_LINE>s_logger.debug("RandomStoragePoolAllocator has " + <MASK><NEW_LINE>}<NEW_LINE>for (StoragePoolVO pool : pools) {<NEW_LINE>if (suitablePools.size() == returnUpTo) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>StoragePool pol = (StoragePool) this.dataStoreMgr.getPrimaryDataStore(pool.getId());<NEW_LINE>if (filter(avoid, pol, dskCh, plan)) {<NEW_LINE>suitablePools.add(pol);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (s_logger.isDebugEnabled()) {<NEW_LINE>s_logger.debug("RandomStoragePoolAllocator returning " + suitablePools.size() + " suitable storage pools");<NEW_LINE>}<NEW_LINE>return suitablePools;<NEW_LINE>}
pools.size() + " pools to check for allocation");
1,532,885
public Expectations updateExpectationsForConsumerAppOutput(Expectations expectations, String currentAction, JWTTokenBuilder builder) throws Exception {<NEW_LINE>JwtClaims claims = builder.getRawClaims();<NEW_LINE>// Audience can be a list of string values - the order of entries could vary and each element is quoted in on of the outputs that we'll<NEW_LINE>// need to check, so, handle each list element separately<NEW_LINE>List<String> audiences = claims.getAudience();<NEW_LINE>if (audiences != null) {<NEW_LINE>for (String aud : audiences) {<NEW_LINE>expectations = updateConsumerExpectationsForJsonAttribute(expectations, PayloadConstants.AUDIENCE, aud);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>expectations = updateConsumerExpectationsForJsonAttribute(expectations, PayloadConstants.ISSUER, claims.getIssuer());<NEW_LINE>expectations = updateConsumerExpectationsForJsonAttribute(expectations, PayloadConstants.ISSUED_AT, claims.<MASK><NEW_LINE>expectations = updateConsumerExpectationsForJsonAttribute(expectations, PayloadConstants.EXPIRATION_TIME, claims.getExpirationTime().getValue());<NEW_LINE>expectations = updateExpectationsForJsonAttribute(expectations, PayloadConstants.SCOPE, claims.getStringClaimValue(PayloadConstants.SCOPE));<NEW_LINE>expectations = updateConsumerExpectationsForJsonAttribute(expectations, PayloadConstants.SUBJECT, claims.getSubject());<NEW_LINE>expectations = updateExpectationsForJsonAttribute(expectations, PayloadConstants.REALM_NAME, claims.getStringClaimValue(PayloadConstants.REALM_NAME));<NEW_LINE>return expectations;<NEW_LINE>}
getIssuedAt().getValue());
977,136
public void write(T instance, TProtocol protocol) throws Exception {<NEW_LINE>TProtocolWriter writer = new TProtocolWriter(protocol);<NEW_LINE>Short idValue = (Short) getFieldValue(instance, idField.getKey());<NEW_LINE>writer.<MASK><NEW_LINE>if (metadataMap.containsKey(idValue)) {<NEW_LINE>ThriftFieldMetadata fieldMetadata = metadataMap.get(idValue);<NEW_LINE>if (fieldMetadata.isReadOnly() || fieldMetadata.getType() != THRIFT_FIELD) {<NEW_LINE>throw new IllegalStateException(format("Field %s is not readable", fieldMetadata.getName()));<NEW_LINE>}<NEW_LINE>Object fieldValue = getFieldValue(instance, fieldMetadata);<NEW_LINE>// write the field<NEW_LINE>if (fieldValue != null) {<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>ThriftCodec<Object> codec = (ThriftCodec<Object>) fields.get(fieldMetadata.getId());<NEW_LINE>writer.writeField(fieldMetadata.getName(), fieldMetadata.getId(), codec, fieldValue);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>writer.writeStructEnd();<NEW_LINE>}
writeStructBegin(metadata.getStructName());
424,847
private void createDragSource(final Tree tree) {<NEW_LINE>Transfer[] types = new Transfer[] { TextTransfer.getInstance() };<NEW_LINE>int operations = DND.DROP_MOVE;<NEW_LINE>final DragSource source = new DragSource(tree, operations);<NEW_LINE>source.setTransfer(types);<NEW_LINE>source.addDragListener(new DragSourceListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void dragStart(DragSourceEvent event) {<NEW_LINE>TreeItem[<MASK><NEW_LINE>event.doit = selection.length > 0;<NEW_LINE>tree.setData("dragging", 1);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void dragSetData(DragSourceEvent event) {<NEW_LINE>event.data = "drag";<NEW_LINE>event.detail = DND.DROP_MOVE;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void dragFinished(DragSourceEvent event) {<NEW_LINE>tree.setData("dragging", null);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>tree.addDisposeListener(new DisposeListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void widgetDisposed(DisposeEvent e) {<NEW_LINE>source.dispose();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
] selection = tree.getSelection();
406,402
private void findEscapingLiveVars(NonSsaLivenessAnalyzer liveness, Graph cfg, AsyncProgramSplitter splitter, int partIndex, boolean[] output) {<NEW_LINE><MASK><NEW_LINE>Program program = splitter.getProgram(partIndex);<NEW_LINE>int[] successors = splitter.getBlockSuccessors(partIndex);<NEW_LINE>Instruction[] splitPoints = splitter.getSplitPoints(partIndex);<NEW_LINE>int[] originalBlocks = splitter.getOriginalBlocks(partIndex);<NEW_LINE>for (int i = 0; i < program.basicBlockCount(); ++i) {<NEW_LINE>if (successors[i] < 0 || originalBlocks[i] < 0) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// Determine live-out vars<NEW_LINE>BitSet liveVars = new BitSet();<NEW_LINE>for (int succ : cfg.outgoingEdges(originalBlocks[i])) {<NEW_LINE>liveVars.or(liveness.liveIn(succ));<NEW_LINE>}<NEW_LINE>// Remove from live set all variables that are defined in these blocks<NEW_LINE>DefinitionExtractor defExtractor = new DefinitionExtractor();<NEW_LINE>UsageExtractor useExtractor = new UsageExtractor();<NEW_LINE>BasicBlock block = originalProgram.basicBlockAt(originalBlocks[i]);<NEW_LINE>Instruction splitPoint = splitPoints[i].getPrevious();<NEW_LINE>for (Instruction insn = block.getLastInstruction(); insn != splitPoint; insn = insn.getPrevious()) {<NEW_LINE>insn.acceptVisitor(defExtractor);<NEW_LINE>insn.acceptVisitor(useExtractor);<NEW_LINE>for (Variable var : defExtractor.getDefinedVariables()) {<NEW_LINE>liveVars.clear(var.getIndex());<NEW_LINE>}<NEW_LINE>for (Variable var : useExtractor.getUsedVariables()) {<NEW_LINE>liveVars.set(var.getIndex());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Add live variables to output<NEW_LINE>for (int j = liveVars.nextSetBit(0); j >= 0; j = liveVars.nextSetBit(j + 1)) {<NEW_LINE>output[j] = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
Program originalProgram = splitter.getOriginalProgram();
1,235,798
private OrderedTensorType typeWithShapeAsAttribute() {<NEW_LINE>if (attributeMap.getList("shape").isEmpty() || attributeMap.getList("shape").get().size() == 0)<NEW_LINE>throw new IllegalArgumentException("Reshape in " + name + ": Shape attribute is empty.");<NEW_LINE>OrderedTensorType inputType = inputs.get(0)<MASK><NEW_LINE>List<Value> shape = attributeMap.getList("shape").get();<NEW_LINE>List<Integer> dimSizes = new ArrayList<>(shape.size());<NEW_LINE>for (Value v : shape) {<NEW_LINE>int size = (int) v.asDouble();<NEW_LINE>if (size < 0) {<NEW_LINE>int shapeSize = (int) shape.stream().mapToDouble(Value::asDouble).reduce(1, (a, b) -> a * b);<NEW_LINE>int tensorSize = OrderedTensorType.tensorSize(inputType.type()).intValue();<NEW_LINE>size = -1 * shapeSize / tensorSize;<NEW_LINE>}<NEW_LINE>dimSizes.add(size);<NEW_LINE>}<NEW_LINE>return buildOutputType(dimSizes);<NEW_LINE>}
.type().get();
916,554
private void shrink(AtomicBoolean running, boolean full) {<NEW_LINE>int loops = 0;<NEW_LINE>int count = 0;<NEW_LINE>int log = Math.max(10000, connections.size() / 5);<NEW_LINE>Throwable error = null;<NEW_LINE>shrinkTime = ClockUtil.nanoRealtime();<NEW_LINE>Iterator<Connection> iterator = connections.ascendingIterator();<NEW_LINE>try {<NEW_LINE>while (running.get() && iterator.hasNext()) {<NEW_LINE>final Connection connection = iterator.next();<NEW_LINE>if ((++loops % log) == 0) {<NEW_LINE>LOGGER.info("{}shrink {}: {}", tag, loops, connection.getConnectionId());<NEW_LINE>}<NEW_LINE>if (connection.isDouble()) {<NEW_LINE>if (connections.isStale(connection.getConnectionId())) {<NEW_LINE>Runnable removeConnection = new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>LOGGER.trace("{}Remove connection from stale principals", tag);<NEW_LINE>remove(connection, false);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>if (connection.isExecuting()) {<NEW_LINE>connection.getExecutor().execute(removeConnection);<NEW_LINE>} else {<NEW_LINE>remove(connection, false);<NEW_LINE>}<NEW_LINE>++count;<NEW_LINE>} else if (!full) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Throwable ex) {<NEW_LINE>error = ex;<NEW_LINE>} finally {<NEW_LINE>shrinkTime = ClockUtil.nanoRealtime() - shrinkTime;<NEW_LINE>int size = connections.size();<NEW_LINE>int unique = connectionsByPrincipal.size();<NEW_LINE>if (error != null) {<NEW_LINE>LOGGER.error("{}: shrinking failed, {} of {}/{} in {} ms", tag, count, unique, size, TimeUnit.NANOSECONDS.toMillis(shrinkTime), error);<NEW_LINE>} else if (count > 0) {<NEW_LINE>LOGGER.info("{}: shrinked {} of {}/{} in {} ms", tag, count, unique, size, TimeUnit.NANOSECONDS.toMillis(shrinkTime), error);<NEW_LINE>} else {<NEW_LINE>LOGGER.info("{}: nothing shrinked, {}/{} in {} ms", tag, unique, size, TimeUnit.NANOSECONDS<MASK><NEW_LINE>}<NEW_LINE>shrinking.set(false);<NEW_LINE>}<NEW_LINE>}
.toMillis(shrinkTime), error);
509,280
private void activateWidgets() {<NEW_LINE>skipNSRLCheckBox.setSelected(KeywordSearchSettings.getSkipKnown());<NEW_LINE>showSnippetsCB.<MASK><NEW_LINE>boolean ingestRunning = IngestManager.getInstance().isIngestRunning();<NEW_LINE>ingestWarningLabel.setVisible(ingestRunning);<NEW_LINE>skipNSRLCheckBox.setEnabled(!ingestRunning);<NEW_LINE>setTimeSettingEnabled(!ingestRunning);<NEW_LINE>final UpdateFrequency curFreq = KeywordSearchSettings.getUpdateFrequency();<NEW_LINE>switch(curFreq) {<NEW_LINE>case FAST:<NEW_LINE>timeRadioButton1.setSelected(true);<NEW_LINE>break;<NEW_LINE>case AVG:<NEW_LINE>timeRadioButton2.setSelected(true);<NEW_LINE>break;<NEW_LINE>case SLOW:<NEW_LINE>timeRadioButton3.setSelected(true);<NEW_LINE>break;<NEW_LINE>case SLOWEST:<NEW_LINE>timeRadioButton4.setSelected(true);<NEW_LINE>break;<NEW_LINE>case NONE:<NEW_LINE>timeRadioButton5.setSelected(true);<NEW_LINE>break;<NEW_LINE>case DEFAULT:<NEW_LINE>default:<NEW_LINE>// default value<NEW_LINE>timeRadioButton3.setSelected(true);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}
setSelected(KeywordSearchSettings.getShowSnippets());
754,627
private static void tryAssertion56(RegressionEnvironment env, String stmtText, String outputLimit, AtomicInteger milestone) {<NEW_LINE>sendTimer(env, 0);<NEW_LINE>env.compileDeploy(stmtText).addListener("s0");<NEW_LINE>String[] fields = new String[<MASK><NEW_LINE>ResultAssertTestResult expected = new ResultAssertTestResult(CATEGORY, outputLimit, fields);<NEW_LINE>expected.addResultInsert(1200, 0, new Object[][] { { "IBM", 100L, 25d }, { "MSFT", 5000L, 9d } });<NEW_LINE>expected.addResultInsert(2200, 0, new Object[][] { { "IBM", 150L, 49d }, { "YAH", 10000L, 1d }, { "IBM", 155L, 75d } });<NEW_LINE>expected.addResultInsRem(3200, 0, null, null);<NEW_LINE>expected.addResultInsert(4200, 0, new Object[][] { { "YAH", 11000L, 3d } });<NEW_LINE>expected.addResultInsert(5200, 0, new Object[][] { { "IBM", 150L, 97d }, { "YAH", 11500L, 6d } });<NEW_LINE>expected.addResultInsRem(6200, 0, new Object[][] { { "YAH", 10500L, 7d } }, new Object[][] { { "IBM", 100L, 72d } });<NEW_LINE>expected.addResultRemove(7200, 0, new Object[][] { { "MSFT", 5000L, null }, { "IBM", 150L, 48d }, { "YAH", 10000L, 6d } });<NEW_LINE>ResultAssertExecution execution = new ResultAssertExecution(stmtText, env, expected);<NEW_LINE>execution.execute(false, milestone);<NEW_LINE>}
] { "symbol", "volume", "sum(price)" };
1,442,673
private Task<Void> createFileIntentSender(DriveContents driveContents, Bitmap image) {<NEW_LINE>Log.i(TAG, "New contents created.");<NEW_LINE>// Get an output stream for the contents.<NEW_LINE><MASK><NEW_LINE>// Write the bitmap data from it.<NEW_LINE>ByteArrayOutputStream bitmapStream = new ByteArrayOutputStream();<NEW_LINE>image.compress(Bitmap.CompressFormat.PNG, 100, bitmapStream);<NEW_LINE>try {<NEW_LINE>outputStream.write(bitmapStream.toByteArray());<NEW_LINE>} catch (IOException e) {<NEW_LINE>Log.w(TAG, "Unable to write file contents.", e);<NEW_LINE>}<NEW_LINE>// Create the initial metadata - MIME type and title.<NEW_LINE>// Note that the user will be able to change the title later.<NEW_LINE>MetadataChangeSet metadataChangeSet = new MetadataChangeSet.Builder().setMimeType("image/jpeg").setTitle("Android Photo.png").build();<NEW_LINE>// Set up options to configure and display the create file activity.<NEW_LINE>CreateFileActivityOptions createFileActivityOptions = new CreateFileActivityOptions.Builder().setInitialMetadata(metadataChangeSet).setInitialDriveContents(driveContents).build();<NEW_LINE>return mDriveClient.newCreateFileActivityIntentSender(createFileActivityOptions).continueWith(task -> {<NEW_LINE>startIntentSenderForResult(task.getResult(), REQUEST_CODE_CREATOR, null, 0, 0, 0);<NEW_LINE>return null;<NEW_LINE>});<NEW_LINE>}
OutputStream outputStream = driveContents.getOutputStream();
1,692,028
public static ChuteRenderModel create(IBakedModel parent) {<NEW_LINE>if (parent == null) {<NEW_LINE>throw new IllegalStateException("For some reason, the block model for the chute block was missing!" + "\nThis is not meant to happen, you have a bad JAR file!");<NEW_LINE>}<NEW_LINE>List<BakedQuad> lst = Lists.newArrayList(parent.getGeneralQuads());<NEW_LINE>Vector3f eastSouthUp__ = new Vector3f(15 / 16F, 9 / 16F, 15 / 16F);<NEW_LINE>Vector3f eastSouthDown = new Vector3f(11 / 16F, 3 / 16F, 11 / 16F);<NEW_LINE>Vector3f eastNorthUp__ = new Vector3f(15 / 16F, 9 / 16F, 1 / 16F);<NEW_LINE>Vector3f eastNorthDown = new Vector3f(11 / 16F, 3 / 16F, 5 / 16F);<NEW_LINE>Vector3f westSouthUp__ = new Vector3f(1 / 16F, 9 / 16F, 15 / 16F);<NEW_LINE>Vector3f westSouthDown = new Vector3f(5 / 16F, 3 / 16F, 11 / 16F);<NEW_LINE>Vector3f westNorthUp__ = new Vector3f(1 / 16F, 9 / 16F, 1 / 16F);<NEW_LINE>Vector3f westNorthDown = new Vector3f(5 / 16F, 3 / 16F, 5 / 16F);<NEW_LINE>float[] uvs = new float[4];<NEW_LINE>uvs[U_MIN] = sideTexture.getMinU();<NEW_LINE>uvs[U_MAX] = sideTexture.getMaxU();<NEW_LINE>uvs[V_MIN] = sideTexture.getMinV();<NEW_LINE>uvs[V_MAX<MASK><NEW_LINE>MutableQuad[] quads = { //<NEW_LINE>//<NEW_LINE>//<NEW_LINE>ModelUtil.createFace(EnumFacing.EAST, eastNorthDown, eastNorthUp__, eastSouthUp__, eastSouthDown, uvs), //<NEW_LINE>ModelUtil.createFace(EnumFacing.WEST, westSouthDown, westSouthUp__, westNorthUp__, westNorthDown, uvs), //<NEW_LINE>ModelUtil.createFace(EnumFacing.NORTH, westNorthDown, westNorthUp__, eastNorthUp__, eastNorthDown, uvs), ModelUtil.createFace(EnumFacing.SOUTH, eastSouthDown, eastSouthUp__, westSouthUp__, westSouthDown, uvs) };<NEW_LINE>for (MutableQuad q : quads) {<NEW_LINE>q.setCalculatedDiffuse();<NEW_LINE>}<NEW_LINE>ModelUtil.appendBakeQuads(lst, MutableQuad.ITEM_BLOCK_PADDING, quads);<NEW_LINE>return new ChuteRenderModel(ImmutableList.copyOf(lst), parent);<NEW_LINE>}
] = sideTexture.getInterpolatedV(8);
166,073
private static void putRanking(final serverObjects prop, final Map<String, String> map, final String prefix, final String attrExtension) {<NEW_LINE>prop.put("attr" + attrExtension, map.size());<NEW_LINE>String key, description, name, info;<NEW_LINE>int i, j = 0, p;<NEW_LINE>for (final Entry<String, String> entry : map.entrySet()) {<NEW_LINE>key = entry.getKey();<NEW_LINE>description = rankingParameters.get(key.substring(prefix.length()));<NEW_LINE>p = description.indexOf(';', 0);<NEW_LINE>if (p >= 0) {<NEW_LINE>name = description.substring(0, p);<NEW_LINE>info = description.substring(p + 1);<NEW_LINE>} else {<NEW_LINE>name = description;<NEW_LINE>info = "";<NEW_LINE>}<NEW_LINE>prop.put("attr" + attrExtension + "_" + j + "_name", name);<NEW_LINE>prop.put("attr" + attrExtension + "_" + j + "_info", info);<NEW_LINE>prop.put("attr" + attrExtension + "_" + j + "_nameorg", key);<NEW_LINE>prop.put("attr" + attrExtension + "_" + j + "_select", maxRankingRange);<NEW_LINE>for (i = 0; i < maxRankingRange; i++) {<NEW_LINE>prop.put("attr" + attrExtension + "_" + j + "_select_" + i + "_nameorg", key);<NEW_LINE>prop.put("attr" + attrExtension + "_" + j + "_select_" + i + "_value", i);<NEW_LINE>try {<NEW_LINE>prop.put("attr" + attrExtension + "_" + j + "_select_" + i + "_checked", (i == Integer.parseInt(entry.getValue())) ? "1" : "0");<NEW_LINE>} catch (final NumberFormatException e) {<NEW_LINE>prop.put("attr" + attrExtension + "_" + j + <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>prop.put("attr" + attrExtension + "_" + j + "_value", Integer.parseInt(map.get(key)));<NEW_LINE>j++;<NEW_LINE>}<NEW_LINE>}
"_select_" + i + "_checked", "0");
386,639
public void storeDynamicViewStructureMetadata(FacesContext context, UIViewRoot root, FaceletState faceletDynamicState) {<NEW_LINE>DynamicViewKey key = (DynamicViewKey) <MASK><NEW_LINE>MetadataViewKey ordinaryKey = deriveViewKey(context, root);<NEW_LINE>if (!dynamicStructureViewMetadataMap.containsKey(ordinaryKey)) {<NEW_LINE>Map<DynamicViewKey, ViewStructureMetadata> map = dynamicStructureViewMetadataMap.get(ordinaryKey);<NEW_LINE>if (map == null) {<NEW_LINE>map = new ConcurrentHashMap<DynamicViewKey, ViewStructureMetadata>();<NEW_LINE>dynamicStructureViewMetadataMap.put(ordinaryKey, map);<NEW_LINE>}<NEW_LINE>RequestViewContext rvc = RequestViewContext.getCurrentInstance(context);<NEW_LINE>Object state = saveViewRootState(context, root);<NEW_LINE>ViewStructureMetadata metadata = new ViewStructureMetadataImpl(state, rvc.getRequestViewMetadata().cloneInstance());<NEW_LINE>map.put(key, metadata);<NEW_LINE>}<NEW_LINE>}
generateDynamicStructureViewKey(context, root, faceletDynamicState);
557,594
private static ExplainedOptional<TableRefInfo> retrieveTableRefInfo(final ResultSet rs) throws SQLException {<NEW_LINE>final ReferenceId referenceId = ReferenceId.ofRepoId(rs.getInt("AD_Reference_ID"));<NEW_LINE>final String TableName = rs.getString(1);<NEW_LINE>if (!StringUtils.toBoolean(rs.getString("Ref_IsActive"))) {<NEW_LINE>return ExplainedOptional.emptyBecause("AD_Reference with AD_Reference_ID=" + referenceId.getRepoId() + " is not active");<NEW_LINE>}<NEW_LINE>if (!StringUtils.toBoolean(rs.getString("RefTable_IsActive"))) {<NEW_LINE>return ExplainedOptional.emptyBecause("AD_Ref_Table with AD_Reference_ID=" + referenceId.getRepoId() + " is not active");<NEW_LINE>}<NEW_LINE>if (!StringUtils.toBoolean(rs.getString("Table_IsActive"))) {<NEW_LINE>return ExplainedOptional.emptyBecause("Table " + TableName + " is not active");<NEW_LINE>}<NEW_LINE>final String KeyColumn = rs.getString(2);<NEW_LINE>final String DisplayColumn = rs.getString(3);<NEW_LINE>final boolean isValueDisplayed = StringUtils.toBoolean(rs.getString(4));<NEW_LINE>final boolean IsTranslated = StringUtils.toBoolean<MASK><NEW_LINE>final String WhereClause = rs.getString(6);<NEW_LINE>final String OrderByClause = rs.getString(7);<NEW_LINE>final AdWindowId zoomSO_Window_ID = AdWindowId.ofRepoIdOrNull(rs.getInt(8));<NEW_LINE>final AdWindowId zoomPO_Window_ID = AdWindowId.ofRepoIdOrNull(rs.getInt(9));<NEW_LINE>// AD_Table_ID = rs.getInt(10);<NEW_LINE>final String displayColumnSQL = rs.getString(11);<NEW_LINE>final AdWindowId zoomAD_Window_ID_Override = AdWindowId.ofRepoIdOrNull(rs.getInt(12));<NEW_LINE>final boolean autoComplete = StringUtils.toBoolean(rs.getString(13));<NEW_LINE>final boolean showInactiveValues = StringUtils.toBoolean(rs.getString(14));<NEW_LINE>final String referenceName = rs.getString("ReferenceName");<NEW_LINE>final TooltipType tooltipType = TooltipType.ofCode(rs.getString("TooltipType"));<NEW_LINE>return ExplainedOptional.of(TableRefInfo.builder().identifier("AD_Reference[ID=" + referenceId.getRepoId() + ",Name=" + referenceName + "]").tableName(TableName).keyColumn(KeyColumn).displayColumn(DisplayColumn).valueDisplayed(isValueDisplayed).displayColumnSQL(displayColumnSQL).translated(IsTranslated).whereClause(WhereClause).orderByClause(OrderByClause).zoomSO_Window_ID(zoomSO_Window_ID).zoomPO_Window_ID(zoomPO_Window_ID).zoomAD_Window_ID_Override(zoomAD_Window_ID_Override).autoComplete(autoComplete).showInactiveValues(showInactiveValues).tooltipType(tooltipType).build());<NEW_LINE>}
(rs.getString(5));