idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
1,210,666
protected void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>setContentView(R.layout.activity_main);<NEW_LINE>// get our list view<NEW_LINE>ListView theListView = <MASK><NEW_LINE>// prepare elements to display<NEW_LINE>final ArrayList<Item> items = Item.getTestingList();<NEW_LINE>// add custom btn handler to first list item<NEW_LINE>items.get(0).setRequestBtnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>Toast.makeText(getApplicationContext(), "CUSTOM HANDLER FOR FIRST BUTTON", Toast.LENGTH_SHORT).show();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>// create custom adapter that holds elements and their state (we need hold a id's of unfolded elements for reusable elements)<NEW_LINE>final FoldingCellListAdapter adapter = new FoldingCellListAdapter(this, items);<NEW_LINE>// add default btn handler for each request btn on each item if custom handler not found<NEW_LINE>adapter.setDefaultRequestBtnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>Toast.makeText(getApplicationContext(), "DEFAULT HANDLER FOR ALL BUTTONS", Toast.LENGTH_SHORT).show();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>// set elements to adapter<NEW_LINE>theListView.setAdapter(adapter);<NEW_LINE>// set on click event listener to list view<NEW_LINE>theListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onItemClick(AdapterView<?> adapterView, View view, int pos, long l) {<NEW_LINE>// toggle clicked cell state<NEW_LINE>((FoldingCell) view).toggle(false);<NEW_LINE>// register in adapter that state for selected cell is toggled<NEW_LINE>adapter.registerToggle(pos);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
findViewById(R.id.mainListView);
216,050
private void translate_2(final ITranslationEnvironment environment, final IInstruction instruction, final List<ReilInstruction> instructions) throws InternalTranslationException {<NEW_LINE>final List<? extends IOperandTree> operands = instruction.getOperands();<NEW_LINE>final long baseOffset = instruction.getAddress().toLong() * 0x100;<NEW_LINE>long offset = baseOffset;<NEW_LINE>// Load source operand.<NEW_LINE>final TranslationResult firstResult = Helpers.translateOperand(environment, offset, operands<MASK><NEW_LINE>instructions.addAll(firstResult.getInstructions());<NEW_LINE>offset = baseOffset + instructions.size();<NEW_LINE>// Load second operand.<NEW_LINE>final TranslationResult secondResult = Helpers.translateOperand(environment, offset, operands.get(1), true);<NEW_LINE>instructions.addAll(secondResult.getInstructions());<NEW_LINE>offset = baseOffset + instructions.size();<NEW_LINE>// IMUL instructions with 2 or 3 operands must have an output register<NEW_LINE>final OperandSize resultSize = OperandSize.sizeStringToValue(operands.get(0).getRootNode().getValue());<NEW_LINE>final String resultRegister = operands.get(0).getRootNode().getChildren().get(0).getValue();<NEW_LINE>generateImul3(environment, offset, resultSize, resultRegister, firstResult.getSize(), firstResult.getRegister(), secondResult.getSize(), secondResult.getRegister(), instructions);<NEW_LINE>}
.get(0), true);
892,919
public Statistics unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>Statistics statistics = new Statistics();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("approximateNumberOfObjectsToProcess", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>statistics.setApproximateNumberOfObjectsToProcess(context.getUnmarshaller(Double.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("numberOfRuns", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>statistics.setNumberOfRuns(context.getUnmarshaller(Double.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 statistics;<NEW_LINE>}
class).unmarshall(context));
1,370,457
public DeleteRegistrationCodeResult deleteRegistrationCode(DeleteRegistrationCodeRequest deleteRegistrationCodeRequest) throws AmazonServiceException, AmazonClientException {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteRegistrationCodeRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteRegistrationCodeRequest> request = null;<NEW_LINE>Response<DeleteRegistrationCodeResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteRegistrationCodeRequestMarshaller().marshall(deleteRegistrationCodeRequest);<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>Unmarshaller<DeleteRegistrationCodeResult, JsonUnmarshallerContext> unmarshaller = new DeleteRegistrationCodeResultJsonUnmarshaller();<NEW_LINE>JsonResponseHandler<DeleteRegistrationCodeResult> responseHandler = new JsonResponseHandler<DeleteRegistrationCodeResult>(unmarshaller);<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.ClientExecuteTime);<NEW_LINE>endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
1,743,629
public static DescribeRegionsResponse unmarshall(DescribeRegionsResponse describeRegionsResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeRegionsResponse.setRequestId(_ctx.stringValue("DescribeRegionsResponse.RequestId"));<NEW_LINE>describeRegionsResponse.setTotalCount(_ctx.integerValue("DescribeRegionsResponse.TotalCount"));<NEW_LINE>describeRegionsResponse.setPageSize(_ctx.integerValue("DescribeRegionsResponse.PageSize"));<NEW_LINE>describeRegionsResponse.setPageNumber(_ctx.integerValue("DescribeRegionsResponse.PageNumber"));<NEW_LINE>List<Region> regions = new ArrayList<Region>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeRegionsResponse.Regions.Length"); i++) {<NEW_LINE>Region region = new Region();<NEW_LINE>region.setRegionId(_ctx.stringValue("DescribeRegionsResponse.Regions[" + i + "].RegionId"));<NEW_LINE>region.setLocalName(_ctx.stringValue("DescribeRegionsResponse.Regions[" + i + "].LocalName"));<NEW_LINE>region.setRegionEndpoint(_ctx.stringValue<MASK><NEW_LINE>regions.add(region);<NEW_LINE>}<NEW_LINE>describeRegionsResponse.setRegions(regions);<NEW_LINE>return describeRegionsResponse;<NEW_LINE>}
("DescribeRegionsResponse.Regions[" + i + "].RegionEndpoint"));
1,726,530
private void loadExtend() {<NEW_LINE>Iterator<HealthCheckProcessor> processorIt = processors.iterator();<NEW_LINE>Iterator<AbstractHealthChecker> healthCheckerIt = checkers.iterator();<NEW_LINE>Set<String> origin = new HashSet<>();<NEW_LINE>for (HealthCheckType type : HealthCheckType.values()) {<NEW_LINE>origin.add(type.name());<NEW_LINE>}<NEW_LINE>Set<String> processorType = new HashSet<>(origin);<NEW_LINE>Set<String> healthCheckerType = new HashSet<>(origin);<NEW_LINE>while (processorIt.hasNext()) {<NEW_LINE>HealthCheckProcessor processor = processorIt.next();<NEW_LINE>String type = processor.getType();<NEW_LINE>if (processorType.contains(type)) {<NEW_LINE>throw new RuntimeException("More than one processor of the same type was found : [type=\"" + type + "\"]");<NEW_LINE>}<NEW_LINE>processorType.add(type);<NEW_LINE>registry.registerSingleton(lowerFirstChar(processor.getClass().getSimpleName()), processor);<NEW_LINE>}<NEW_LINE>while (healthCheckerIt.hasNext()) {<NEW_LINE>AbstractHealthChecker checker = healthCheckerIt.next();<NEW_LINE>String type = checker.getType();<NEW_LINE>if (healthCheckerType.contains(type)) {<NEW_LINE>throw new RuntimeException("More than one healthChecker of the same type was found : [type=\"" + type + "\"]");<NEW_LINE>}<NEW_LINE>healthCheckerType.add(type);<NEW_LINE>HealthCheckType.registerHealthChecker(checker.getType(<MASK><NEW_LINE>}<NEW_LINE>if (!processorType.equals(healthCheckerType)) {<NEW_LINE>throw new RuntimeException("An unmatched processor and healthChecker are detected in the extension package.");<NEW_LINE>}<NEW_LINE>if (processorType.size() > origin.size()) {<NEW_LINE>processorType.removeAll(origin);<NEW_LINE>LOGGER.debug("init health plugin : types=" + processorType);<NEW_LINE>}<NEW_LINE>}
), checker.getClass());
169,857
/* (non-Javadoc)<NEW_LINE>* @see org.netbeans.api.debugger.DebuggerManagerListener#breakpointAdded(org.netbeans.api.debugger.Breakpoint)<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public void breakpointAdded(Breakpoint breakpoint) {<NEW_LINE>JSLineBreakpoint lb = null;<NEW_LINE>AbstractBreakpoint ab = null;<NEW_LINE>if (breakpoint instanceof JSLineBreakpoint) {<NEW_LINE>lb = (JSLineBreakpoint) breakpoint;<NEW_LINE>if (!acceptBreakpoint(lb)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} else if (breakpoint instanceof AbstractBreakpoint) {<NEW_LINE>ab = (AbstractBreakpoint) breakpoint;<NEW_LINE>} else {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final Breakpoint b = (lb != null) ? lb : ab;<NEW_LINE>synchronized (breakpointImpls) {<NEW_LINE>if (breakpointImpls.containsKey(b)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>SourceMapsTranslator scannedSMT = SourceMapsScanner.getInstance().scan(pc.getProject());<NEW_LINE><MASK><NEW_LINE>final WebKitBreakpointManager bm = (lb != null) ? createWebKitBreakpointManager(lb) : createWebKitBreakpointManager(ab);<NEW_LINE>synchronized (breakpointImpls) {<NEW_LINE>if (breakpointImpls.containsKey(b)) {<NEW_LINE>// Added in between, destroy the one created redundantly.<NEW_LINE>bm.destroy();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>breakpointImpls.put(b, bm);<NEW_LINE>}<NEW_LINE>if (b.isEnabled()) {<NEW_LINE>RP.post(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>bm.add();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}
MiscEditorUtil.registerProjectsSourceMapTranslator(d, scannedSMT);
922,014
public void marshall(VpcPeeringConnection vpcPeeringConnection, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (vpcPeeringConnection == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(vpcPeeringConnection.getFleetId(), FLEETID_BINDING);<NEW_LINE>protocolMarshaller.marshall(vpcPeeringConnection.getFleetArn(), FLEETARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(vpcPeeringConnection.getIpV4CidrBlock(), IPV4CIDRBLOCK_BINDING);<NEW_LINE>protocolMarshaller.marshall(vpcPeeringConnection.getVpcPeeringConnectionId(), VPCPEERINGCONNECTIONID_BINDING);<NEW_LINE>protocolMarshaller.marshall(vpcPeeringConnection.getStatus(), STATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(vpcPeeringConnection.getGameLiftVpcId(), GAMELIFTVPCID_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
vpcPeeringConnection.getPeerVpcId(), PEERVPCID_BINDING);
964,847
static Optional<List<Long>> readInt64Array(GenericRecord record, Schema.Type avroType, String fieldName) {<NEW_LINE>Object fieldValue = record.get(fieldName);<NEW_LINE>if (fieldValue == null) {<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>switch(avroType) {<NEW_LINE>// For type check at compile time, the type of x has to be specified (as cast) so that<NEW_LINE>// convertability to long can be verified.<NEW_LINE>case LONG:<NEW_LINE>return Optional.of(<MASK><NEW_LINE>case INT:<NEW_LINE>{<NEW_LINE>List<Integer> value = (List<Integer>) fieldValue;<NEW_LINE>return Optional.of(value.stream().map(x -> x == null ? null : Long.valueOf(x)).collect(Collectors.toList()));<NEW_LINE>}<NEW_LINE>case STRING:<NEW_LINE>{<NEW_LINE>List<Utf8> value = (List<Utf8>) fieldValue;<NEW_LINE>return Optional.of(value.stream().map(x -> x == null ? null : Long.valueOf(x.toString())).collect(Collectors.toList()));<NEW_LINE>}<NEW_LINE>default:<NEW_LINE>throw new IllegalArgumentException("Cannot interpret " + avroType + " as INT64");<NEW_LINE>}<NEW_LINE>}
(List<Long>) fieldValue);
1,119,509
protected Key engineUnwrap(byte[] wrappedKey, String wrappedKeyAlgorithm, int wrappedKeyType) throws InvalidKeyException, NoSuchAlgorithmException {<NEW_LINE>// TODO: add support for other types.<NEW_LINE>if (wrappedKeyType != Cipher.SECRET_KEY) {<NEW_LINE>throw new InvalidKeyException("only SECRET_KEY supported");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>SABERKEMExtractor kemExt = new SABERKEMExtractor(unwrapKey.getKeyParams());<NEW_LINE>byte[] secret = kemExt.extractSecret(Arrays.copyOfRange(wrappedKey, 0, kemExt.getInputSize()));<NEW_LINE>Wrapper kWrap = WrapUtil.getWrapper(kemParameterSpec.getKeyAlgorithmName());<NEW_LINE>KeyParameter keyParameter = new KeyParameter(secret);<NEW_LINE>Arrays.clear(secret);<NEW_LINE>kWrap.init(false, keyParameter);<NEW_LINE>byte[] keyEncBytes = Arrays.copyOfRange(wrappedKey, kemExt.getInputSize(), wrappedKey.length);<NEW_LINE>SecretKey rv = new SecretKeySpec(kWrap.unwrap(keyEncBytes, 0, keyEncBytes.length), wrappedKeyAlgorithm);<NEW_LINE>Arrays.clear(keyParameter.getKey());<NEW_LINE>return rv;<NEW_LINE>} catch (IllegalArgumentException e) {<NEW_LINE>throw new NoSuchAlgorithmException(<MASK><NEW_LINE>} catch (InvalidCipherTextException e) {<NEW_LINE>throw new InvalidKeyException("unable to extract KTS secret: " + e.getMessage());<NEW_LINE>}<NEW_LINE>}
"unable to extract KTS secret: " + e.getMessage());
1,241,391
public void mouseReleased(final MouseEvent me) {<NEW_LINE>if (!armed)<NEW_LINE>return;<NEW_LINE>armed = false;<NEW_LINE>if (zoomType == ZoomType.PANNING)<NEW_LINE>setCursor(zoomType.getCursor());<NEW_LINE>if (end == null || start == null)<NEW_LINE>return;<NEW_LINE>switch(zoomType) {<NEW_LINE>case RUBBERBAND_ZOOM:<NEW_LINE>for (Axis axis : xyGraph.getXAxisList()) {<NEW_LINE>final double t1 = axis.getPositionValue(start.x, false);<NEW_LINE>final double t2 = axis.getPositionValue(end.x, false);<NEW_LINE>axis.setRange(t1, t2, true);<NEW_LINE>}<NEW_LINE>for (Axis axis : xyGraph.getYAxisList()) {<NEW_LINE>final double t1 = axis.getPositionValue(start.y, false);<NEW_LINE>final double t2 = axis.getPositionValue(end.y, false);<NEW_LINE>axis.setRange(t1, t2, true);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case HORIZONTAL_ZOOM:<NEW_LINE>// scouter.porject 20150902<NEW_LINE>setCursor(<MASK><NEW_LINE>for (Axis axis : xyGraph.getXAxisList()) {<NEW_LINE>final double t1 = axis.getPositionValue(start.x, false);<NEW_LINE>final double t2 = axis.getPositionValue(end.x, false);<NEW_LINE>// scouter.porject 20150707<NEW_LINE>changeSupport.firePropertyChange("horizontal_range", axis.getRange(), new Range(t1, t2));<NEW_LINE>if (horizontalZoomEnabled) {<NEW_LINE>axis.setRange(t1, t2, true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case VERTICAL_ZOOM:<NEW_LINE>for (Axis axis : xyGraph.getYAxisList()) {<NEW_LINE>final double t1 = axis.getPositionValue(start.y, false);<NEW_LINE>final double t2 = axis.getPositionValue(end.y, false);<NEW_LINE>axis.setRange(t1, t2, true);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case PANNING:<NEW_LINE>pan();<NEW_LINE>break;<NEW_LINE>case ZOOM_IN:<NEW_LINE>case ZOOM_IN_HORIZONTALLY:<NEW_LINE>case ZOOM_IN_VERTICALLY:<NEW_LINE>case ZOOM_OUT:<NEW_LINE>case ZOOM_OUT_HORIZONTALLY:<NEW_LINE>case ZOOM_OUT_VERTICALLY:<NEW_LINE>performInOutZoom();<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (zoomType != ZoomType.NONE && command != null) {<NEW_LINE>command.saveState();<NEW_LINE>xyGraph.getOperationsManager().addCommand(command);<NEW_LINE>command = null;<NEW_LINE>}<NEW_LINE>start = null;<NEW_LINE>end = null;<NEW_LINE>PlotArea.this.repaint();<NEW_LINE>}
ZoomType.NONE.getCursor());
1,791,849
public JSDynamicObject createPrototype(JSRealm realm, JSFunctionObject ctor) {<NEW_LINE>JSContext ctx = realm.getContext();<NEW_LINE>Shape protoShape = JSShape.createPrototypeShape(ctx, INSTANCE, realm.getObjectPrototype());<NEW_LINE>JSObject arrayPrototype = JSArrayObject.createEmpty(protoShape, ConstantEmptyPrototypeArray.createConstantEmptyPrototypeArray());<NEW_LINE>JSObjectUtil.setOrVerifyPrototype(ctx, arrayPrototype, realm.getObjectPrototype());<NEW_LINE>putConstructorProperty(ctx, arrayPrototype, ctor);<NEW_LINE>putFunctionsFromContainer(realm, arrayPrototype, ArrayPrototypeBuiltins.BUILTINS);<NEW_LINE>// sets the length just for the prototype<NEW_LINE>// putProxyProperty(arrayPrototype, ARRAY_LENGTH_PROXY_PROPERTY);<NEW_LINE>JSObjectUtil.putProxyProperty(arrayPrototype, LENGTH, ARRAY_LENGTH_PROPERTY_PROXY, JSAttributes.notConfigurableNotEnumerableWritable());<NEW_LINE>if (ctx.getEcmaScriptVersion() >= 6) {<NEW_LINE>// The initial value of the @@iterator property is the same function object as the<NEW_LINE>// initial value of the Array.prototype.values property.<NEW_LINE>putDataProperty(ctx, arrayPrototype, Symbol.SYMBOL_ITERATOR, JSDynamicObject.getOrNull(arrayPrototype, Strings.VALUES), JSAttributes.getDefaultNotEnumerable());<NEW_LINE>putDataProperty(ctx, arrayPrototype, Symbol.SYMBOL_UNSCOPABLES, createUnscopables(ctx, unscopableNameList(ctx)<MASK><NEW_LINE>}<NEW_LINE>return arrayPrototype;<NEW_LINE>}
), JSAttributes.configurableNotEnumerableNotWritable());
3,862
private void updatePaint() {<NEW_LINE>if (!mGradientIsDirty)<NEW_LINE>return;<NEW_LINE>mGradientIsDirty = false;<NEW_LINE>LinearGradient gradient = null;<NEW_LINE>final Rect bounds = getBounds();<NEW_LINE>int cx = bounds.centerX();<NEW_LINE>int cy = bounds.centerY();<NEW_LINE>switch(mGradientType) {<NEW_LINE>// VERTICAL<NEW_LINE>case GradientType.TOP_TO_BOTTOM:<NEW_LINE>gradient = new LinearGradient(cx, bounds.top + borderWidth, cx, bounds.bottom - borderWidth, gradientColors, null, Shader.TileMode.CLAMP);<NEW_LINE>break;<NEW_LINE>case GradientType.BOTTOM_TO_TOP:<NEW_LINE>gradient = new LinearGradient(cx, bounds.bottom - borderWidth, cx, bounds.top + borderWidth, gradientColors, null, Shader.TileMode.CLAMP);<NEW_LINE>break;<NEW_LINE>// HORIZONTAL<NEW_LINE>case GradientType.LEFT_TO_RIGHT:<NEW_LINE>gradient = new LinearGradient(bounds.left + borderWidth, cy, bounds.right - borderWidth, cy, gradientColors, <MASK><NEW_LINE>break;<NEW_LINE>case GradientType.RIGHT_TO_LEFT:<NEW_LINE>gradient = new LinearGradient(bounds.right - borderWidth, cy, bounds.left + borderWidth, cy, gradientColors, null, Shader.TileMode.CLAMP);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (gradient != null) {<NEW_LINE>backgroundPaint.setColor(Color.BLACK);<NEW_LINE>backgroundPaint.setShader(gradient);<NEW_LINE>}<NEW_LINE>}
null, Shader.TileMode.CLAMP);
119,820
public void decode(double[] input, SceneStructureMetric structure) {<NEW_LINE>int index = 0;<NEW_LINE>for (int i = 0; i < structure.points.size; i++) {<NEW_LINE>SceneStructureCommon.Point p = structure.points.data[i];<NEW_LINE>p.coordinate[0] = input[index++];<NEW_LINE>p.coordinate[1] = input[index++];<NEW_LINE>p.coordinate[2] = input[index++];<NEW_LINE>if (structure.isHomogenous())<NEW_LINE>p.coordinate[3] = input[index++];<NEW_LINE>}<NEW_LINE>for (int rigidIndex = 0; rigidIndex < structure.rigids.size; rigidIndex++) {<NEW_LINE>SceneStructureMetric.Rigid rigid = structure.rigids.data[rigidIndex];<NEW_LINE>// Decode the rigid body transform from object to world<NEW_LINE>if (rigid.known)<NEW_LINE>continue;<NEW_LINE>rotation.setParameters(input, index);<NEW_LINE>rigid.object_to_world.R.setTo(rotation.getRotationMatrix());<NEW_LINE>index += rotation.getParameterLength();<NEW_LINE>rigid.object_to_world.T.x = input[index++];<NEW_LINE>rigid.object_to_world.T.y = input[index++];<NEW_LINE>rigid.object_to_world.T.z = input[index++];<NEW_LINE>}<NEW_LINE>for (int motionIndex = 0; motionIndex < structure.motions.size; motionIndex++) {<NEW_LINE>SceneStructureMetric.Motion motion = structure.motions.data[motionIndex];<NEW_LINE>// Decode the rigid body transform from world to view<NEW_LINE>if (motion.known)<NEW_LINE>continue;<NEW_LINE>rotation.setParameters(input, index);<NEW_LINE>motion.motion.R.setTo(rotation.getRotationMatrix());<NEW_LINE>index += rotation.getParameterLength();<NEW_LINE>motion.motion.T.x = input[index++];<NEW_LINE>motion.motion.T<MASK><NEW_LINE>motion.motion.T.z = input[index++];<NEW_LINE>}<NEW_LINE>for (int i = 0; i < structure.cameras.size; i++) {<NEW_LINE>SceneStructureCommon.Camera camera = structure.cameras.data[i];<NEW_LINE>if (camera.known)<NEW_LINE>continue;<NEW_LINE>camera.model.setIntrinsic(input, index);<NEW_LINE>index += camera.model.getIntrinsicCount();<NEW_LINE>}<NEW_LINE>}
.y = input[index++];
482,177
public void apply(Project project) {<NEW_LINE>project.getPlugins().apply(JavaLibraryConvention.class);<NEW_LINE>NamedDomainObjectProvider<Configuration> voltron = project.getConfigurations().register(VOLTRON_CONFIGURATION_NAME, config -> {<NEW_LINE>config.setDescription("Dependencies provided by Voltron from server/lib");<NEW_LINE>config.setCanBeConsumed(true);<NEW_LINE>config.setCanBeResolved(true);<NEW_LINE>DependencyHandler dependencyHandler = project.getDependencies();<NEW_LINE>String terracottaApisVersion = project.property("terracottaApisVersion").toString();<NEW_LINE>String slf4jVersion = project.property("slf4jVersion").toString();<NEW_LINE>config.getDependencies().add(dependencyHandler.create("org.terracotta:entity-server-api:" + terracottaApisVersion));<NEW_LINE>config.getDependencies().add(dependencyHandler.create("org.terracotta:standard-cluster-services:" + terracottaApisVersion));<NEW_LINE>config.getDependencies().add(dependencyHandler.create("org.terracotta:packaging-support:" + terracottaApisVersion));<NEW_LINE>config.getDependencies().add(dependencyHandler.create("org.slf4j:slf4j-api:" + slf4jVersion));<NEW_LINE>});<NEW_LINE>NamedDomainObjectProvider<Configuration> service = project.getConfigurations().register(SERVICE_CONFIGURATION_NAME, config -> {<NEW_LINE>config.setDescription("Services consumed by this plugin");<NEW_LINE>config.setCanBeResolved(true);<NEW_LINE>config.setCanBeConsumed(true);<NEW_LINE>});<NEW_LINE>project.getConfigurations().named(JavaPlugin.API_CONFIGURATION_NAME, config -> {<NEW_LINE>config.<MASK><NEW_LINE>config.extendsFrom(service.get());<NEW_LINE>});<NEW_LINE>project.getTasks().named(JavaPlugin.JAR_TASK_NAME, Jar.class, jar -> {<NEW_LINE>// noinspection Convert2Lambda<NEW_LINE>jar.doFirst(new Action<Task>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void execute(Task task) {<NEW_LINE>jar.manifest(manifest -> manifest.attributes(singletonMap(Attributes.Name.CLASS_PATH.toString(), (project.getConfigurations().getByName(JavaPlugin.RUNTIME_CLASSPATH_CONFIGURATION_NAME).minus(voltron.get()).minus(service.get())).getFiles().stream().map(File::getName).collect(Collectors.joining(" ")))));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>});<NEW_LINE>}
extendsFrom(voltron.get());
560,803
public static Executable storeAllPingData(Map<UUID, List<Ping>> ofUsers) {<NEW_LINE>if (ofUsers == null || ofUsers.isEmpty())<NEW_LINE>return Executable.empty();<NEW_LINE>return new ExecBatchStatement(PingTable.INSERT_STATEMENT) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void prepare(PreparedStatement statement) throws SQLException {<NEW_LINE>for (Map.Entry<UUID, List<Ping>> entry : ofUsers.entrySet()) {<NEW_LINE><MASK><NEW_LINE>List<Ping> pings = entry.getValue();<NEW_LINE>for (Ping ping : pings) {<NEW_LINE>ServerUUID serverUUID = ping.getServerUUID();<NEW_LINE>long date = ping.getDate();<NEW_LINE>int minPing = ping.getMin();<NEW_LINE>int maxPing = ping.getMax();<NEW_LINE>double avgPing = ping.getAverage();<NEW_LINE>statement.setString(1, uuid.toString());<NEW_LINE>statement.setString(2, serverUUID.toString());<NEW_LINE>statement.setLong(3, date);<NEW_LINE>statement.setInt(4, minPing);<NEW_LINE>statement.setInt(5, maxPing);<NEW_LINE>statement.setDouble(6, avgPing);<NEW_LINE>statement.addBatch();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
UUID uuid = entry.getKey();
367,970
public boolean isResource(String uri, User user) throws IOException {<NEW_LINE>uri = stripMapping(uri);<NEW_LINE>Logger.debug(this.getClass(), "In the Method isResource");<NEW_LINE>if (uri.endsWith("/")) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>boolean returnValue = false;<NEW_LINE>// Host<NEW_LINE>String hostName = getHostname(uri);<NEW_LINE>Host host;<NEW_LINE>try {<NEW_LINE>host = hostAPI.findByName(hostName, user, false);<NEW_LINE>} catch (DotDataException e) {<NEW_LINE>Logger.error(DotWebdavHelper.class, e.getMessage(), e);<NEW_LINE>throw new IOException(<MASK><NEW_LINE>} catch (DotSecurityException e) {<NEW_LINE>Logger.error(DotWebdavHelper.class, e.getMessage(), e);<NEW_LINE>throw new IOException(e.getMessage(), e);<NEW_LINE>}<NEW_LINE>if (host == null) {<NEW_LINE>Logger.debug(this, "isResource Method: Host is NULL");<NEW_LINE>} else {<NEW_LINE>Logger.debug(this, "isResource Method: host id is " + host.getIdentifier() + " and the host name is " + host.getHostname());<NEW_LINE>}<NEW_LINE>// Folder<NEW_LINE>String path = getPath(uri);<NEW_LINE>String folderName = getFolderName(path);<NEW_LINE>Folder folder;<NEW_LINE>try {<NEW_LINE>folder = folderAPI.findFolderByPath(folderName, host, user, false);<NEW_LINE>} catch (Exception e) {<NEW_LINE>Logger.error(DotWebdavHelper.class, e.getMessage(), e);<NEW_LINE>throw new IOException(e.getMessage(), e);<NEW_LINE>}<NEW_LINE>if (folder != null && InodeUtils.isSet(folder.getInode())) {<NEW_LINE>// FileName<NEW_LINE>String fileName = getFileName(path);<NEW_LINE>fileName = deleteSpecialCharacter(fileName);<NEW_LINE>if (InodeUtils.isSet(host.getInode())) {<NEW_LINE>try {<NEW_LINE>returnValue = APILocator.getFileAssetAPI().fileNameExists(host, folder, fileName, "");<NEW_LINE>} catch (Exception ex) {<NEW_LINE>Logger.debug(this, "Error verifying if file already exists", ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return returnValue;<NEW_LINE>}
e.getMessage(), e);
1,006,196
private void taskFinished(TaskInstance taskInstance) {<NEW_LINE>logger.info("work flow {} task id:{} code:{} state:{} ", processInstance.getId(), taskInstance.getId(), taskInstance.getTaskCode(), taskInstance.getState());<NEW_LINE>activeTaskProcessorMaps.remove(taskInstance.getTaskCode());<NEW_LINE>stateWheelExecuteThread.removeTask4TimeoutCheck(processInstance, taskInstance);<NEW_LINE>stateWheelExecuteThread.removeTask4RetryCheck(processInstance, taskInstance);<NEW_LINE>stateWheelExecuteThread.removeTask4StateCheck(processInstance, taskInstance);<NEW_LINE>if (taskInstance.getState().typeIsSuccess()) {<NEW_LINE>completeTaskMap.put(taskInstance.getTaskCode(), taskInstance.getId());<NEW_LINE>processService.saveProcessInstance(processInstance);<NEW_LINE>if (!processInstance.isBlocked()) {<NEW_LINE>submitPostNode(Long.toString(taskInstance.getTaskCode()));<NEW_LINE>}<NEW_LINE>} else if (taskInstance.taskCanRetry() && processInstance.getState() != ExecutionStatus.READY_STOP) {<NEW_LINE>// retry task<NEW_LINE>retryTaskInstance(taskInstance);<NEW_LINE>} else if (taskInstance.getState().typeIsFailure()) {<NEW_LINE>completeTaskMap.put(taskInstance.getTaskCode(<MASK><NEW_LINE>if (taskInstance.isConditionsTask() || DagHelper.haveConditionsAfterNode(Long.toString(taskInstance.getTaskCode()), dag) || DagHelper.haveBlockingAfterNode(Long.toString(taskInstance.getTaskCode()), dag)) {<NEW_LINE>submitPostNode(Long.toString(taskInstance.getTaskCode()));<NEW_LINE>} else {<NEW_LINE>errorTaskMap.put(taskInstance.getTaskCode(), taskInstance.getId());<NEW_LINE>if (processInstance.getFailureStrategy() == FailureStrategy.END) {<NEW_LINE>killAllTasks();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (taskInstance.getState().typeIsFinished()) {<NEW_LINE>completeTaskMap.put(taskInstance.getTaskCode(), taskInstance.getId());<NEW_LINE>}<NEW_LINE>this.updateProcessInstanceState();<NEW_LINE>}
), taskInstance.getId());
1,453,607
// End of variables declaration//GEN-END:variables<NEW_LINE>@Override<NEW_LINE>public void valueChanged(ListSelectionEvent e) {<NEW_LINE>if (e.getValueIsAdjusting()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>configurationPanel.removeAll();<NEW_LINE>ListSelectionModel m = <MASK><NEW_LINE>// single selection, so max selection index is the only one selected.<NEW_LINE>selectedIndex = m.getMaxSelectionIndex();<NEW_LINE>ReportModule module = modules.get(selectedIndex);<NEW_LINE>JPanel panel = module.getConfigurationPanel();<NEW_LINE>if (panel == null) {<NEW_LINE>panel = new JPanel();<NEW_LINE>}<NEW_LINE>descriptionTextPane.setText(module.getDescription());<NEW_LINE>configurationPanel.add(panel, BorderLayout.CENTER);<NEW_LINE>configurationPanel.revalidate();<NEW_LINE>configurationPanel.repaint();<NEW_LINE>// General modules that support data source selection will be presented<NEW_LINE>// a data source selection panel, so they should not be finished immediately.<NEW_LINE>boolean generalModuleSelected = (module instanceof GeneralReportModule) && (!((GeneralReportModule) module).supportsDataSourceSelection() || !displayCaseSpecificData);<NEW_LINE>wizPanel.setNext(!generalModuleSelected);<NEW_LINE>wizPanel.setFinish(generalModuleSelected);<NEW_LINE>}
(ListSelectionModel) e.getSource();
77,447
private <T> Optional<Set<String>> filterString(TupleDomain<T> constraint, T column) {<NEW_LINE>if (constraint.isNone()) {<NEW_LINE>return Optional.of(ImmutableSet.of());<NEW_LINE>}<NEW_LINE>Domain domain = constraint.getDomains().get().get(column);<NEW_LINE>if (domain == null) {<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>if (domain.isSingleValue()) {<NEW_LINE>return Optional.of(ImmutableSet.of(((Slice) domain.getSingleValue()).toStringUtf8()));<NEW_LINE>}<NEW_LINE>if (domain.getValues() instanceof EquatableValueSet) {<NEW_LINE>Collection<Object> values = ((EquatableValueSet) domain.getValues()).getValues();<NEW_LINE>return Optional.of(values.stream().map(Slice.class::cast).map(Slice::toStringUtf8).collect(toImmutableSet()));<NEW_LINE>}<NEW_LINE>if (domain.getValues() instanceof SortedRangeSet) {<NEW_LINE>ImmutableSet.Builder<String<MASK><NEW_LINE>for (Range range : domain.getValues().getRanges().getOrderedRanges()) {<NEW_LINE>if (!range.isSingleValue()) {<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>result.add(((Slice) range.getSingleValue()).toStringUtf8());<NEW_LINE>}<NEW_LINE>return Optional.of(result.build());<NEW_LINE>}<NEW_LINE>return Optional.empty();<NEW_LINE>}
> result = ImmutableSet.builder();
78,559
private DoubleObjPair<Polygon> buildHullsRecursively(Cluster<Model> clu, Hierarchy<Cluster<Model>> hier, Map<Object, DoubleObjPair<Polygon>> hulls, Relation<? extends NumberVector> coords) {<NEW_LINE>final DBIDs ids = clu.getIDs();<NEW_LINE>FilteredConvexHull2D hull = new FilteredConvexHull2D();<NEW_LINE>for (DBIDIter iter = ids.iter(); iter.valid(); iter.advance()) {<NEW_LINE>hull.add(coords.get(iter).toArray());<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if (hier != null) {<NEW_LINE>final int numc = hier.numChildren(clu);<NEW_LINE>if (numc > 0) {<NEW_LINE>for (It<Cluster<Model>> iter = hier.iterChildren(clu); iter.valid(); iter.advance()) {<NEW_LINE>final Cluster<Model> iclu = iter.get();<NEW_LINE>DoubleObjPair<Polygon> poly = hulls.get(iclu);<NEW_LINE>if (poly == null) {<NEW_LINE>poly = buildHullsRecursively(iclu, hier, hulls, coords);<NEW_LINE>}<NEW_LINE>// Add inner convex hull to outer convex hull.<NEW_LINE>for (ArrayListIter<double[]> vi = poly.second.iter(); vi.valid(); vi.advance()) {<NEW_LINE>hull.add(vi.get());<NEW_LINE>}<NEW_LINE>weight += poly.first / numc;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>DoubleObjPair<Polygon> pair = new DoubleObjPair<>(weight, hull.getHull());<NEW_LINE>hulls.put(clu, pair);<NEW_LINE>return pair;<NEW_LINE>}
double weight = ids.size();
1,460,083
public void saveToFile() {<NEW_LINE>// create properties<NEW_LINE>Properties properties = new Properties();<NEW_LINE>// get parameters<NEW_LINE>properties.setProperty("param_migrationMode_isUpgrade", booleanToString(isUpgrade()));<NEW_LINE>if (getLogLevel() != null)<NEW_LINE>properties.setProperty("param_maxLogLevel", getLogLevel().toString());<NEW_LINE>properties.setProperty("param_attemptTranslation", booleanToString(isAttemptTranslation()));<NEW_LINE>properties.setProperty("param_preserveTableID", booleanToString(isPreserveTableID()));<NEW_LINE>properties.setProperty("param_dropSource", booleanToString(isDropSource()));<NEW_LINE>properties.setProperty("param_optimizeDatabase", booleanToString(isOptimizeDatabase()));<NEW_LINE>if (getSourceVendor() != null)<NEW_LINE>properties.setProperty("param_sourceDB_vendor", getSourceVendor());<NEW_LINE>if (getSourceHost() != null)<NEW_LINE>properties.setProperty("param_sourceDB_host", getSourceHost());<NEW_LINE>if (getSourcePort() != null)<NEW_LINE>properties.setProperty("param_sourceDB_port", getSourcePort());<NEW_LINE>if (getSourceName() != null)<NEW_LINE>properties.<MASK><NEW_LINE>if (getSourceCatalog() != null)<NEW_LINE>properties.setProperty("param_sourceDB_catalog", getSourceCatalog());<NEW_LINE>if (getSourceSchema() != null)<NEW_LINE>properties.setProperty("param_sourceDB_schema", getSourceSchema());<NEW_LINE>if (getSourceUser() != null)<NEW_LINE>properties.setProperty("param_sourceDB_user", getSourceUser());<NEW_LINE>if (getSourcePasswd() != null)<NEW_LINE>properties.setProperty("param_sourceDB_passwd", getSourcePasswd());<NEW_LINE>if (getSourceSystemUser() != null)<NEW_LINE>properties.setProperty("param_sourceDB_systemUser", getSourceSystemUser());<NEW_LINE>if (getSourceSystemPasswd() != null)<NEW_LINE>properties.setProperty("param_sourceDB_systemPasswd", getSourceSystemPasswd());<NEW_LINE>if (getTargetVendor() != null)<NEW_LINE>properties.setProperty("param_targetDB_vendor", getTargetVendor());<NEW_LINE>if (getTargetHost() != null)<NEW_LINE>properties.setProperty("param_targetDB_host", getTargetHost());<NEW_LINE>if (getTargetPort() != null)<NEW_LINE>properties.setProperty("param_targetDB_port", getTargetPort());<NEW_LINE>if (getTargetName() != null)<NEW_LINE>properties.setProperty("param_targetDB_name", getTargetName());<NEW_LINE>if (getTargetCatalog() != null)<NEW_LINE>properties.setProperty("param_targetDB_catalog", getTargetCatalog());<NEW_LINE>if (getTargetSchema() != null)<NEW_LINE>properties.setProperty("param_targetDB_schema", getTargetSchema());<NEW_LINE>if (getTargetUser() != null)<NEW_LINE>properties.setProperty("param_targetDB_user", getTargetUser());<NEW_LINE>if (getTargetPasswd() != null)<NEW_LINE>properties.setProperty("param_targetDB_passwd", getTargetPasswd());<NEW_LINE>if (getTargetSystemUser() != null)<NEW_LINE>properties.setProperty("param_targetDB_systemUser", getTargetSystemUser());<NEW_LINE>if (getTargetSystemPasswd() != null)<NEW_LINE>properties.setProperty("param_targetDB_systemPasswd", getTargetSystemPasswd());<NEW_LINE>// save properties to file<NEW_LINE>FileOutputStream out;<NEW_LINE>try {<NEW_LINE>out = new FileOutputStream(getConfigFileName());<NEW_LINE>properties.store(out, "---ADEMPIERE MIGRATION PARAMETERS---");<NEW_LINE>out.close();<NEW_LINE>} catch (FileNotFoundException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>} catch (IOException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>out = null;<NEW_LINE>// release properties<NEW_LINE>properties.clear();<NEW_LINE>}
setProperty("param_sourceDB_name", getSourceName());
289,252
public boolean backPressed() {<NEW_LINE>if (null != mediaDetails && mediaDetails.isVisible()) {<NEW_LINE>((ExploreFragment) getParentFragment()).tabLayout.setVisibility(View.VISIBLE);<NEW_LINE>removeFragment(mediaDetails);<NEW_LINE>((ExploreFragment) getParentFragment<MASK><NEW_LINE>setFragment(mapFragment, mediaDetails);<NEW_LINE>((MainActivity) getActivity()).showTabs();<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (mapFragment != null && mapFragment.isVisible()) {<NEW_LINE>if (mapFragment.backButtonClicked()) {<NEW_LINE>// Explore map fragment handled the event no further action required.<NEW_LINE>return true;<NEW_LINE>} else {<NEW_LINE>((MainActivity) getActivity()).showTabs();<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>((MainActivity) getActivity()).setSelectedItemId(NavTab.CONTRIBUTIONS.code());<NEW_LINE>}<NEW_LINE>((MainActivity) getActivity()).showTabs();<NEW_LINE>return false;<NEW_LINE>}
()).setScroll(true);
1,407,064
public void configure(ConfigurableProvider provider) {<NEW_LINE>provider.addAlgorithm("AlgorithmParameters.CAMELLIA", PREFIX + "$AlgParams");<NEW_LINE>provider.addAlgorithm("Alg.Alias.AlgorithmParameters", NTTObjectIdentifiers.id_camellia128_cbc, "CAMELLIA");<NEW_LINE>provider.addAlgorithm("Alg.Alias.AlgorithmParameters", NTTObjectIdentifiers.id_camellia192_cbc, "CAMELLIA");<NEW_LINE>provider.addAlgorithm("Alg.Alias.AlgorithmParameters", NTTObjectIdentifiers.id_camellia256_cbc, "CAMELLIA");<NEW_LINE>provider.addAlgorithm("AlgorithmParameterGenerator.CAMELLIA", PREFIX + "$AlgParamGen");<NEW_LINE>provider.addAlgorithm("Alg.Alias.AlgorithmParameterGenerator", NTTObjectIdentifiers.id_camellia128_cbc, "CAMELLIA");<NEW_LINE>provider.addAlgorithm("Alg.Alias.AlgorithmParameterGenerator", NTTObjectIdentifiers.id_camellia192_cbc, "CAMELLIA");<NEW_LINE>provider.addAlgorithm(<MASK><NEW_LINE>provider.addAlgorithm("Cipher.CAMELLIA", PREFIX + "$ECB");<NEW_LINE>provider.addAlgorithm("Cipher", NTTObjectIdentifiers.id_camellia128_cbc, PREFIX + "$CBC");<NEW_LINE>provider.addAlgorithm("Cipher", NTTObjectIdentifiers.id_camellia192_cbc, PREFIX + "$CBC");<NEW_LINE>provider.addAlgorithm("Cipher", NTTObjectIdentifiers.id_camellia256_cbc, PREFIX + "$CBC");<NEW_LINE>provider.addAlgorithm("Cipher.CAMELLIARFC3211WRAP", PREFIX + "$RFC3211Wrap");<NEW_LINE>provider.addAlgorithm("Cipher.CAMELLIAWRAP", PREFIX + "$Wrap");<NEW_LINE>provider.addAlgorithm("Alg.Alias.Cipher", NTTObjectIdentifiers.id_camellia128_wrap, "CAMELLIAWRAP");<NEW_LINE>provider.addAlgorithm("Alg.Alias.Cipher", NTTObjectIdentifiers.id_camellia192_wrap, "CAMELLIAWRAP");<NEW_LINE>provider.addAlgorithm("Alg.Alias.Cipher", NTTObjectIdentifiers.id_camellia256_wrap, "CAMELLIAWRAP");<NEW_LINE>provider.addAlgorithm("SecretKeyFactory.CAMELLIA", PREFIX + "$KeyFactory");<NEW_LINE>provider.addAlgorithm("Alg.Alias.SecretKeyFactory", NTTObjectIdentifiers.id_camellia128_cbc, "CAMELLIA");<NEW_LINE>provider.addAlgorithm("Alg.Alias.SecretKeyFactory", NTTObjectIdentifiers.id_camellia192_cbc, "CAMELLIA");<NEW_LINE>provider.addAlgorithm("Alg.Alias.SecretKeyFactory", NTTObjectIdentifiers.id_camellia256_cbc, "CAMELLIA");<NEW_LINE>provider.addAlgorithm("KeyGenerator.CAMELLIA", PREFIX + "$KeyGen");<NEW_LINE>provider.addAlgorithm("KeyGenerator", NTTObjectIdentifiers.id_camellia128_wrap, PREFIX + "$KeyGen128");<NEW_LINE>provider.addAlgorithm("KeyGenerator", NTTObjectIdentifiers.id_camellia192_wrap, PREFIX + "$KeyGen192");<NEW_LINE>provider.addAlgorithm("KeyGenerator", NTTObjectIdentifiers.id_camellia256_wrap, PREFIX + "$KeyGen256");<NEW_LINE>provider.addAlgorithm("KeyGenerator", NTTObjectIdentifiers.id_camellia128_cbc, PREFIX + "$KeyGen128");<NEW_LINE>provider.addAlgorithm("KeyGenerator", NTTObjectIdentifiers.id_camellia192_cbc, PREFIX + "$KeyGen192");<NEW_LINE>provider.addAlgorithm("KeyGenerator", NTTObjectIdentifiers.id_camellia256_cbc, PREFIX + "$KeyGen256");<NEW_LINE>addGMacAlgorithm(provider, "CAMELLIA", PREFIX + "$GMAC", PREFIX + "$KeyGen");<NEW_LINE>addPoly1305Algorithm(provider, "CAMELLIA", PREFIX + "$Poly1305", PREFIX + "$Poly1305KeyGen");<NEW_LINE>}
"Alg.Alias.AlgorithmParameterGenerator", NTTObjectIdentifiers.id_camellia256_cbc, "CAMELLIA");
1,511,741
public void marshall(DeploymentStrategy deploymentStrategy, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (deploymentStrategy == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(deploymentStrategy.getId(), ID_BINDING);<NEW_LINE>protocolMarshaller.marshall(deploymentStrategy.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(deploymentStrategy.getDescription(), DESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(deploymentStrategy.getDeploymentDurationInMinutes(), DEPLOYMENTDURATIONINMINUTES_BINDING);<NEW_LINE>protocolMarshaller.marshall(deploymentStrategy.getGrowthType(), GROWTHTYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(deploymentStrategy.getGrowthFactor(), GROWTHFACTOR_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(deploymentStrategy.getReplicateTo(), REPLICATETO_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
deploymentStrategy.getFinalBakeTimeInMinutes(), FINALBAKETIMEINMINUTES_BINDING);
478,364
public Prediction<Label> predict(Example<Label> example) {<NEW_LINE>PredAndActive predTuple = predictSingle(example);<NEW_LINE>DenseVector prediction = predTuple.prediction;<NEW_LINE>prediction.normalize(normalizer);<NEW_LINE>double maxScore = Double.NEGATIVE_INFINITY;<NEW_LINE>Label maxLabel = null;<NEW_LINE>Map<String, Label> predMap = new LinkedHashMap<>();<NEW_LINE>for (int i = 0; i < prediction.size(); i++) {<NEW_LINE>String labelName = outputIDInfo.getOutput(i).getLabel();<NEW_LINE>double score = prediction.get(i);<NEW_LINE>Label label <MASK><NEW_LINE>predMap.put(labelName, label);<NEW_LINE>if (score > maxScore) {<NEW_LINE>maxScore = score;<NEW_LINE>maxLabel = label;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new Prediction<>(maxLabel, predMap, predTuple.numActiveFeatures - 1, example, generatesProbabilities);<NEW_LINE>}
= new Label(labelName, score);
1,772,349
public void scanForProjects(File workingFolder, String[] checkedOutFolders, SvnProgressSupport support) {<NEW_LINE>Map<Project, Set<Project>> checkedOutProjects = new HashMap<Project, Set<Project>>();<NEW_LINE>// initialize root project container<NEW_LINE>checkedOutProjects.put(null, new HashSet<Project>());<NEW_LINE>File normalizedWorkingFolder = FileUtil.normalizeFile(workingFolder);<NEW_LINE>// checkout creates new folders and cache must be aware of them<NEW_LINE>refreshParents(normalizedWorkingFolder);<NEW_LINE>FileObject fo = FileUtil.toFileObject(normalizedWorkingFolder);<NEW_LINE>if (fo != null) {<NEW_LINE>for (int i = 0; i < checkedOutFolders.length; i++) {<NEW_LINE>if (support != null && support.isCanceled()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String module = checkedOutFolders[i];<NEW_LINE>if (".".equals(module)) {<NEW_LINE>// NOI18N<NEW_LINE>// root folder is scanned, skip remaining modules<NEW_LINE>ProjectUtilities.scanForProjects(fo, checkedOutProjects);<NEW_LINE>break;<NEW_LINE>} else {<NEW_LINE>FileObject <MASK><NEW_LINE>if (subfolder != null) {<NEW_LINE>ProjectUtilities.scanForProjects(subfolder, checkedOutProjects);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// open project selection<NEW_LINE>ProjectUtilities.openCheckedOutProjects(checkedOutProjects, workingFolder);<NEW_LINE>}
subfolder = fo.getFileObject(module);
617,195
private void testForConsistency() {<NEW_LINE>Iterator<Node> iter1 = Iter.toList(node2id_Cache.keys()).iterator();<NEW_LINE>for (; iter1.hasNext(); ) {<NEW_LINE>Node n = iter1.next();<NEW_LINE>NodeId nId = node2id_Cache.getIfPresent(n);<NEW_LINE>if (!id2node_Cache.containsKey(nId))<NEW_LINE>throw new TDBException("Inconsistent: " + n + " => " + nId);<NEW_LINE>if (notPresent.containsKey(n))<NEW_LINE>throw new TDBException("Inconsistent: " + n + " in notPresent cache (1)");<NEW_LINE>}<NEW_LINE>Iterator<NodeId> iter2 = Iter.toList(id2node_Cache.<MASK><NEW_LINE>for (; iter2.hasNext(); ) {<NEW_LINE>NodeId nId = iter2.next();<NEW_LINE>Node n = id2node_Cache.getIfPresent(nId);<NEW_LINE>if (!node2id_Cache.containsKey(n))<NEW_LINE>throw new TDBException("Inconsistent: " + nId + " => " + n);<NEW_LINE>if (notPresent.containsKey(n))<NEW_LINE>throw new TDBException("Inconsistent: " + n + " in notPresent cache (2)");<NEW_LINE>}<NEW_LINE>}
keys()).iterator();
1,349,042
public int pickIncome(Random random) {<NEW_LINE>// lazy-load in case this randomcollection isn't necessary<NEW_LINE>if (incomeDistribution == null) {<NEW_LINE>Map<String, Double> tempIncome = new HashMap<>(income);<NEW_LINE>tempIncome.remove("mean");<NEW_LINE>tempIncome.remove("median");<NEW_LINE>incomeDistribution = buildRandomCollectionFromMap(tempIncome);<NEW_LINE>}<NEW_LINE>String pickedRange = incomeDistribution.next(random);<NEW_LINE>String[] range = pickedRange.split("\\.\\.");<NEW_LINE>// TODO this seems like it would benefit from better caching<NEW_LINE>int low = Integer.parseInt<MASK><NEW_LINE>int high = Integer.parseInt(range[1]) * 1000;<NEW_LINE>// nextInt is normally exclusive of the top value,<NEW_LINE>// so add 1 to make it inclusive<NEW_LINE>return random.nextInt((high - low) + 1) + low;<NEW_LINE>}
(range[0]) * 1000;
545,114
public void showCharacter(final RequestContext context) {<NEW_LINE>final AbstractFreeMarkerRenderer renderer = new SkinRenderer(context, "activity/character.ftl");<NEW_LINE>final Map<String, Object> dataModel = renderer.getDataModel();<NEW_LINE>dataModelService.fillHeaderAndFooter(context, dataModel);<NEW_LINE>dataModelService.fillRandomArticles(dataModel);<NEW_LINE>dataModelService.fillSideHotArticles(dataModel);<NEW_LINE>dataModelService.fillSideTags(dataModel);<NEW_LINE>dataModelService.fillLatestCmts(dataModel);<NEW_LINE>final JSONObject user = Sessions.getUser();<NEW_LINE>final String userId = user.optString(Keys.OBJECT_ID);<NEW_LINE>String activityCharacterGuideLabel = langPropsService.get("activityCharacterGuideLabel");<NEW_LINE>final String character = characterQueryService.getUnwrittenCharacter(userId);<NEW_LINE>if (StringUtils.isBlank(character)) {<NEW_LINE>dataModel.put("noCharacter", true);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final int totalCharacterCount = characterQueryService.getTotalCharacterCount();<NEW_LINE>final int writtenCharacterCount = characterQueryService.getWrittenCharacterCount();<NEW_LINE>final String totalProgress = String.format("%.2f", (double) writtenCharacterCount <MASK><NEW_LINE>dataModel.put("totalProgress", totalProgress);<NEW_LINE>final int userWrittenCharacterCount = characterQueryService.getWrittenCharacterCount(userId);<NEW_LINE>final String userProgress = String.format("%.2f", (double) userWrittenCharacterCount / (double) totalCharacterCount * 100);<NEW_LINE>dataModel.put("userProgress", userProgress);<NEW_LINE>activityCharacterGuideLabel = activityCharacterGuideLabel.replace("{character}", character);<NEW_LINE>dataModel.put("activityCharacterGuideLabel", activityCharacterGuideLabel);<NEW_LINE>}
/ (double) totalCharacterCount * 100);
344,949
public static void fix(Snackbar snackbar) {<NEW_LINE>final <MASK><NEW_LINE>TypedArray typedArray = context.obtainStyledAttributes(new int[] { R.attr.TextSizeBody1 });<NEW_LINE>final float size = typedArray.getDimension(0, 0f);<NEW_LINE>typedArray.recycle();<NEW_LINE>if (size != 0f) {<NEW_LINE>final TextView text = snackbar.getView().findViewById(com.google.android.material.R.id.snackbar_text);<NEW_LINE>final TextView action = snackbar.getView().findViewById(com.google.android.material.R.id.snackbar_action);<NEW_LINE>if (text != null && action != null) {<NEW_LINE>text.setTextSize(TypedValue.COMPLEX_UNIT_PX, size);<NEW_LINE>action.setTextSize(TypedValue.COMPLEX_UNIT_PX, size);<NEW_LINE>action.setTextColor(ContextCompat.getColor(context, R.color.blue_a100));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
Context context = snackbar.getContext();
381,634
public void defineType() {<NEW_LINE>if (mType != TYPE_ALL)<NEW_LINE>return;<NEW_LINE>String fileExt = null;<NEW_LINE>int dotIndex = mTitle != null ? mTitle.lastIndexOf(".") : -1;<NEW_LINE>if (dotIndex != -1) {<NEW_LINE>fileExt = mTitle.substring(dotIndex).toLowerCase(Locale.ENGLISH);<NEW_LINE>} else {<NEW_LINE>final int index = mUri.toString().indexOf('?');<NEW_LINE>String location;<NEW_LINE>if (index == -1)<NEW_LINE>location = mUri.toString();<NEW_LINE>else<NEW_LINE>location = mUri.toString(<MASK><NEW_LINE>dotIndex = location.lastIndexOf(".");<NEW_LINE>if (dotIndex != -1)<NEW_LINE>fileExt = location.substring(dotIndex).toLowerCase(Locale.ENGLISH);<NEW_LINE>}<NEW_LINE>if (!TextUtils.isEmpty(fileExt)) {<NEW_LINE>if (Extensions.VIDEO.contains(fileExt)) {<NEW_LINE>mType = TYPE_VIDEO;<NEW_LINE>} else if (Extensions.AUDIO.contains(fileExt)) {<NEW_LINE>mType = TYPE_AUDIO;<NEW_LINE>} else if (Extensions.SUBTITLES.contains(fileExt)) {<NEW_LINE>mType = TYPE_SUBTITLE;<NEW_LINE>} else if (Extensions.PLAYLIST.contains(fileExt)) {<NEW_LINE>mType = TYPE_PLAYLIST;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
).substring(0, index);
101,508
void toHtml() throws IOException {<NEW_LINE>writeBackLink();<NEW_LINE>writeln("<br/>");<NEW_LINE>if (dependencies.isEmpty()) {<NEW_LINE>writeln("#Aucune_dependance#");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>writeTitle("beans.png", getString("Dependencies"));<NEW_LINE><MASK><NEW_LINE>table.beginTable(getString("Dependencies"));<NEW_LINE>// table of dependencies inspired by Jenkins "/about"<NEW_LINE>write("<th>Artifact</th><th>#Nom#</th><th>Maven ID</th><th>#Licence#</th>");<NEW_LINE>for (final Map.Entry<String, MavenArtifact> entry : dependencies.entrySet()) {<NEW_LINE>final String jarFilename = entry.getKey();<NEW_LINE>final MavenArtifact dependency = entry.getValue();<NEW_LINE>table.nextRow();<NEW_LINE>writeDependency(jarFilename, dependency);<NEW_LINE>}<NEW_LINE>table.endTable();<NEW_LINE>writeln("<div align='right'>" + getFormattedString("nb_dependencies", dependencies.size()) + "</div>");<NEW_LINE>}
final HtmlTable table = new HtmlTable();
93,689
private STNode createObjectTypeQualNodeList(List<STNode> qualifierList) {<NEW_LINE>// Validate qualifiers and create a STNodeList<NEW_LINE>List<STNode> validatedList = new ArrayList<>();<NEW_LINE>boolean hasNetworkQual = false;<NEW_LINE>for (int i = 0; i < qualifierList.size(); i++) {<NEW_LINE>STNode qualifier = qualifierList.get(i);<NEW_LINE>int nextIndex = i + 1;<NEW_LINE>if (isSyntaxKindInList(validatedList, qualifier.kind)) {<NEW_LINE>updateLastNodeInListWithInvalidNode(validatedList, qualifier, DiagnosticErrorCode.ERROR_DUPLICATE_QUALIFIER, ((STToken) qualifier).text());<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (isObjectNetworkQual(qualifier.kind)) {<NEW_LINE>if (hasNetworkQual) {<NEW_LINE>updateLastNodeInListWithInvalidNode(<MASK><NEW_LINE>} else {<NEW_LINE>validatedList.add(qualifier);<NEW_LINE>hasNetworkQual = true;<NEW_LINE>}<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (isObjectTypeQual(qualifier.kind)) {<NEW_LINE>validatedList.add(qualifier);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// We only reach here for invalid qualifiers<NEW_LINE>if (qualifierList.size() == nextIndex) {<NEW_LINE>addInvalidNodeToNextToken(qualifier, DiagnosticErrorCode.ERROR_QUALIFIER_NOT_ALLOWED, ((STToken) qualifier).text());<NEW_LINE>} else {<NEW_LINE>updateANodeInListWithLeadingInvalidNode(qualifierList, nextIndex, qualifier, DiagnosticErrorCode.ERROR_QUALIFIER_NOT_ALLOWED, ((STToken) qualifier).text());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return STNodeFactory.createNodeList(validatedList);<NEW_LINE>}
validatedList, qualifier, DiagnosticErrorCode.ERROR_MORE_THAN_ONE_OBJECT_NETWORK_QUALIFIERS);
1,132,748
private void build(@Nonnull final Iterator<int[]> changedLines) {<NEW_LINE>int[] starts = new int[myCount];<NEW_LINE>int[] ends = new int[myCount];<NEW_LINE>int[] last = new int[myCount];<NEW_LINE>for (int i = 0; i < myCount; i++) {<NEW_LINE>last[i] = Integer.MIN_VALUE;<NEW_LINE>}<NEW_LINE>while (changedLines.hasNext()) {<NEW_LINE>int[] offsets = changedLines.next();<NEW_LINE>for (int i = 0; i < myCount; i++) {<NEW_LINE>starts<MASK><NEW_LINE>ends[i] = offsets[i * 2];<NEW_LINE>last[i] = offsets[i * 2 + 1];<NEW_LINE>}<NEW_LINE>addRange(starts, ends);<NEW_LINE>}<NEW_LINE>for (int i = 0; i < myCount; i++) {<NEW_LINE>starts[i] = last[i];<NEW_LINE>ends[i] = Integer.MAX_VALUE;<NEW_LINE>}<NEW_LINE>addRange(starts, ends);<NEW_LINE>}
[i] = last[i];
311,845
final ListPlacementsResult executeListPlacements(ListPlacementsRequest listPlacementsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listPlacementsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<ListPlacementsRequest> request = null;<NEW_LINE>Response<ListPlacementsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListPlacementsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listPlacementsRequest));<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, "IoT 1Click Projects");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListPlacements");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListPlacementsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListPlacementsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
429,950
public void mergeFiles() {<NEW_LINE>String[] pdfpaths = mViewFilesAdapter.getSelectedFilePath().toArray(new String[0]);<NEW_LINE>String masterpwd = mSharedPrefs.getString(MASTER_PWD_STRING, appName);<NEW_LINE>new MaterialDialog.Builder(mActivity).title(R.string.creating_pdf).content(R.string.enter_file_name).input(mContext.getResources().getString(R.string.example), null, (dialog, input) -> {<NEW_LINE>if (StringUtils.getInstance().isEmpty(input)) {<NEW_LINE>StringUtils.getInstance().showSnackbar(mActivity, R.string.snackbar_name_not_blank);<NEW_LINE>} else {<NEW_LINE>if (!mFileUtils.isFileExist(input + mContext.getResources().getString(R.string.pdf_ext))) {<NEW_LINE>new MergePdf(input.toString(), mHomePath, mPasswordProtected, mPassword, this, masterpwd).execute(pdfpaths);<NEW_LINE>} else {<NEW_LINE>MaterialDialog.Builder builder = DialogUtils.<MASK><NEW_LINE>builder.onPositive((dialog12, which) -> new MergePdf(input.toString(), mHomePath, mPasswordProtected, mPassword, this, masterpwd).execute(pdfpaths)).onNegative((dialog1, which) -> mergeFiles()).show();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}).show();<NEW_LINE>}
getInstance().createOverwriteDialog(mActivity);
1,341,005
public void init() {<NEW_LINE>if (init)<NEW_LINE>return;<NEW_LINE>INSTANCE = this;<NEW_LINE>context = getReactApplicationContext();<NEW_LINE>emitter = new MusicControlEventEmitter(context, notificationId);<NEW_LINE>session = new MediaSessionCompat(context, "MusicControl");<NEW_LINE>session.setFlags(MediaSessionCompat.FLAG_HANDLES_MEDIA_BUTTONS | MediaSessionCompat.FLAG_HANDLES_TRANSPORT_CONTROLS);<NEW_LINE>session.setCallback(new MediaSessionCallback(emitter));<NEW_LINE>volume = new MusicControlVolumeListener(context, emitter, true, 100, 100);<NEW_LINE>if (remoteVolume) {<NEW_LINE>session.setPlaybackToRemote(volume);<NEW_LINE>} else {<NEW_LINE>session.setPlaybackToLocal(AudioManager.STREAM_MUSIC);<NEW_LINE>}<NEW_LINE>md = new MediaMetadataCompat.Builder();<NEW_LINE>pb = new PlaybackStateCompat.Builder();<NEW_LINE>pb.setActions(controls);<NEW_LINE>if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {<NEW_LINE>createChannel(context);<NEW_LINE>}<NEW_LINE>nb = new NotificationCompat.Builder(context, channelId);<NEW_LINE>nb.setVisibility(NotificationCompat.VISIBILITY_PUBLIC);<NEW_LINE>nb.setPriority(NotificationCompat.PRIORITY_HIGH);<NEW_LINE>updateNotificationMediaStyle();<NEW_LINE>state = pb.build();<NEW_LINE>notification = new MusicControlNotification(this, context);<NEW_LINE><MASK><NEW_LINE>IntentFilter filter = new IntentFilter();<NEW_LINE>filter.addAction(MusicControlNotification.REMOVE_NOTIFICATION);<NEW_LINE>filter.addAction(MusicControlNotification.MEDIA_BUTTON);<NEW_LINE>filter.addAction(Intent.ACTION_MEDIA_BUTTON);<NEW_LINE>filter.addAction(AudioManager.ACTION_AUDIO_BECOMING_NOISY);<NEW_LINE>receiver = new MusicControlReceiver(this, context);<NEW_LINE>context.registerReceiver(receiver, filter);<NEW_LINE>Intent myIntent = new Intent(context, MusicControlNotification.NotificationService.class);<NEW_LINE>afListener = new MusicControlAudioFocusListener(context, emitter, volume);<NEW_LINE>if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {<NEW_LINE>// Try to bind the service<NEW_LINE>try {<NEW_LINE>context.bindService(myIntent, connection, Context.BIND_AUTO_CREATE);<NEW_LINE>} catch (Exception ignored) {<NEW_LINE>ContextCompat.startForegroundService(context, myIntent);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>context.startService(myIntent);<NEW_LINE>}<NEW_LINE>context.registerComponentCallbacks(this);<NEW_LINE>isPlaying = false;<NEW_LINE>init = true;<NEW_LINE>}
notification.updateActions(controls, skipOptions);
1,459,321
public static DescribeLoghubDetailResponse unmarshall(DescribeLoghubDetailResponse describeLoghubDetailResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeLoghubDetailResponse.setRequestId(_ctx.stringValue("DescribeLoghubDetailResponse.RequestId"));<NEW_LINE>LoghubInfo loghubInfo = new LoghubInfo();<NEW_LINE>loghubInfo.setAccessKey(_ctx.stringValue("DescribeLoghubDetailResponse.LoghubInfo.AccessKey"));<NEW_LINE>loghubInfo.setTableName(_ctx.stringValue("DescribeLoghubDetailResponse.LoghubInfo.TableName"));<NEW_LINE>loghubInfo.setAccessSecret(_ctx.stringValue("DescribeLoghubDetailResponse.LoghubInfo.AccessSecret"));<NEW_LINE>loghubInfo.setProjectName(_ctx.stringValue("DescribeLoghubDetailResponse.LoghubInfo.ProjectName"));<NEW_LINE>loghubInfo.setSchemaName(_ctx.stringValue("DescribeLoghubDetailResponse.LoghubInfo.SchemaName"));<NEW_LINE>loghubInfo.setDBType(_ctx.stringValue("DescribeLoghubDetailResponse.LoghubInfo.DBType"));<NEW_LINE>loghubInfo.setDeliverName(_ctx.stringValue("DescribeLoghubDetailResponse.LoghubInfo.DeliverName"));<NEW_LINE>loghubInfo.setRegionId(_ctx.stringValue("DescribeLoghubDetailResponse.LoghubInfo.RegionId"));<NEW_LINE>loghubInfo.setPassword(_ctx.stringValue("DescribeLoghubDetailResponse.LoghubInfo.Password"));<NEW_LINE>loghubInfo.setDBClusterId(_ctx.stringValue("DescribeLoghubDetailResponse.LoghubInfo.DBClusterId"));<NEW_LINE>loghubInfo.setDescription(_ctx.stringValue("DescribeLoghubDetailResponse.LoghubInfo.Description"));<NEW_LINE>loghubInfo.setFilterDirtyData(_ctx.booleanValue("DescribeLoghubDetailResponse.LoghubInfo.FilterDirtyData"));<NEW_LINE>loghubInfo.setZoneId(_ctx.stringValue("DescribeLoghubDetailResponse.LoghubInfo.ZoneId"));<NEW_LINE>loghubInfo.setLogStoreName(_ctx.stringValue("DescribeLoghubDetailResponse.LoghubInfo.LogStoreName"));<NEW_LINE>loghubInfo.setUserName(_ctx.stringValue("DescribeLoghubDetailResponse.LoghubInfo.UserName"));<NEW_LINE>loghubInfo.setDomainUrl<MASK><NEW_LINE>loghubInfo.setDeliverTime(_ctx.stringValue("DescribeLoghubDetailResponse.LoghubInfo.DeliverTime"));<NEW_LINE>List<LogHubStore> logHubStores = new ArrayList<LogHubStore>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeLoghubDetailResponse.LoghubInfo.LogHubStores.Length"); i++) {<NEW_LINE>LogHubStore logHubStore = new LogHubStore();<NEW_LINE>logHubStore.setType(_ctx.stringValue("DescribeLoghubDetailResponse.LoghubInfo.LogHubStores[" + i + "].Type"));<NEW_LINE>logHubStore.setLogKey(_ctx.stringValue("DescribeLoghubDetailResponse.LoghubInfo.LogHubStores[" + i + "].LogKey"));<NEW_LINE>logHubStore.setFieldKey(_ctx.stringValue("DescribeLoghubDetailResponse.LoghubInfo.LogHubStores[" + i + "].FieldKey"));<NEW_LINE>logHubStores.add(logHubStore);<NEW_LINE>}<NEW_LINE>loghubInfo.setLogHubStores(logHubStores);<NEW_LINE>describeLoghubDetailResponse.setLoghubInfo(loghubInfo);<NEW_LINE>return describeLoghubDetailResponse;<NEW_LINE>}
(_ctx.stringValue("DescribeLoghubDetailResponse.LoghubInfo.DomainUrl"));
87,031
private void processInParallel(int n, Consumer<Integer> task) {<NEW_LINE>// Run by chunks:<NEW_LINE>int chunks = <MASK><NEW_LINE>int chn = n / chunks + ((n % chunks) > 0 ? 1 : 0);<NEW_LINE>class TranslateThreads implements Runnable {<NEW_LINE><NEW_LINE>private final int ch;<NEW_LINE><NEW_LINE>private TranslateThreads(int ch) {<NEW_LINE>this.ch = ch;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>int i0 = ch * chn;<NEW_LINE>for (int i = i0; i < i0 + chn && i < n; i++) {<NEW_LINE>task.accept(i);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>RequestProcessor.Task[] tasks = new RequestProcessor.Task[chunks];<NEW_LINE>for (int ch = 0; ch < chunks; ch++) {<NEW_LINE>tasks[ch] = rpCreateThreads.post(new TranslateThreads(ch));<NEW_LINE>}<NEW_LINE>for (int ch = 0; ch < chunks; ch++) {<NEW_LINE>tasks[ch].waitFinished();<NEW_LINE>}<NEW_LINE>}
Math.min(RP_THROUGHPUT, n);
356,686
ObjectMetadata toObjectMetadata(ObjectMetadata metadata) {<NEW_LINE>// If we generated a symmetric key to encrypt the data, store it in the<NEW_LINE>// object metadata.<NEW_LINE>byte[] encryptedCEK = getEncryptedCEK();<NEW_LINE>metadata.addUserMetadata(Headers.CRYPTO_KEY_V2, Base64.encodeAsString(encryptedCEK));<NEW_LINE>// Put the cipher initialization vector (IV) into the object metadata<NEW_LINE>byte[<MASK><NEW_LINE>metadata.addUserMetadata(Headers.CRYPTO_IV, Base64.encodeAsString(iv));<NEW_LINE>// Put the materials description into the object metadata as JSON<NEW_LINE>metadata.addUserMetadata(Headers.MATERIALS_DESCRIPTION, kekMaterialDescAsJson());<NEW_LINE>// The CRYPTO_CEK_ALGORITHM, CRYPTO_TAG_LENGTH and<NEW_LINE>// CRYPTO_KEYWRAP_ALGORITHM were not available in the Encryption Only<NEW_LINE>// (EO) implementation<NEW_LINE>ContentCryptoScheme scheme = getContentCryptoScheme();<NEW_LINE>metadata.addUserMetadata(CRYPTO_CEK_ALGORITHM, scheme.getCipherAlgorithm());<NEW_LINE>int tagLen = scheme.getTagLengthInBits();<NEW_LINE>if (tagLen > 0)<NEW_LINE>metadata.addUserMetadata(Headers.CRYPTO_TAG_LENGTH, String.valueOf(tagLen));<NEW_LINE>InternalKeyWrapAlgorithm keyWrapAlgo = getKeyWrappingAlgorithm();<NEW_LINE>if (keyWrapAlgo != null)<NEW_LINE>metadata.addUserMetadata(Headers.CRYPTO_KEYWRAP_ALGORITHM, keyWrapAlgo.algorithmName());<NEW_LINE>return metadata;<NEW_LINE>}
] iv = cipherLite.getIV();
1,838,931
private boolean invariant() {<NEW_LINE>assert Thread.holdsLock(mutex);<NEW_LINE><MASK><NEW_LINE>assert activeFetches <= maxConcurrentFetches : activeFetches + " <= " + maxConcurrentFetches;<NEW_LINE>for (ObjectCursor<SnapshotShard> cursor : knownSnapshotShards.keys()) {<NEW_LINE>assert unknownSnapshotShards.contains(cursor.value) == false : "cannot be known and unknown at same time: " + cursor.value;<NEW_LINE>assert failedSnapshotShards.contains(cursor.value) == false : "cannot be known and failed at same time: " + cursor.value;<NEW_LINE>}<NEW_LINE>for (SnapshotShard shard : unknownSnapshotShards) {<NEW_LINE>assert knownSnapshotShards.keys().contains(shard) == false : "cannot be unknown and known at same time: " + shard;<NEW_LINE>assert failedSnapshotShards.contains(shard) == false : "cannot be unknown and failed at same time: " + shard;<NEW_LINE>}<NEW_LINE>for (SnapshotShard shard : failedSnapshotShards) {<NEW_LINE>assert knownSnapshotShards.keys().contains(shard) == false : "cannot be failed and known at same time: " + shard;<NEW_LINE>assert unknownSnapshotShards.contains(shard) == false : "cannot be failed and unknown at same time: " + shard;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
assert activeFetches >= 0 : "active fetches should be greater than or equal to zero but got: " + activeFetches;
449,014
public void write(final java.nio.ByteBuffer buf) {<NEW_LINE>try {<NEW_LINE>int startPositionMark = buf.position();<NEW_LINE>buf.position(buf.position() + 1);<NEW_LINE>int unknownsCounter = 0;<NEW_LINE>if (unknownFields == null)<NEW_LINE>unknownsCounter = Integer.MAX_VALUE;<NEW_LINE>{<NEW_LINE>com.wowd.wobly.WoblyUtils.Buffers.putVInt(buf, this.size.ordinal());<NEW_LINE>}<NEW_LINE>{<NEW_LINE>com.wowd.wobly.WoblyUtils.Buffers.putVInt(buf, this.height);<NEW_LINE>}<NEW_LINE>{<NEW_LINE>com.wowd.wobly.WoblyUtils.Buffers.putVInt(buf, this.width);<NEW_LINE>}<NEW_LINE>{<NEW_LINE>com.wowd.wobly.WoblyUtils.Buffers.putStringUTF8(<MASK><NEW_LINE>}<NEW_LINE>unknownsCounter = writeUnknownsUpTo(unknownsCounter, 0, buf);<NEW_LINE>if (this.title != null) {<NEW_LINE>buf.put((byte) 7);<NEW_LINE>com.wowd.wobly.WoblyUtils.Buffers.putStringUTF8(buf, this.title, true);<NEW_LINE>}<NEW_LINE>writeUnknownsUpTo(unknownsCounter, Integer.MAX_VALUE, buf);<NEW_LINE>com.wowd.wobly.WoblyUtils.Buffers.appendVariableSize(buf, startPositionMark);<NEW_LINE>} catch (com.wowd.wobly.exceptions.WoblyWriteException e) {<NEW_LINE>throw e;<NEW_LINE>} catch (java.lang.Throwable t) {<NEW_LINE>throw new com.wowd.wobly.exceptions.WoblyWriteException(t);<NEW_LINE>}<NEW_LINE>}
buf, this.uri, true);
670,004
public ArrayList<TextView> clickInList(int line, int index, int id, boolean longClick, int time) {<NEW_LINE>final long endTime = SystemClock.uptimeMillis() + Timeout.getSmallTimeout();<NEW_LINE>int lineIndex = line - 1;<NEW_LINE>if (lineIndex < 0)<NEW_LINE>lineIndex = 0;<NEW_LINE>ArrayList<View> views <MASK><NEW_LINE>final AbsListView absListView = waiter.waitForAndGetView(index, AbsListView.class);<NEW_LINE>if (absListView == null)<NEW_LINE>Assert.fail("AbsListView is null!");<NEW_LINE>failIfIndexHigherThenChildCount(absListView, lineIndex, endTime);<NEW_LINE>View viewOnLine = getViewOnAbsListLine(absListView, index, lineIndex);<NEW_LINE>if (viewOnLine != null) {<NEW_LINE>views = viewFetcher.getViews(viewOnLine, true);<NEW_LINE>views = RobotiumUtils.removeInvisibleViews(views);<NEW_LINE>if (id == 0) {<NEW_LINE>clickOnScreen(viewOnLine, longClick, time);<NEW_LINE>} else {<NEW_LINE>clickOnScreen(getView(id, views));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return RobotiumUtils.filterViews(TextView.class, views);<NEW_LINE>}
= new ArrayList<View>();
1,163,767
public void onGestureStarted(PointF point) {<NEW_LINE>super.onGestureStarted(point);<NEW_LINE>if ((mDelay > 0) && (isInside(point))) {<NEW_LINE>mHoldTimer = new Timer();<NEW_LINE>mHoldTimer.schedule(new GestureTimerTask(), mDelay);<NEW_LINE>mGestureState = ACTIVE_STATE;<NEW_LINE>mCrossed = true;<NEW_LINE>} else {<NEW_LINE>mCrossed = false;<NEW_LINE>}<NEW_LINE>if (mDiagActivate) {<NEW_LINE>Display display = Common.mainActivity.getWindowManager().getDefaultDisplay();<NEW_LINE>double dx = mLastTouchPoint.x - (display.getWidth() / 2);<NEW_LINE>double dy = mLastTouchPoint.y - (display.getHeight() / 2);<NEW_LINE>double theta = Math.atan2(dx, dy);<NEW_LINE>double hyp = Math.<MASK><NEW_LINE>mCounterTextPt.x = mLastTouchPoint.x - (float) (dx - (Math.sin(theta) * hyp));<NEW_LINE>mCounterTextPt.y = mLastTouchPoint.y - (float) (dy - (Math.cos(theta) * hyp));<NEW_LINE>}<NEW_LINE>}
hypot(dx, dy) - 100;
958,928
public Outcome<VirtualMachine> deleteAllVMSnapshotsThroughJobQueue(final Long vmId, final VMSnapshot.Type type) {<NEW_LINE>final CallContext context = CallContext.current();<NEW_LINE>final User callingUser = context.getCallingUser();<NEW_LINE>final Account callingAccount = context.getCallingAccount();<NEW_LINE>final VMInstanceVO vm = _vmInstanceDao.findById(vmId);<NEW_LINE>VmWorkJobVO workJob = new VmWorkJobVO(context.getContextId());<NEW_LINE>workJob.setDispatcher(VmWorkConstants.VM_WORK_JOB_DISPATCHER);<NEW_LINE>workJob.setCmd(VmWorkDeleteAllVMSnapshots.class.getName());<NEW_LINE>workJob.setAccountId(callingAccount.getId());<NEW_LINE>workJob.setUserId(callingUser.getId());<NEW_LINE>workJob.<MASK><NEW_LINE>workJob.setVmType(VirtualMachine.Type.Instance);<NEW_LINE>workJob.setVmInstanceId(vm.getId());<NEW_LINE>workJob.setRelated(AsyncJobExecutionContext.getOriginJobId());<NEW_LINE>// save work context info (there are some duplications)<NEW_LINE>VmWorkDeleteAllVMSnapshots workInfo = new VmWorkDeleteAllVMSnapshots(callingUser.getId(), callingAccount.getId(), vm.getId(), VMSnapshotManagerImpl.VM_WORK_JOB_HANDLER, type);<NEW_LINE>workJob.setCmdInfo(VmWorkSerializer.serialize(workInfo));<NEW_LINE>_jobMgr.submitAsyncJob(workJob, VmWorkConstants.VM_WORK_QUEUE, vm.getId());<NEW_LINE>AsyncJobExecutionContext.getCurrentExecutionContext().joinJob(workJob.getId());<NEW_LINE>return new VmJobVirtualMachineOutcome(workJob, vmId);<NEW_LINE>}
setStep(VmWorkJobVO.Step.Starting);
1,782,165
final GetDefaultPatchBaselineResult executeGetDefaultPatchBaseline(GetDefaultPatchBaselineRequest getDefaultPatchBaselineRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getDefaultPatchBaselineRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetDefaultPatchBaselineRequest> request = null;<NEW_LINE>Response<GetDefaultPatchBaselineResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new GetDefaultPatchBaselineRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getDefaultPatchBaselineRequest));<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, "SSM");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetDefaultPatchBaseline");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetDefaultPatchBaselineResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetDefaultPatchBaselineResultJsonUnmarshaller());<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,760,095
public boolean shouldIgnore(LazyValue<String> queriedClass, LazyValue<String> callerClass) {<NEW_LINE>if (heuristicsEnabled && !isInLivePhase) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>String qualifiedCaller = callerClass.get();<NEW_LINE>assert qualifiedCaller == null || qualifiedCaller.indexOf('/') == -1 : "expecting Java-format qualifiers, not internal format";<NEW_LINE>if (qualifiedCaller != null && !callerFilter.includes(qualifiedCaller)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>// NOTE: queriedClass can be null for non-class accesses like resources<NEW_LINE>if (callerClass.get() == null && queriedClass.get() != null && !accessWithoutCallerFilter.includes(queriedClass.get())) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (accessFilter != null && queriedClass.get() != null && !accessFilter.includes(queriedClass.get())) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return heuristicsEnabled && queriedClass.get() != null && PROXY_CLASS_NAME_PATTERN.matcher(queriedClass.<MASK><NEW_LINE>}
get()).matches();
1,682,370
protected void configureLoaderProperties(WebappClassLoader cloader, WebXmlParser webXmlParser, File base) {<NEW_LINE>cloader.setUseMyFaces(webXmlParser.isUseBundledJSF());<NEW_LINE>File libDir = new File(base, "WEB-INF/lib");<NEW_LINE>if (libDir.exists()) {<NEW_LINE>int baseFileLen = base.getPath().length();<NEW_LINE>final <MASK><NEW_LINE>for (File file : libDir.listFiles(new FileFilter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean accept(File pathname) {<NEW_LINE>String fileName = pathname.getName();<NEW_LINE>return ((fileName.endsWith(".jar") || fileName.endsWith(".zip")) && (!ignoreHiddenJarFiles || !fileName.startsWith(".")));<NEW_LINE>}<NEW_LINE>})) {<NEW_LINE>try {<NEW_LINE>if (file.isDirectory()) {<NEW_LINE>// support exploded jar file<NEW_LINE>cloader.addRepository("WEB-INF/lib/" + file.getName() + "/", file);<NEW_LINE>} else {<NEW_LINE>cloader.addJar(file.getPath().substring(baseFileLen), new JarFile(file), file);<NEW_LINE>cloader.closeJARs(true);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>// Catch and ignore any exception in case the JAR file<NEW_LINE>// is empty.<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
boolean ignoreHiddenJarFiles = webXmlParser.isIgnoreHiddenJarFiles();
1,821,870
public static void autoExpand(JTree tree, TreePath path, int maxLines, int maxChildToExpand, boolean dontExpandToLeafs) {<NEW_LINE>TreeModel model = tree.getModel();<NEW_LINE><MASK><NEW_LINE>TreePath newPath = path;<NEW_LINE>int currentLines = 0;<NEW_LINE>while (currentLines++ < maxLines && !model.isLeaf(node) && (model.getChildCount(node) > 0) && (model.getChildCount(node) <= maxChildToExpand)) {<NEW_LINE>for (int i = 0; i < model.getChildCount(node); i++) {<NEW_LINE>node = tree.getModel().getChild(node, i);<NEW_LINE>if (!model.isLeaf(node)) {<NEW_LINE>if (dontExpandToLeafs && hasOnlyLeafs(tree, node)) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>// if the leaf is added the path will not expand<NEW_LINE>newPath = newPath.pathByAddingChild(node);<NEW_LINE>// from for<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>tree.expandPath(newPath);<NEW_LINE>}
Object node = path.getLastPathComponent();
403,737
public void marshall(RecoveryInstance recoveryInstance, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (recoveryInstance == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(recoveryInstance.getArn(), ARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(recoveryInstance.getDataReplicationInfo(), DATAREPLICATIONINFO_BINDING);<NEW_LINE>protocolMarshaller.marshall(recoveryInstance.getEc2InstanceID(), EC2INSTANCEID_BINDING);<NEW_LINE>protocolMarshaller.marshall(recoveryInstance.getEc2InstanceState(), EC2INSTANCESTATE_BINDING);<NEW_LINE>protocolMarshaller.marshall(recoveryInstance.getFailback(), FAILBACK_BINDING);<NEW_LINE>protocolMarshaller.marshall(recoveryInstance.getIsDrill(), ISDRILL_BINDING);<NEW_LINE>protocolMarshaller.marshall(recoveryInstance.getJobID(), JOBID_BINDING);<NEW_LINE>protocolMarshaller.marshall(recoveryInstance.getPointInTimeSnapshotDateTime(), POINTINTIMESNAPSHOTDATETIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(recoveryInstance.getRecoveryInstanceID(), RECOVERYINSTANCEID_BINDING);<NEW_LINE>protocolMarshaller.marshall(recoveryInstance.getRecoveryInstanceProperties(), RECOVERYINSTANCEPROPERTIES_BINDING);<NEW_LINE>protocolMarshaller.marshall(recoveryInstance.getSourceServerID(), SOURCESERVERID_BINDING);<NEW_LINE>protocolMarshaller.marshall(recoveryInstance.getTags(), TAGS_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + <MASK><NEW_LINE>}<NEW_LINE>}
e.getMessage(), e);
1,175,188
private static void processAnnotations(AnnotatedElement element, boolean processNested, List<Integer> indexes, List<TransformedHeader> tmp, Map<AnnotatedElement, List<TransformedHeader>> nestedReplacements, HeaderTransformer transformer, MethodFilter filter) {<NEW_LINE>Parsed annotation = findAnnotation(element, Parsed.class);<NEW_LINE>if (annotation != null) {<NEW_LINE>TransformedHeader header = new TransformedHeader(element, transformer);<NEW_LINE>if (filter == MethodFilter.ONLY_GETTERS && header.getHeaderIndex() >= 0 && indexes.contains(header.getHeaderIndex())) {<NEW_LINE>// allows the same column to be mapped to multiple fields when parsing, but not when writing.<NEW_LINE>throw new IllegalArgumentException("Duplicate field index '" + header.getHeaderIndex() + "' found in " + describeElement(element));<NEW_LINE>}<NEW_LINE>tmp.add(header);<NEW_LINE>indexes.add(header.getHeaderIndex());<NEW_LINE>}<NEW_LINE>if (processNested) {<NEW_LINE>Nested nested = findAnnotation(element, Nested.class);<NEW_LINE>if (nested != null) {<NEW_LINE>tmp.add(new TransformedHeader(element, null));<NEW_LINE>Class nestedBeanType = AnnotationRegistry.getValue(element, nested, "type", nested.type());<NEW_LINE>if (nestedBeanType == Object.class) {<NEW_LINE>nestedBeanType = getType(element);<NEW_LINE>}<NEW_LINE>Class<? extends HeaderTransformer> transformerType = AnnotationRegistry.getValue(element, nested, "headerTransformer", nested.headerTransformer());<NEW_LINE>if (transformerType != HeaderTransformer.class) {<NEW_LINE>String[] args = AnnotationRegistry.getValue(element, nested, "args", nested.args());<NEW_LINE>HeaderTransformer innerTransformer = AnnotationHelper.newInstance(HeaderTransformer.class, transformerType, args);<NEW_LINE>nestedReplacements.put(element, getFieldSequence(nestedBeanType, true<MASK><NEW_LINE>} else {<NEW_LINE>nestedReplacements.put(element, getFieldSequence(nestedBeanType, true, indexes, transformer, filter));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
, indexes, innerTransformer, filter));
508,488
private void buildFragments() {<NEW_LINE>ArrayList<String[]> pathes = new ArrayList<String[]>();<NEW_LINE>for (int i = 0; i < myView.getItemsSize(); i++) {<NEW_LINE>ItemWrapper item = myView.getItemByIndex(i);<NEW_LINE>pathes.add(ArrayUtil.toStringArray(FileUtil.splitPath(item.getPresentableUrl())));<NEW_LINE>}<NEW_LINE>FragmentBuilder headBuilder = new FragmentBuilder(pathes) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void append(String fragment, StringBuffer buffer) {<NEW_LINE>buffer.append(mySeparator);<NEW_LINE>buffer.append(fragment);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected int getFragmentIndex(String[] path, int index) {<NEW_LINE>return path.length > index ? index : -1;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>String commonHead = headBuilder.execute();<NEW_LINE>final int headLimit = headBuilder.getIndex();<NEW_LINE>FragmentBuilder tailBuilder = new FragmentBuilder(pathes) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void append(String fragment, StringBuffer buffer) {<NEW_LINE>buffer.insert(0, fragment + mySeparator);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected int getFragmentIndex(String[] path, int index) {<NEW_LINE>int result = path.length - 1 - index;<NEW_LINE>return result > headLimit ? result : -1;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>String commonTail = tailBuilder.execute();<NEW_LINE><MASK><NEW_LINE>for (int i = 0; i < myView.getItemsSize(); i++) {<NEW_LINE>ItemWrapper item = myView.getItemByIndex(i);<NEW_LINE>String special = concat(pathes.get(i), headLimit, tailLimit);<NEW_LINE>item.setFragments(createFragments(commonHead, special, commonTail));<NEW_LINE>}<NEW_LINE>}
int tailLimit = tailBuilder.getIndex();
1,745,181
public void testSFRemoteHomeHandleSerialization() throws Exception {<NEW_LINE>HomeHandle handle = fhome1.getHomeHandle();<NEW_LINE>assertNotNull("Get EJB home handle from home was null.", handle);<NEW_LINE>ByteArrayOutputStream bos = new ByteArrayOutputStream();<NEW_LINE>ObjectOutputStream os = new ObjectOutputStream(bos);<NEW_LINE>os.writeObject(handle);<NEW_LINE>os.close();<NEW_LINE>ObjectInputStream is = new ObjectInputStream(new ByteArrayInputStream<MASK><NEW_LINE>handle = (HomeHandle) is.readObject();<NEW_LINE>is.close();<NEW_LINE>assertNotNull("Deserialized home handle from stream was null.", handle);<NEW_LINE>// Narrow needed in Liberty since not using IBM ORB<NEW_LINE>EJBHome ejbHome = (SFRaHome) PortableRemoteObject.narrow(handle.getEJBHome(), SFRaHome.class);<NEW_LINE>// EJBHome ejbHome = handle.getEJBHome();<NEW_LINE>assertNotNull("Get EJB Home from handle was null.", ejbHome);<NEW_LINE>assertEquals("Test EJB Home name was unexpected value.", fhome1.getClass().getName(), ejbHome.getClass().getName());<NEW_LINE>}
(bos.toByteArray()));
250,540
private void handleStreamEventExpandedNotifications(String status, String target, String circuitId, String clientProtocol) {<NEW_LINE>if (!status.equals(TorControlCommands.STREAM_EVENT_SUCCEEDED))<NEW_LINE>return;<NEW_LINE>if (!clientProtocol.contains("SOCKS5"))<NEW_LINE>return;<NEW_LINE>int id = Integer.parseInt(circuitId);<NEW_LINE>// don't display to users exit node info for onion addresses!<NEW_LINE>if (target.contains(".onion"))<NEW_LINE>return;<NEW_LINE>ExitNode node = exitNodeMap.get(id);<NEW_LINE>if (node != null) {<NEW_LINE>if (node.country == null && !node.querying) {<NEW_LINE>node.querying = true;<NEW_LINE>mService.exec(() -> {<NEW_LINE>try {<NEW_LINE>String[] networkStatus = mService.conn.getInfo("ns/id/" + node.fingerPrint).split(" ");<NEW_LINE>node.ipAddress = networkStatus[6];<NEW_LINE>String countryCode = mService.conn.getInfo("ip-to-country/" + node.ipAddress).toUpperCase(Locale.getDefault());<NEW_LINE>if (!countryCode.equals(TOR_CONTROLLER_COUNTRY_CODE_UNKNOWN)) {<NEW_LINE>String emoji = Utils.convertCountryCodeToFlagEmoji(countryCode);<NEW_LINE>String countryName = new Locale("", countryCode).getDisplayName();<NEW_LINE>node<MASK><NEW_LINE>} else<NEW_LINE>node.country = "";<NEW_LINE>mService.setNotificationSubtext(node.toString());<NEW_LINE>} catch (Exception ignored) {<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} else {<NEW_LINE>if (node.country != null)<NEW_LINE>mService.setNotificationSubtext(node.toString());<NEW_LINE>else<NEW_LINE>mService.setNotificationSubtext(null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.country = emoji + " " + countryName;
1,284,773
public Sequence<String> expandToolchainAndRuleContextVariables(StarlarkRuleContext starlarkRuleContext, Sequence<?> flags) throws EvalException {<NEW_LINE>if (flags.isEmpty()) {<NEW_LINE>return Sequence.cast(flags, String.class, "flags");<NEW_LINE>}<NEW_LINE>ImmutableMap<String, String> toolchainMap = starlarkRuleContext.getRuleContext().getPrerequisite("$cc_toolchain", TemplateVariableInfo.PROVIDER).getVariables();<NEW_LINE>ImmutableMap<String, String> starlarkRuleContextMap = ImmutableMap.<String, String>builder().putAll(starlarkRuleContext.var()).buildOrThrow();<NEW_LINE>List<String> expandedFlags = new ArrayList<>();<NEW_LINE>for (String flag : Sequence.cast(flags, String.class, "flags")) {<NEW_LINE>String expandedFlag = LocationExpander.withExecPaths(starlarkRuleContext.getRuleContext(), StarlarkRuleContext.makeLabelMap(ImmutableSet.copyOf(Iterables.concat(starlarkRuleContext.getRuleContext().getPrerequisites("srcs"), starlarkRuleContext.getRuleContext().getPrerequisites("non_arc_srcs"), starlarkRuleContext.getRuleContext().getPrerequisites("hdrs"), starlarkRuleContext.getRuleContext().getPrerequisites("data"))))).expand(flag);<NEW_LINE>expandedFlag = expandFlag(expandedFlag, toolchainMap, starlarkRuleContextMap);<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>} catch (TokenizationException e) {<NEW_LINE>throw new EvalException(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return StarlarkList.immutableCopyOf(expandedFlags);<NEW_LINE>}
ShellUtils.tokenize(expandedFlags, expandedFlag);
851,787
private void modifyNativeMethod(CtMethod method, CtClass returnTypeAsCtClass, String returnTypeAsString) throws CannotCompileException {<NEW_LINE>String methodName = method.getName();<NEW_LINE>String returnValue = "($r)value";<NEW_LINE>if (returnTypeAsCtClass.equals(CtClass.voidType)) {<NEW_LINE>returnValue = VOID;<NEW_LINE>}<NEW_LINE>String classOrInstance = classOrInstance(method);<NEW_LINE>method.setModifiers(method.<MASK><NEW_LINE>String code = "Object value = " + mockGetawayClass.getName() + ".methodCall(" + classOrInstance + ", \"" + method.getName() + "\", $args, $sig, \"" + returnTypeAsString + "\");" + "if (value != " + MockGateway.class.getName() + ".PROCEED) " + "return " + returnValue + "; " + "throw new java.lang.UnsupportedOperationException(\"" + methodName + " is native\");";<NEW_LINE>method.setBody("{" + code + "}");<NEW_LINE>}
getModifiers() - Modifier.NATIVE);
1,303,567
protected boolean validate(final String uri) {<NEW_LINE>if (uri.indexOf("://") != -1) {<NEW_LINE>final Protocol protocol = factory.forName(uri.substring(0, uri.indexOf("://")));<NEW_LINE>if (null == protocol) {<NEW_LINE>console.printf("Unknown protocol in URI %s%n", uri);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>final Host host = new HostParser<MASK><NEW_LINE>switch(host.getProtocol().getType()) {<NEW_LINE>case file:<NEW_LINE>case b2:<NEW_LINE>case s3:<NEW_LINE>case googlestorage:<NEW_LINE>case swift:<NEW_LINE>case azure:<NEW_LINE>case googledrive:<NEW_LINE>case dropbox:<NEW_LINE>case onedrive:<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>if (StringUtils.isBlank(host.getHostname())) {<NEW_LINE>console.printf("Missing hostname in URI %s%n", uri);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (StringUtils.isBlank(host.getDefaultPath())) {<NEW_LINE>console.printf("Missing path in URI %s%n", uri);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} catch (HostParserException e) {<NEW_LINE>console.printf(e.getDetail());<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}
(factory).get(uri);
828,521
public static void main(String[] args) {<NEW_LINE>MySQLConnectOptions connectOptions = new MySQLConnectOptions().setPort(3306).setHost("localhost").setDatabase("mysql").setUser("root").setPassword("123456");<NEW_LINE>PoolOptions poolOptions = new <MASK><NEW_LINE>MySQLPool client = MySQLPool.pool(connectOptions, poolOptions);<NEW_LINE>Future<SqlConnection> connectionFuture = client.getConnection();<NEW_LINE>PreparedStatement preparedStatement1 = connectionFuture.flatMap(connection -> connection.prepare("SELECT 1")).toCompletionStage().toCompletableFuture().get();<NEW_LINE>Cursor cursor = preparedStatement1.cursor();<NEW_LINE>io.vertx.sqlclient.RowSet<Row> rows = cursor.read(8192).toCompletionStage().toCompletableFuture().get();<NEW_LINE>CountDownLatch countDownLatch = new CountDownLatch(1);<NEW_LINE>cursor.close().onComplete(new Handler<AsyncResult<Void>>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void handle(AsyncResult<Void> voidAsyncResult) {<NEW_LINE>countDownLatch.countDown();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>countDownLatch.await();<NEW_LINE>System.out.println();<NEW_LINE>// MySQLConnectOptions connectOptions = new MySQLConnectOptions()<NEW_LINE>// .setPort(3306)<NEW_LINE>// .setHost("0.0.0.0")<NEW_LINE>// .setDatabase("mysql")<NEW_LINE>// .setUser("root")<NEW_LINE>// .setPassword("123456");<NEW_LINE>//<NEW_LINE>// // Pool options<NEW_LINE>// PoolOptions poolOptions = new PoolOptions()<NEW_LINE>// .setMaxSize(5);<NEW_LINE>//<NEW_LINE>// for (int j = 0; j < 10; j++) {<NEW_LINE>// // Create the client pool<NEW_LINE>// MySQLPool client = (MySQLPoolImpl) MySQLPool.pool(connectOptions, poolOptions);<NEW_LINE>// Future<MySQLConnectionImpl> connectionFuture = (Future) client.getConnection();<NEW_LINE>// connectionFuture.onSuccess(new Handler<MySQLConnectionImpl>() {<NEW_LINE>// @Override<NEW_LINE>// public void handle(MySQLConnectionImpl mySQLConnection) {<NEW_LINE>//<NEW_LINE>// }<NEW_LINE>// });<NEW_LINE>// List<Future> futures = new ArrayList<>();<NEW_LINE>// for (int i = 0; i < 1; i++) {<NEW_LINE>// Future<io.vertx.sqlclient.RowSet<Row>> rowSetFuture = client<NEW_LINE>// .query("SELECT 1")<NEW_LINE>// .execute().onComplete(rowSetAsyncResult -> client.close());<NEW_LINE>// futures.add(rowSetFuture);<NEW_LINE>// }<NEW_LINE>// System.out.println("aaaaaaaaaaaaaaaaaaa");<NEW_LINE>// CompositeFuture.join(futures).toCompletionStage().toCompletableFuture().get();<NEW_LINE>// System.out.println("bbbbbbb");<NEW_LINE>// client.close().toCompletionStage().toCompletableFuture().get();<NEW_LINE>// System.out.println("cccccccccccccccccc");<NEW_LINE>// A simple query<NEW_LINE>}
PoolOptions().setMaxSize(1);
137,722
public static SecurityContextInfo securityContextToJSON(SecurityContext secContext) {<NEW_LINE>if (secContext == null) {<NEW_LINE>System.out.println("SecurityContextUtils.securityContextToJSON return null");<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>SecurityContextInfo secInfo = new SecurityContextInfo();<NEW_LINE>secInfo.<MASK><NEW_LINE>secInfo.setUserPrincipal(secContext.getUserPrincipal() == null ? "null" : secContext.getUserPrincipal().getName());<NEW_LINE>secInfo.setSecure(secContext.isSecure());<NEW_LINE>secInfo.setUserInRoleAdmin(secContext.isUserInRole("admin"));<NEW_LINE>secInfo.setUserInRoleNull(secContext.isUserInRole(null));<NEW_LINE>secInfo.setUserInRoleUser(secContext.isUserInRole("user"));<NEW_LINE>System.out.println("SecurityContextUtils.securityContextToJSON return secInfo " + secInfo);<NEW_LINE>return secInfo;<NEW_LINE>}
setAuthScheme(secContext.getAuthenticationScheme());
1,214,864
static ImmutableMap<String, Module> loadBzlModules(Environment env, PackageIdentifier packageId, List<Pair<String, Location>> programLoads, List<BzlLoadValue.Key> keys, @Nullable BzlLoadFunction bzlLoadFunctionForInlining) throws NoSuchPackageException, InterruptedException {<NEW_LINE>List<BzlLoadValue> bzlLoads;<NEW_LINE>try {<NEW_LINE>bzlLoads = bzlLoadFunctionForInlining == null ? computeBzlLoadsNoInlining(env, keys) : computeBzlLoadsWithInlining(env, keys, bzlLoadFunctionForInlining);<NEW_LINE>} catch (BzlLoadFailedException e) {<NEW_LINE>Throwable <MASK><NEW_LINE>throw PackageFunctionException.builder().setType(PackageFunctionException.Type.BUILD_FILE_CONTAINS_ERRORS).setPackageIdentifier(packageId).setException(rootCause instanceof IOException ? (IOException) rootCause : null).setMessage(e.getMessage()).setPackageLoadingCode(PackageLoading.Code.IMPORT_STARLARK_FILE_ERROR).buildCause();<NEW_LINE>}<NEW_LINE>if (bzlLoads == null) {<NEW_LINE>// Skyframe deps unavailable<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// Build map of loaded modules.<NEW_LINE>Map<String, Module> loadedModules = Maps.newLinkedHashMapWithExpectedSize(bzlLoads.size());<NEW_LINE>for (int i = 0; i < bzlLoads.size(); i++) {<NEW_LINE>// dups ok<NEW_LINE>loadedModules.put(programLoads.get(i).first, bzlLoads.get(i).getModule());<NEW_LINE>}<NEW_LINE>return ImmutableMap.copyOf(loadedModules);<NEW_LINE>}
rootCause = Throwables.getRootCause(e);
1,591,866
public void scheduleTimerForAutomaticSaving() {<NEW_LINE>if (!(UrlManager.getController() instanceof MFileManager) || GraphicsEnvironment.isHeadless() || !autosaveEnabled) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final int numberOfTempFiles = Integer.parseInt(ResourceController.getResourceController().getProperty("number_of_different_files_for_automatic_save"));<NEW_LINE>if (numberOfTempFiles == 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final boolean filesShouldBeDeletedAfterShutdown = ResourceController.getResourceController().getBooleanProperty("delete_automatic_saves_at_exit");<NEW_LINE>final int delay = ResourceController.getResourceController().getTimeProperty("time_for_automatic_save");<NEW_LINE>if (delay == 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final Timer timer = new Timer(delay, new DoAutomaticSave<MASK><NEW_LINE>timer.setRepeats(true);<NEW_LINE>timer.start();<NEW_LINE>this.timerForAutomaticSaving = timer;<NEW_LINE>}
(this, numberOfTempFiles, filesShouldBeDeletedAfterShutdown));
1,838,549
public PropertiesPanel createPanel(final Snapshot dataSource) {<NEW_LINE>PropertiesPanel panel = new PropertiesPanel();<NEW_LINE>panel.setLayout(new BorderLayout());<NEW_LINE>JLabel l = new JLabel();<NEW_LINE>l.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 5));<NEW_LINE>panel.add(l, BorderLayout.WEST);<NEW_LINE>JTextField f = new JTextField() {<NEW_LINE><NEW_LINE>public void setUI(TextUI ui) {<NEW_LINE>super.setUI(new BasicTextFieldUI());<NEW_LINE>}<NEW_LINE>};<NEW_LINE>f.setCursor(Cursor.getPredefinedCursor(Cursor.TEXT_CURSOR));<NEW_LINE>f.setEditable(false);<NEW_LINE>f.setOpaque(false);<NEW_LINE>f.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));<NEW_LINE>Dimension size = f.getPreferredSize();<NEW_LINE>size.width = 1;<NEW_LINE>f.setPreferredSize(size);<NEW_LINE>f.setMinimumSize(size);<NEW_LINE>panel.add(f, BorderLayout.CENTER);<NEW_LINE>File file = dataSource.getFile();<NEW_LINE>if (file == null) {<NEW_LINE>// NOI18N<NEW_LINE>l.setText(NbBundle.getMessage(GeneralPropertiesProvider.class, "LBL_File"));<NEW_LINE>// NOI18N<NEW_LINE>f.setText(NbBundle.getMessage(GeneralPropertiesProvider.class, "LBL_NoFile"));<NEW_LINE>} else if (file.isFile()) {<NEW_LINE>String path = null;<NEW_LINE>try {<NEW_LINE>path = file.getCanonicalPath();<NEW_LINE>} catch (IOException e) {<NEW_LINE>path = file.getAbsolutePath();<NEW_LINE>}<NEW_LINE>// NOI18N<NEW_LINE>l.setText(NbBundle.getMessage<MASK><NEW_LINE>f.setText(path);<NEW_LINE>} else if (file.isDirectory()) {<NEW_LINE>String path = null;<NEW_LINE>try {<NEW_LINE>path = file.getCanonicalPath();<NEW_LINE>} catch (IOException e) {<NEW_LINE>path = file.getAbsolutePath();<NEW_LINE>}<NEW_LINE>// NOI18N<NEW_LINE>l.setText(NbBundle.getMessage(GeneralPropertiesProvider.class, "LBL_Directory"));<NEW_LINE>f.setText(path);<NEW_LINE>} else {<NEW_LINE>// NOI18N<NEW_LINE>l.setText(NbBundle.getMessage(GeneralPropertiesProvider.class, "LBL_File"));<NEW_LINE>// NOI18N<NEW_LINE>f.setText(NbBundle.getMessage(GeneralPropertiesProvider.class, "LBL_UnavailableFile"));<NEW_LINE>}<NEW_LINE>f.setCaretPosition(0);<NEW_LINE>return panel;<NEW_LINE>}
(GeneralPropertiesProvider.class, "LBL_File"));
1,118,218
private int[] linearize(final FST fst) {<NEW_LINE>int[] linearized = new int[0];<NEW_LINE>int last = 0;<NEW_LINE>BitSet visited = new BitSet();<NEW_LINE>IntStack nodes = new IntArrayList();<NEW_LINE>nodes.push(fst.getRootNode());<NEW_LINE>while (!nodes.isEmpty()) {<NEW_LINE>final <MASK><NEW_LINE>if (visited.get(node)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (last >= linearized.length) {<NEW_LINE>linearized = Arrays.copyOf(linearized, linearized.length + 100000);<NEW_LINE>}<NEW_LINE>visited.set(node);<NEW_LINE>linearized[last++] = node;<NEW_LINE>for (int arc = fst.getFirstArc(node); arc != 0; arc = fst.getNextArc(arc)) {<NEW_LINE>if (!fst.isArcTerminal(arc)) {<NEW_LINE>int target = fst.getEndNode(arc);<NEW_LINE>if (!visited.get(target)) {<NEW_LINE>nodes.push(target);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return Arrays.copyOf(linearized, last);<NEW_LINE>}
int node = nodes.pop();
2,597
public void processHttpRequestMessage(HttpMessage message) {<NEW_LINE>// Get the session tokens for this site<NEW_LINE>HttpSessionTokensSet siteTokensSet = extension.getHttpSessionTokensSet(getSite());<NEW_LINE>// No tokens for this site, so no processing<NEW_LINE>if (siteTokensSet == null) {<NEW_LINE>log.debug("No session tokens for: " + this.getSite());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Get the matching session, based on the request header<NEW_LINE>List<HttpCookie> requestCookies = message.getRequestHeader().getHttpCookies();<NEW_LINE>HttpSession session = getMatchingHttpSession(requestCookies, siteTokensSet);<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("Matching session for request message (for site " + getSite() + "): " + session);<NEW_LINE>}<NEW_LINE>// If any session is active (forced), change the necessary cookies<NEW_LINE>if (activeSession != null && activeSession != session) {<NEW_LINE>CookieBasedSessionManagementHelper.<MASK><NEW_LINE>} else {<NEW_LINE>if (activeSession == session) {<NEW_LINE>log.debug("Session of request message is the same as the active session, so no request changes needed.");<NEW_LINE>} else {<NEW_LINE>log.debug("No active session is selected.");<NEW_LINE>}<NEW_LINE>// Store the session in the HttpMessage for caching purpose<NEW_LINE>message.setHttpSession(session);<NEW_LINE>}<NEW_LINE>}
processMessageToMatchSession(message, requestCookies, activeSession);
1,099,710
static void parse_bc(ThreadContext context, IRubyObject self, RubyString str, RubyHash hash) {<NEW_LINE>final Ruby runtime = context.runtime;<NEW_LINE>RubyRegexp re = newRegexpFromCache(runtime, _parse_bc, RE_OPTION_IGNORECASE);<NEW_LINE>IRubyObject sub = subSpace(context, (RubyString) str, re);<NEW_LINE>if (sub != context.nil) {<NEW_LINE>// set_hash(context, (RubyHash) h, "_bc", context.tru);<NEW_LINE>}<NEW_LINE>boolean bc = sub != context.nil;<NEW_LINE>if (bc || hashGetTest(context, hash, "_bc")) {<NEW_LINE>// if (RTEST(ref_hash("_bc"))) part from _parse<NEW_LINE>RubyInteger y;<NEW_LINE>y = (RubyInteger) hashGet(context, hash, "year");<NEW_LINE>if (y != null) {<NEW_LINE>set_hash(context, hash, "year", y.negate().op_plus(context, 1));<NEW_LINE>}<NEW_LINE>y = (RubyInteger) hashGet(context, hash, "cwyear");<NEW_LINE>if (y != null) {<NEW_LINE>set_hash(context, hash, "cwyear", y.negate()<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.op_plus(context, 1));
1,719,168
protected String[] customCommandLineValidation() {<NEW_LINE>if (GENOTYPING_ERROR_RATE <= 0) {<NEW_LINE>return new String[] { "GENOTYPING_ERROR_RATE must be greater than zero. Found " + GENOTYPING_ERROR_RATE };<NEW_LINE>}<NEW_LINE>if (GENOTYPING_ERROR_RATE >= 1) {<NEW_LINE>return new String[] { "GENOTYPING_ERROR_RATE must be strictly less than 1, found " + GENOTYPING_ERROR_RATE };<NEW_LINE>}<NEW_LINE>if (SECOND_INPUT == null && INPUT_SAMPLE_MAP != null) {<NEW_LINE>return new String[] { "INPUT_SAMPLE_MAP can only be used when also using SECOND_INPUT" };<NEW_LINE>}<NEW_LINE>if (SECOND_INPUT == null && SECOND_INPUT_SAMPLE_MAP != null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>// check that reference is provided if using crams as input<NEW_LINE>if (REFERENCE_SEQUENCE == null) {<NEW_LINE>final List<String> allInputs = new ArrayList<>(INPUT);<NEW_LINE>allInputs.addAll(SECOND_INPUT);<NEW_LINE>for (final String input : allInputs) {<NEW_LINE>if (input.endsWith(SamReader.Type.CRAM_TYPE.fileExtension())) {<NEW_LINE>return new String[] { "REFERENCE must be provided when using CRAM as input." };<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return super.customCommandLineValidation();<NEW_LINE>}
return new String[] { "SECOND_INPUT_SAMPLE_MAP can only be used when also using SECOND_INPUT" };
431,458
public static void linkToExistingJdk(String path, int version) {<NEW_LINE>Path jdkPath = getJdkPath(version);<NEW_LINE>Util.verboseMsg("Trying to link " + path + " to " + jdkPath);<NEW_LINE>if (Files.exists(jdkPath)) {<NEW_LINE>Util.verboseMsg("JBang managed JDK already exists, must be deleted to make sure linking works");<NEW_LINE>Util.deletePath(jdkPath, false);<NEW_LINE>}<NEW_LINE>Path linkedJdkPath = Paths.get(path);<NEW_LINE>if (!Files.isDirectory(linkedJdkPath)) {<NEW_LINE>throw new ExitException(EXIT_INVALID_INPUT, "Unable to resolve path as directory: " + path);<NEW_LINE>}<NEW_LINE>Optional<Integer> ver = resolveJavaVersionFromPath(linkedJdkPath);<NEW_LINE>if (ver.isPresent()) {<NEW_LINE>Integer linkedJdkVersion = ver.get();<NEW_LINE>if (linkedJdkVersion == version) {<NEW_LINE>Util.createLink(jdkPath, linkedJdkPath);<NEW_LINE>Util.infoMsg("JDK " + version + " has been linked to: " + linkedJdkPath);<NEW_LINE>} else {<NEW_LINE>throw new ExitException(EXIT_INVALID_INPUT, "Java version in given path: " + path + " is " + linkedJdkVersion + " which does not match the requested version " + version + "");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new <MASK><NEW_LINE>}<NEW_LINE>}
ExitException(EXIT_INVALID_INPUT, "Unable to determine Java version in given path: " + path);
1,645,517
public void handleData(ByteBuffer buf, Link link) {<NEW_LINE>if (verbose)<NEW_LINE>System.out.println("[" + <MASK><NEW_LINE>// (2 bytes): A 16-bit, unsigned integer. The update type. This field MUST<NEW_LINE>// be set to UPDATETYPE_PALETTE (0x0002).<NEW_LINE>int updateType = buf.readUnsignedShortLE();<NEW_LINE>if (updateType != UPDATETYPE_PALETTE)<NEW_LINE>throw new RuntimeException("Unexpected update type. Expected type: UPDATETYPE_PALETTE (0x0002), actual value: " + updateType + ", data: " + buf + ".");<NEW_LINE>// pad2Octets (2 bytes): A 16-bit, unsigned integer. Padding. Values in this<NEW_LINE>// field MUST be ignored.<NEW_LINE>buf.skipBytes(2);<NEW_LINE>// (4 bytes): A 32-bit, unsigned integer. The number of RGB triplets in the<NEW_LINE>// paletteData field. This field MUST be set to 256 (the number of entries<NEW_LINE>// in an 8 bpp palette).<NEW_LINE>int numberColors = (int) buf.readUnsignedIntLE();<NEW_LINE>if (numberColors != 256)<NEW_LINE>throw new RuntimeException("Unexpected value for number of color field in server Palette Update packet. Expected value: 256 colors, actual value: " + numberColors + ", data: " + buf + ".");<NEW_LINE>// (variable): An array of palette entries in RGB triplet format packed on<NEW_LINE>// byte boundaries. The number of triplet entries is given by the<NEW_LINE>// numberColors field.<NEW_LINE>ByteBuffer paletteEntries = buf.readBytes(numberColors * 3);<NEW_LINE>// In the case of a Palette Update, the client MUST update the global<NEW_LINE>// palette on all drawing surfaces<NEW_LINE>screen.colorMap = new IndexColorModel(8, numberColors, paletteEntries.data, paletteEntries.offset, false);
this + "] INFO: Data received: " + buf + ".");
34,985
private ImmutableList<ModuleDependencyMetadata> filterDependencies(DefaultConfigurationMetadata config) {<NEW_LINE>if (dependencies.isEmpty()) {<NEW_LINE>return ImmutableList.of();<NEW_LINE>}<NEW_LINE>int size = dependencies.size();<NEW_LINE>// If we're reaching this point, we're very likely going to iterate on the dependencies<NEW_LINE>// several times. It appears that iterating using `dependencies` is expensive because of<NEW_LINE>// the creation of an iterator and checking bounds. Iterating an array is faster.<NEW_LINE>if (dependenciesAsArray == null) {<NEW_LINE>dependenciesAsArray = dependencies.toArray(new MavenDependencyDescriptor[0]);<NEW_LINE>}<NEW_LINE>ImmutableList.Builder<ModuleDependencyMetadata> filteredDependencies = null;<NEW_LINE>boolean isOptionalConfiguration = "optional".equals(config.getName());<NEW_LINE>ImmutableSet<String> hierarchy = config.getHierarchy();<NEW_LINE>for (MavenDependencyDescriptor dependency : dependenciesAsArray) {<NEW_LINE>if (isOptionalConfiguration && includeInOptionalConfiguration(dependency)) {<NEW_LINE>ModuleDependencyMetadata element = new OptionalConfigurationDependencyMetadata(<MASK><NEW_LINE>if (size == 1) {<NEW_LINE>return ImmutableList.of(element);<NEW_LINE>}<NEW_LINE>if (filteredDependencies == null) {<NEW_LINE>filteredDependencies = ImmutableList.builder();<NEW_LINE>}<NEW_LINE>filteredDependencies.add(element);<NEW_LINE>} else if (include(dependency, hierarchy)) {<NEW_LINE>ModuleDependencyMetadata element = contextualize(config, getId(), dependency);<NEW_LINE>if (size == 1) {<NEW_LINE>return ImmutableList.of(element);<NEW_LINE>}<NEW_LINE>if (filteredDependencies == null) {<NEW_LINE>filteredDependencies = ImmutableList.builder();<NEW_LINE>}<NEW_LINE>filteredDependencies.add(element);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return filteredDependencies == null ? ImmutableList.of() : filteredDependencies.build();<NEW_LINE>}
config, getId(), dependency);
207,009
public void assignLabels(LingoProcessingContext context, DoubleMatrix2D stemCos, IntIntHashMap filteredRowToStemIndex, DoubleMatrix2D phraseCos) {<NEW_LINE>final PreprocessingContext preprocessingContext = context.preprocessingContext;<NEW_LINE>final int firstPhraseIndex = preprocessingContext.allLabels.firstPhraseIndex;<NEW_LINE>final int[] labelsFeatureIndex = preprocessingContext.allLabels.featureIndex;<NEW_LINE>final int[] mostFrequentOriginalWordIndex = preprocessingContext.allStems.mostFrequentOriginalWordIndex;<NEW_LINE>final int desiredClusterCount = stemCos.columns();<NEW_LINE>final IntArrayList clusterLabelFeatureIndex = new IntArrayList(desiredClusterCount);<NEW_LINE>final DoubleArrayList clusterLabelScore = new DoubleArrayList(desiredClusterCount);<NEW_LINE>for (int label = 0; label < desiredClusterCount; label++) {<NEW_LINE>final Pair<Integer, Integer> stemMax = max(stemCos);<NEW_LINE>final Pair<Integer, <MASK><NEW_LINE>if (stemMax == null && phraseMax == null) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>double stemScore = stemMax != null ? stemCos.getQuick(stemMax.objectA, stemMax.objectB) : -1;<NEW_LINE>double phraseScore = phraseMax != null ? phraseCos.getQuick(phraseMax.objectA, phraseMax.objectB) : -1;<NEW_LINE>if (phraseScore > stemScore) {<NEW_LINE>phraseCos.viewRow(phraseMax.objectA).assign(0);<NEW_LINE>phraseCos.viewColumn(phraseMax.objectB).assign(0);<NEW_LINE>stemCos.viewColumn(phraseMax.objectB).assign(0);<NEW_LINE>clusterLabelFeatureIndex.add(labelsFeatureIndex[phraseMax.objectA + firstPhraseIndex]);<NEW_LINE>clusterLabelScore.add(phraseScore);<NEW_LINE>} else {<NEW_LINE>stemCos.viewRow(stemMax.objectA).assign(0);<NEW_LINE>stemCos.viewColumn(stemMax.objectB).assign(0);<NEW_LINE>if (phraseCos != null) {<NEW_LINE>phraseCos.viewColumn(stemMax.objectB).assign(0);<NEW_LINE>}<NEW_LINE>clusterLabelFeatureIndex.add(mostFrequentOriginalWordIndex[filteredRowToStemIndex.get(stemMax.objectA)]);<NEW_LINE>clusterLabelScore.add(stemScore);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>context.clusterLabelFeatureIndex = clusterLabelFeatureIndex.toArray();<NEW_LINE>context.clusterLabelScore = clusterLabelScore.toArray();<NEW_LINE>}
Integer> phraseMax = max(phraseCos);
715,411
private void updateConstructorDisableInheritable(@NonNull final CtClass clazz) throws NotFoundException, CannotCompileException {<NEW_LINE>for (CtConstructor constructor : clazz.getDeclaredConstructors()) {<NEW_LINE>final CtClass[] parameterTypes = constructor.getParameterTypes();<NEW_LINE>final StringBuilder insertCode = new StringBuilder();<NEW_LINE>for (int i = 0; i < parameterTypes.length; i++) {<NEW_LINE>final String paramTypeName = parameterTypes[i].getName();<NEW_LINE>if (THREAD_FACTORY_CLASS_NAME.equals(paramTypeName)) {<NEW_LINE>String code = String.<MASK><NEW_LINE>insertCode.append(code);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (insertCode.length() > 0) {<NEW_LINE>logger.info("insert code before constructor " + signatureOfMethod(constructor) + " of class " + constructor.getDeclaringClass().getName() + ": " + insertCode);<NEW_LINE>constructor.insertBefore(insertCode.toString());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
format("$%d = com.alibaba.ttl.threadpool.TtlExecutors.getDisableInheritableThreadFactory($%<d);", i + 1);
1,169,677
static ParserState doShortInt(ParserState state, Object kwds, @SuppressWarnings("unused") char c, @SuppressWarnings("unused") char[] format, @SuppressWarnings("unused") int format_idx, Object kwdnames, Object varargs, @Shared("getArgNode") @Cached GetArgNode getArgNode, @Cached AsNativePrimitiveNode asNativePrimitiveNode, @Shared("writeOutVarNode") @Cached WriteOutVarNode writeOutVarNode, @Shared("excToNativeNode") @Cached TransformExceptionToNativeNode transformExceptionToNativeNode, @Shared("raiseNode") @Cached PRaiseNativeNode raiseNode) throws InteropException, ParseArgumentsException {<NEW_LINE>// C type: signed short int<NEW_LINE>Object arg = getArgNode.execute(state, kwds, kwdnames, state.restKeywordsOnly);<NEW_LINE>if (!skipOptionalArg(arg, state.restOptional)) {<NEW_LINE>try {<NEW_LINE>long ival = asNativePrimitiveNode.toInt64(arg, true);<NEW_LINE>// TODO(fa) MIN_VALUE and MAX_VALUE should be retrieved from Sulong<NEW_LINE>if (ival < Short.MIN_VALUE) {<NEW_LINE>throw raise(raiseNode, OverflowError, ErrorMessages.SIGNED_SHORT_INT_LESS_THAN_MIN);<NEW_LINE>} else if (ival > Short.MAX_VALUE) {<NEW_LINE>throw raise(raiseNode, OverflowError, ErrorMessages.SIGNED_SHORT_INT_GREATER_THAN_MAX);<NEW_LINE>}<NEW_LINE>writeOutVarNode.writeInt16(varargs, state.outIndex, ival);<NEW_LINE>} catch (PException e) {<NEW_LINE>CompilerDirectives.transferToInterpreter();<NEW_LINE><MASK><NEW_LINE>throw ParseArgumentsException.raise();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return state.incrementOutIndex();<NEW_LINE>}
transformExceptionToNativeNode.execute(null, e);
888,094
public Response addEvent(String content) throws IOException {<NEW_LINE>ObjectMapper mapper = new ObjectMapper();<NEW_LINE>LOGGER.info(String.format("JSON content: '%s'", content));<NEW_LINE>JsonNode input = mapper.readTree(content);<NEW_LINE>String eventType = getStringField(input, "eventType");<NEW_LINE>String groupType = getStringField(input, "groupType");<NEW_LINE>String groupName = getStringField(input, "groupName");<NEW_LINE>String chaosTypeName = getStringField(input, "chaosType");<NEW_LINE>ChaosType chaosType;<NEW_LINE>if (!Strings.isNullOrEmpty(chaosTypeName)) {<NEW_LINE>chaosType = ChaosType.parse(this.monkey.getChaosTypes(), chaosTypeName);<NEW_LINE>} else {<NEW_LINE>chaosType = new ShutdownInstanceChaosType(monkey.context().configuration());<NEW_LINE>}<NEW_LINE>Response.Status responseStatus;<NEW_LINE>ByteArrayOutputStream baos = new ByteArrayOutputStream();<NEW_LINE>JsonGenerator gen = JSON_FACTORY.createJsonGenerator(baos, JsonEncoding.UTF8);<NEW_LINE>gen.writeStartObject();<NEW_LINE>gen.writeStringField("eventType", eventType);<NEW_LINE><MASK><NEW_LINE>gen.writeStringField("groupName", groupName);<NEW_LINE>gen.writeStringField("chaosType", chaosType.getKey());<NEW_LINE>if (StringUtils.isEmpty(eventType) || StringUtils.isEmpty(groupType) || StringUtils.isEmpty(groupName)) {<NEW_LINE>responseStatus = Response.Status.BAD_REQUEST;<NEW_LINE>gen.writeStringField("message", "eventType, groupType, and groupName parameters are all required");<NEW_LINE>} else {<NEW_LINE>if (eventType.equals("CHAOS_TERMINATION")) {<NEW_LINE>responseStatus = addTerminationEvent(groupType, groupName, chaosType, gen);<NEW_LINE>} else {<NEW_LINE>responseStatus = Response.Status.BAD_REQUEST;<NEW_LINE>gen.writeStringField("message", String.format("Unrecognized event type: %s", eventType));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>gen.writeEndObject();<NEW_LINE>gen.close();<NEW_LINE>LOGGER.info("entity content is '{}'", baos.toString("UTF-8"));<NEW_LINE>return Response.status(responseStatus).entity(baos.toString("UTF-8")).build();<NEW_LINE>}
gen.writeStringField("groupType", groupType);
239,842
private <T> T[] buildArray(Instance instance, String field, Class<T> type, InstanceBuilder<? extends T> builder, boolean allowNull, boolean allowNullValues) throws InvalidFieldException {<NEW_LINE>ObjectArrayInstance array = get(instance, field, ObjectArrayInstance.class, allowNull);<NEW_LINE>if (array == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>List<Instance> list = array.getValues();<NEW_LINE>T[] result = (T[]) Array.newInstance(builder.getType(), list.size());<NEW_LINE>for (int i = 0; i < result.length; i++) {<NEW_LINE>try {<NEW_LINE>InstanceBuilder<? extends T> itemBuilder = builder == null ? registry.getBuilder(instance, type) : builder;<NEW_LINE>result[i] = itemBuilder.convert(this, castValue(notNullCheck(list.get(i), allowNullValues), Instance.class));<NEW_LINE>} catch (InvalidFieldException ex) {<NEW_LINE>throw new InvalidFieldException(instance, field, "Invalid value at index %d: %s", i, ex.getMessage<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
()).initCause(ex);
807,793
public boolean insertGroup(String domainName, Group group) {<NEW_LINE>int affectedRows;<NEW_LINE>final String caller = "insertGroup";<NEW_LINE>String groupName = ZMSUtils.extractGroupName(domainName, group.getName());<NEW_LINE>if (groupName == null) {<NEW_LINE>throw requestError(caller, "domain name mismatch: " + domainName + " insert group name: " + group.getName());<NEW_LINE>}<NEW_LINE>int domainId = getDomainId(domainName);<NEW_LINE>if (domainId == 0) {<NEW_LINE>throw notFoundError(caller, ZMSConsts.OBJECT_DOMAIN, domainName);<NEW_LINE>}<NEW_LINE>try (PreparedStatement ps = con.prepareStatement(SQL_INSERT_GROUP)) {<NEW_LINE>ps.setString(1, groupName);<NEW_LINE>ps.setInt(2, domainId);<NEW_LINE>ps.setBoolean(3, processInsertValue(group.getAuditEnabled(), false));<NEW_LINE>ps.setBoolean(4, processInsertValue(group<MASK><NEW_LINE>ps.setBoolean(5, processInsertValue(group.getReviewEnabled(), false));<NEW_LINE>ps.setString(6, processInsertValue(group.getNotifyRoles()));<NEW_LINE>ps.setString(7, processInsertValue(group.getUserAuthorityFilter()));<NEW_LINE>ps.setString(8, processInsertValue(group.getUserAuthorityExpiration()));<NEW_LINE>ps.setInt(9, processInsertValue(group.getMemberExpiryDays()));<NEW_LINE>ps.setInt(10, processInsertValue(group.getServiceExpiryDays()));<NEW_LINE>affectedRows = executeUpdate(ps, caller);<NEW_LINE>} catch (SQLException ex) {<NEW_LINE>throw sqlError(ex, caller);<NEW_LINE>}<NEW_LINE>return (affectedRows > 0);<NEW_LINE>}
.getSelfServe(), false));
699,818
public UcoreInterface.SubscribeNodesOutput subscribeNodes(UcoreInterface.SubscribeNodesInput subscribeNodesInput) throws IOException {<NEW_LINE>try {<NEW_LINE>return stub.withDeadlineAfter(GRPC_SUBTIMEOUT, TimeUnit<MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>// the first try failure ,try for all the other ucore ip<NEW_LINE>for (String ip : getAvailableIpList()) {<NEW_LINE>ManagedChannel channel = null;<NEW_LINE>try {<NEW_LINE>channel = ManagedChannelBuilder.forAddress(ip, ClusterConfig.getInstance().getClusterPort()).usePlaintext(true).build();<NEW_LINE>setStubIfPossible(UcoreGrpc.newBlockingStub(channel).withDeadlineAfter(GRPC_SUBTIMEOUT, TimeUnit.SECONDS));<NEW_LINE>return stub.withDeadlineAfter(GRPC_SUBTIMEOUT, TimeUnit.SECONDS).subscribeNodes(subscribeNodesInput);<NEW_LINE>} catch (Exception e2) {<NEW_LINE>LOGGER.info("try connection IP " + ip + " failure ", e2);<NEW_LINE>if (channel != null) {<NEW_LINE>channel.shutdownNow();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>throw new IOException(ERROR_MSG + "ips:" + ipList.toString() + ",port:" + ClusterConfig.getInstance().getClusterPort());<NEW_LINE>}
.SECONDS).subscribeNodes(subscribeNodesInput);
1,655,434
public JSDynamicObject propertyHandlerInstantiate(JSContext context, JSRealm realm, ObjectTemplate template, JSDynamicObject target, boolean global) {<NEW_LINE>JSDynamicObject handler = JSUncheckedProxyHandler.create(context, realm);<NEW_LINE>JSDynamicObject proxy = JSProxy.create(context, realm, target, handler);<NEW_LINE>ContextData engineCacheData = getContextEmbedderData(context);<NEW_LINE>JSDynamicObject getter = instantiateNativePropertyHandlerFunction(template, realm, GETTER, proxy);<NEW_LINE>JSObject.set(handler, JSProxy.GET, getter);<NEW_LINE>JSDynamicObject setter = instantiateNativePropertyHandlerFunction(template, realm, SETTER, proxy);<NEW_LINE>JSObject.set(handler, JSProxy.SET, setter);<NEW_LINE>JSDynamicObject query = instantiateNativePropertyHandlerFunction(template, realm, QUERY, proxy);<NEW_LINE>JSObject.set(handler, JSProxy.HAS, query);<NEW_LINE>JSDynamicObject deleter = instantiateNativePropertyHandlerFunction(<MASK><NEW_LINE>JSObject.set(handler, JSProxy.DELETE_PROPERTY, deleter);<NEW_LINE>JSDynamicObject ownKeys = instantiateNativePropertyHandlerFunction(template, realm, OWN_KEYS, proxy);<NEW_LINE>JSObject.set(handler, JSProxy.OWN_KEYS, ownKeys);<NEW_LINE>JSDynamicObject getOwnPropertyDescriptor = instantiateNativePropertyHandlerFunction(template, realm, GET_OWN_PROPERTY_DESCRIPTOR, proxy);<NEW_LINE>JSObject.set(handler, JSProxy.GET_OWN_PROPERTY_DESCRIPTOR, getOwnPropertyDescriptor);<NEW_LINE>JSDynamicObject defineProperty = instantiateNativePropertyHandlerFunction(template, realm, DEFINE_PROPERTY, proxy);<NEW_LINE>JSObject.set(handler, JSProxy.DEFINE_PROPERTY, defineProperty);<NEW_LINE>ContextData.FunctionKey nodeType = global ? PropertyHandlerPrototypeGlobal : PropertyHandlerPrototype;<NEW_LINE>JSFunctionData getPrototypeOfFunctionData = engineCacheData.getOrCreateFunctionData(nodeType, (c) -> {<NEW_LINE>JavaScriptRootNode rootNode = new PropertyHandlerPrototypeNode(global);<NEW_LINE>return JSFunctionData.createCallOnly(c, rootNode.getCallTarget(), 0, Strings.EMPTY_STRING);<NEW_LINE>});<NEW_LINE>JSDynamicObject getPrototypeOf = functionFromFunctionData(realm, getPrototypeOfFunctionData, null);<NEW_LINE>JSObject.set(handler, JSProxy.GET_PROTOTYPE_OF, getPrototypeOf);<NEW_LINE>for (Value value : template.getValues()) {<NEW_LINE>Object name = value.getName();<NEW_LINE>if (name instanceof HiddenKey) {<NEW_LINE>JSObjectUtil.putHiddenProperty(proxy, name, value.getValue());<NEW_LINE>}<NEW_LINE>// else set on target (in objectTemplateInstantiate) already<NEW_LINE>}<NEW_LINE>int internalFieldCount = template.getInternalFieldCount();<NEW_LINE>if (internalFieldCount > 0) {<NEW_LINE>JSObjectUtil.putHiddenProperty(proxy, INTERNAL_FIELD_COUNT_KEY, internalFieldCount);<NEW_LINE>}<NEW_LINE>return proxy;<NEW_LINE>}
template, realm, DELETER, proxy);
1,231,586
final DeleteSourceLocationResult executeDeleteSourceLocation(DeleteSourceLocationRequest deleteSourceLocationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteSourceLocationRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteSourceLocationRequest> request = null;<NEW_LINE>Response<DeleteSourceLocationResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteSourceLocationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteSourceLocationRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "MediaTailor");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteSourceLocation");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteSourceLocationResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteSourceLocationResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
HandlerContextKey.SIGNING_REGION, getSigningRegion());
1,777,315
private Contentlet fireUnarchiveWithSave(final Contentlet contentlet, final ContentletDependencies dependencies, final String actionId, final User user) throws DotDataException, DotSecurityException {<NEW_LINE>final String disableWorkflow = Contentlet.DISABLE_WORKFLOW;<NEW_LINE>final boolean hasUnarchiveActionlet = UtilMethods.isSet(actionId) ? workflowAPI.findAction(actionId, <MASK><NEW_LINE>if (UtilMethods.isSet(actionId)) {<NEW_LINE>contentlet.setActionId(actionId);<NEW_LINE>}<NEW_LINE>if (!hasUnarchiveActionlet) {<NEW_LINE>Logger.info(this, "The contentlet : " + contentlet.getTitle() + ", on the action id: " + actionId + ", does not have unarchive, so an unarchive will be fired (could autoassign if needed)");<NEW_LINE>contentletAPI.unarchive(contentlet, user, dependencies.isRespectAnonymousPermissions());<NEW_LINE>} else {<NEW_LINE>workflowAPI.fireContentWorkflow(contentlet, dependencies);<NEW_LINE>}<NEW_LINE>Logger.info(this, "The contentlet : " + contentlet.getTitle() + " has been unarchive, will do a checkin to save the body");<NEW_LINE>// the contentlet is already unarchive, now we can do a save but not need to run a workflow.<NEW_LINE>contentlet.setBoolProperty(disableWorkflow, true);<NEW_LINE>final Contentlet checkoutContentlet = new SaveContentActionlet().checkout(contentlet, dependencies.getModUser());<NEW_LINE>return contentletAPI.checkin(checkoutContentlet, dependencies);<NEW_LINE>}
user).hasUnarchiveActionlet() : false;
963,479
private int storeClasses(Iterator classes, int start) {<NEW_LINE>int initialSize = cache.size();<NEW_LINE>try {<NEW_LINE>// register this class for notifications<NEW_LINE>register(this);<NEW_LINE>while (classes.hasNext()) {<NEW_LINE>J9ClassPointer ptr = (J9ClassPointer) classes.next();<NEW_LINE>log.fine(String.format("Found JavaClass at 0x%016x", ptr.getAddress()));<NEW_LINE>DTFJJavaClass clazz = new DTFJJavaClass(ptr);<NEW_LINE>try {<NEW_LINE>// store the DTFJ class name rather than the underlying J9 name as API users will supply the DTFJ name<NEW_LINE>names.put(clazz.getName(), start + (cache.size() - initialSize));<NEW_LINE>cache.add(clazz);<NEW_LINE>} catch (CorruptDataException e) {<NEW_LINE>cache.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>// remove notifier registration<NEW_LINE>unregister(this);<NEW_LINE>}<NEW_LINE>// return how many items were placed in the cache as a result of executing this function<NEW_LINE>return cache.size() - initialSize;<NEW_LINE>}
add(e.getCorruptData());
840,217
public void onResume() {<NEW_LINE>super.onResume();<NEW_LINE>SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(getActivity());<NEW_LINE>// if we are returning from DropBox authentication, save the key which was generated<NEW_LINE>String keyDefaultEmail = getString(R.string.key_default_export_email);<NEW_LINE>Preference pref = findPreference(keyDefaultEmail);<NEW_LINE>String defaultEmail = sharedPrefs.getString(keyDefaultEmail, null);<NEW_LINE>if (defaultEmail != null && !defaultEmail.trim().isEmpty()) {<NEW_LINE>pref.setSummary(defaultEmail);<NEW_LINE>}<NEW_LINE>pref.setOnPreferenceChangeListener(this);<NEW_LINE>String keyDefaultExportFormat = getString(R.string.key_default_export_format);<NEW_LINE>pref = findPreference(keyDefaultExportFormat);<NEW_LINE>String defaultExportFormat = <MASK><NEW_LINE>if (defaultExportFormat != null && !defaultExportFormat.trim().isEmpty()) {<NEW_LINE>pref.setSummary(defaultExportFormat);<NEW_LINE>}<NEW_LINE>pref.setOnPreferenceChangeListener(this);<NEW_LINE>pref = findPreference(getString(R.string.key_restore_backup));<NEW_LINE>pref.setOnPreferenceClickListener(this);<NEW_LINE>pref = findPreference(getString(R.string.key_create_backup));<NEW_LINE>pref.setOnPreferenceClickListener(this);<NEW_LINE>pref = findPreference(getString(R.string.key_backup_location));<NEW_LINE>pref.setOnPreferenceClickListener(this);<NEW_LINE>String defaultBackupLocation = BackupManager.getBookBackupFileUri(BooksDbAdapter.getInstance().getActiveBookUID());<NEW_LINE>if (defaultBackupLocation != null) {<NEW_LINE>pref.setSummary(Uri.parse(defaultBackupLocation).getAuthority());<NEW_LINE>}<NEW_LINE>pref = findPreference(getString(R.string.key_dropbox_sync));<NEW_LINE>pref.setOnPreferenceClickListener(this);<NEW_LINE>toggleDropboxPreference(pref);<NEW_LINE>pref = findPreference(getString(R.string.key_owncloud_sync));<NEW_LINE>pref.setOnPreferenceClickListener(this);<NEW_LINE>toggleOwnCloudPreference(pref);<NEW_LINE>}
sharedPrefs.getString(keyDefaultExportFormat, null);
1,818,794
public void onHandleIntent(Intent intent) {<NEW_LINE>sharedPrefs = getSharedPreferences("com.klinker.android.twitter_world_preferences", 0);<NEW_LINE>Context context = getApplicationContext();<NEW_LINE>AppSettings settings = AppSettings.getInstance(context);<NEW_LINE>// if they have mobile data on and don't want to sync over mobile data<NEW_LINE>if (Utils.getConnectionStatus(context) && !settings.syncMobile) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Twitter twitter = Utils.getTwitter(context, settings);<NEW_LINE>int currentAccount = sharedPrefs.getInt("current_account", 1);<NEW_LINE>MentionsDataSource <MASK><NEW_LINE>long[] lastId = dataSource.getLastIds(currentAccount);<NEW_LINE>Paging paging;<NEW_LINE>paging = new Paging(1, 200);<NEW_LINE>if (lastId[0] > 0) {<NEW_LINE>paging.sinceId(lastId[0]);<NEW_LINE>}<NEW_LINE>List<twitter4j.Status> statuses = twitter.getMentionsTimeline(paging);<NEW_LINE>int inserted = MentionsDataSource.getInstance(context).insertTweets(statuses, currentAccount);<NEW_LINE>sharedPrefs.edit().putBoolean("refresh_me", true).commit();<NEW_LINE>sharedPrefs.edit().putBoolean("refresh_me_mentions", true).commit();<NEW_LINE>if (settings.notifications && settings.mentionsNot && inserted > 0) {<NEW_LINE>if (intent.getBooleanExtra("from_launcher", false)) {<NEW_LINE>NotificationUtils.refreshNotification(context, true);<NEW_LINE>} else {<NEW_LINE>NotificationUtils.refreshNotification(context);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (settings.syncSecondMentions) {<NEW_LINE>startService(new Intent(context, SecondMentionsRefreshService.class));<NEW_LINE>}<NEW_LINE>} catch (TwitterException e) {<NEW_LINE>// Error in updating status<NEW_LINE>Log.d("Twitter Update Error", e.getMessage());<NEW_LINE>}<NEW_LINE>}
dataSource = MentionsDataSource.getInstance(context);
17,236
protected void onCreate(@Nullable Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>setContentView(R.layout.activity_main);<NEW_LINE>// authentication with an API key or named user is required to access basemaps and other<NEW_LINE>// location services<NEW_LINE>ArcGISRuntimeEnvironment.setApiKey(BuildConfig.API_KEY);<NEW_LINE>mMapView = findViewById(R.id.mapView);<NEW_LINE>// create a map with streets basemap<NEW_LINE>ArcGISMap map = new ArcGISMap(BasemapStyle.ARCGIS_STREETS);<NEW_LINE>// create service feature table from URL<NEW_LINE>mFeatureTable = new ServiceFeatureTable(getString(R.string.feature_layer_url));<NEW_LINE>// create a feature layer from table<NEW_LINE>mFeatureLayer = new FeatureLayer(mFeatureTable);<NEW_LINE>// add the layer to the map<NEW_LINE>map.<MASK><NEW_LINE>mMapView.setOnTouchListener(new DefaultMapViewOnTouchListener(this, mMapView) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean onSingleTapConfirmed(MotionEvent event) {<NEW_LINE>// create a point from where the user clicked<NEW_LINE>android.graphics.Point screenPoint = new android.graphics.Point((int) event.getX(), (int) event.getY());<NEW_LINE>// create a map point from a screen point<NEW_LINE>Point mapPoint = mMapView.screenToLocation(screenPoint);<NEW_LINE>// identify the clicked feature<NEW_LINE>ListenableFuture<IdentifyLayerResult> identifyLayerFuture = mMapView.identifyLayerAsync(mFeatureLayer, screenPoint, 1, false);<NEW_LINE>identifyLayerFuture.addDoneListener(() -> {<NEW_LINE>try {<NEW_LINE>IdentifyLayerResult layer = identifyLayerFuture.get();<NEW_LINE>// get first element found and ensure that it is an instance of Feature before allowing user to delete<NEW_LINE>// using callout<NEW_LINE>if (!layer.getElements().isEmpty() && layer.getElements().get(0) instanceof Feature) {<NEW_LINE>inflateCallout(mMapView, layer.getElements().get(0), mapPoint).show();<NEW_LINE>}<NEW_LINE>} catch (InterruptedException | ExecutionException e) {<NEW_LINE>logToUser(true, getString(R.string.error_getting_identify_result, e.getCause().getMessage()));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return super.onSingleTapConfirmed(event);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>// set map to be displayed in map view<NEW_LINE>mMapView.setMap(map);<NEW_LINE>mMapView.setViewpoint(new Viewpoint(40, -95, 100000000));<NEW_LINE>}
getOperationalLayers().add(mFeatureLayer);
400,352
@Operation(summary = "Check authorization for updating the group, readOnlyGroups, and readWriteGroups for a SingularityRequest, without committing the change", responses = { @ApiResponse(responseCode = "400", description = "Request object is invalid"), @ApiResponse(responseCode = "401", description = "User is not authorized to make these updates") })<NEW_LINE>public Response checkAuthForGroupsUpdate(@Parameter(hidden = true) @Auth SingularityUser user, @Parameter(required = true, description = "The id of the request to update") @PathParam("requestId") String requestId, @RequestBody(required = true, description = "Updated group settings") SingularityUpdateGroupsRequest updateGroupsRequest) {<NEW_LINE>Optional<SingularityRequestWithState> maybeOldRequestWithState = requestManager.getRequest(requestId, false);<NEW_LINE>if (!maybeOldRequestWithState.isPresent()) {<NEW_LINE>// check against dummy request with same groups if none present in zk<NEW_LINE>authorizationHelper.checkForAuthorization(new SingularityRequestBuilder(requestId, RequestType.WORKER).setGroup(updateGroupsRequest.getGroup()).setReadWriteGroups(Optional.of(updateGroupsRequest.getReadWriteGroups())).setReadOnlyGroups(Optional.of(updateGroupsRequest.getReadOnlyGroups())).setActionPermissions(updateGroupsRequest.getActionPermissions()).build(), user, SingularityAuthorizationScope.WRITE);<NEW_LINE>return Response.ok().build();<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>authorizationHelper.checkForAuthorization(oldRequestWithState.getRequest(), user, SingularityAuthorizationScope.WRITE);<NEW_LINE>SingularityRequest newRequest = oldRequestWithState.getRequest().toBuilder().setGroup(updateGroupsRequest.getGroup()).setReadWriteGroups(Optional.of(updateGroupsRequest.getReadWriteGroups())).setReadOnlyGroups(Optional.of(updateGroupsRequest.getReadOnlyGroups())).setActionPermissions(updateGroupsRequest.getActionPermissions()).build();<NEW_LINE>authorizationHelper.checkForAuthorizedChanges(newRequest, oldRequestWithState.getRequest(), user);<NEW_LINE>return Response.ok().build();<NEW_LINE>}
SingularityRequestWithState oldRequestWithState = maybeOldRequestWithState.get();
986,961
private void updateFunctionDef(long sourceFunctionDefDtID, FunctionDefinition sourceFunctionDefDt, FunctionDefinition destDt, Map<Long, DataType> resolvedDataTypes) {<NEW_LINE>// NOTE: it is possible for the same function def to be updated more than once;<NEW_LINE>// therefor we must cleanup any previous obsolete fixups<NEW_LINE>removeFixUps(sourceFunctionDefDtID);<NEW_LINE>long oldLastChangeTime = sourceFunctionDefDt.getLastChangeTime();<NEW_LINE>long oldLastChangeTimeInSourceArchive = sourceFunctionDefDt.getLastChangeTimeInSourceArchive();<NEW_LINE>DataTypeManager sourceDTM = sourceFunctionDefDt.getDataTypeManager();<NEW_LINE>DataType sourceReturnType = sourceFunctionDefDt.getReturnType();<NEW_LINE>ParameterDefinition[<MASK><NEW_LINE>ParameterDefinition[] destVars = new ParameterDefinition[sourceVars.length];<NEW_LINE>boolean sourceHasVarArgs = sourceFunctionDefDt.hasVarArgs();<NEW_LINE>DataType resolvedRDT = DataType.DEFAULT;<NEW_LINE>if (sourceReturnType != null) {<NEW_LINE>long returnTypeID = sourceDTM.getID(sourceReturnType);<NEW_LINE>resolvedRDT = getResolvedParam(sourceFunctionDefDtID, returnTypeID, -1, resolvedDataTypes);<NEW_LINE>}<NEW_LINE>destDt.setReturnType(resolvedRDT);<NEW_LINE>for (int i = 0; i < sourceVars.length; i++) {<NEW_LINE>DataType varDt = sourceVars[i].getDataType();<NEW_LINE>long varID = sourceDTM.getID(varDt);<NEW_LINE>DataType resolvedDt = getResolvedParam(sourceFunctionDefDtID, varID, i, resolvedDataTypes);<NEW_LINE>destVars[i] = new ParameterDefinitionImpl(sourceVars[i].getName(), resolvedDt, sourceVars[i].getComment());<NEW_LINE>}<NEW_LINE>destDt.setArguments(destVars);<NEW_LINE>destDt.setVarArgs(sourceHasVarArgs);<NEW_LINE>destDt.setLastChangeTime(oldLastChangeTime);<NEW_LINE>destDt.setLastChangeTimeInSourceArchive(oldLastChangeTimeInSourceArchive);<NEW_LINE>}
] sourceVars = sourceFunctionDefDt.getArguments();
1,199,180
protected void init() {<NEW_LINE>codeViewerService = tool.getService(CodeViewerService.class);<NEW_LINE>goToService = <MASK><NEW_LINE>FormatManager formatManager = codeViewerService.getFormatManager();<NEW_LINE>ServiceProvider diffServiceProvider = new DiffServiceProvider(formatManager.getServiceProvider(), this);<NEW_LINE>diffListingPanel = new ListingPanel(formatManager);<NEW_LINE>diffListingPanel.setProgramLocationListener(this);<NEW_LINE>diffListingPanel.setProgramSelectionListener(this);<NEW_LINE>diffListingPanel.getFieldPanel().addFieldMouseListener(new MyFieldMouseListener());<NEW_LINE>diffListingPanel.addMarginProvider(markerManager.getMarginProvider());<NEW_LINE>diffListingPanel.addOverviewProvider(markerManager.getOverviewProvider());<NEW_LINE>diffNavigatable = new DiffNavigatable(this, codeViewerService.getNavigatable());<NEW_LINE>diffFieldNavigator = new FieldNavigator(diffServiceProvider, diffNavigatable);<NEW_LINE>diffListingPanel.addButtonPressedListener(diffFieldNavigator);<NEW_LINE>help.registerHelp(diffListingPanel, new HelpLocation("Diff", "Program_Differences"));<NEW_LINE>GoToService diffMarkerGoToService = diffServiceProvider.getService(GoToService.class);<NEW_LINE>markerManager.setGoToService(diffMarkerGoToService);<NEW_LINE>actionManager.setCodeViewerService(codeViewerService);<NEW_LINE>setupOptions();<NEW_LINE>execDiffFilter = new ProgramDiffFilter(ProgramDiffFilter.ALL_DIFFS);<NEW_LINE>isLimitedToSelection = false;<NEW_LINE>applySettingsMgr = new DiffApplySettingsOptionManager(this);<NEW_LINE>applyFilter = applySettingsMgr.getDefaultApplyFilter();<NEW_LINE>codeViewerService.setCoordinatedListingPanelListener(new CoordinatedListingPanelListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void activeProgramChanged(Program newActiveProgram) {<NEW_LINE>setActiveProgram(newActiveProgram);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean listingClosed() {<NEW_LINE>if (primaryProgram != null) {<NEW_LINE>closeProgram2();<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
tool.getService(GoToService.class);
1,811,030
@Consumes({ "multipart/form-data" })<NEW_LINE>@Produces({ "application/json" })<NEW_LINE>@io.swagger.annotations.ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, authorizations = { @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags = { "pet" })<NEW_LINE>@io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) })<NEW_LINE>public Response uploadFile(@ApiParam(value = "ID of pet to update", required = true) @PathParam("petId") @NotNull Long petId, @FormDataParam("additionalMetadata") String additionalMetadata, @FormDataParam("file") FormDataBodyPart _fileBodypart, @Context SecurityContext securityContext) throws NotFoundException {<NEW_LINE>return delegate.uploadFile(<MASK><NEW_LINE>}
petId, additionalMetadata, _fileBodypart, securityContext);
789,442
public static DescribeGtmInstanceAddressPoolsResponse unmarshall(DescribeGtmInstanceAddressPoolsResponse describeGtmInstanceAddressPoolsResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeGtmInstanceAddressPoolsResponse.setRequestId(_ctx.stringValue("DescribeGtmInstanceAddressPoolsResponse.RequestId"));<NEW_LINE>describeGtmInstanceAddressPoolsResponse.setTotalItems(_ctx.integerValue("DescribeGtmInstanceAddressPoolsResponse.TotalItems"));<NEW_LINE>describeGtmInstanceAddressPoolsResponse.setTotalPages(_ctx.integerValue("DescribeGtmInstanceAddressPoolsResponse.TotalPages"));<NEW_LINE>describeGtmInstanceAddressPoolsResponse.setPageNumber(_ctx.integerValue("DescribeGtmInstanceAddressPoolsResponse.PageNumber"));<NEW_LINE>describeGtmInstanceAddressPoolsResponse.setPageSize(_ctx.integerValue("DescribeGtmInstanceAddressPoolsResponse.PageSize"));<NEW_LINE>List<AddrPool> addrPools = new ArrayList<AddrPool>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeGtmInstanceAddressPoolsResponse.AddrPools.Length"); i++) {<NEW_LINE>AddrPool addrPool = new AddrPool();<NEW_LINE>addrPool.setAddrPoolId(_ctx.stringValue("DescribeGtmInstanceAddressPoolsResponse.AddrPools[" + i + "].AddrPoolId"));<NEW_LINE>addrPool.setCreateTime(_ctx.stringValue("DescribeGtmInstanceAddressPoolsResponse.AddrPools[" + i + "].CreateTime"));<NEW_LINE>addrPool.setCreateTimestamp(_ctx.longValue("DescribeGtmInstanceAddressPoolsResponse.AddrPools[" + i + "].CreateTimestamp"));<NEW_LINE>addrPool.setUpdateTime(_ctx.stringValue("DescribeGtmInstanceAddressPoolsResponse.AddrPools[" + i + "].UpdateTime"));<NEW_LINE>addrPool.setUpdateTimestamp(_ctx.longValue("DescribeGtmInstanceAddressPoolsResponse.AddrPools[" + i + "].UpdateTimestamp"));<NEW_LINE>addrPool.setAddrCount(_ctx.integerValue("DescribeGtmInstanceAddressPoolsResponse.AddrPools[" + i + "].AddrCount"));<NEW_LINE>addrPool.setMinAvailableAddrNum(_ctx.integerValue("DescribeGtmInstanceAddressPoolsResponse.AddrPools[" + i + "].MinAvailableAddrNum"));<NEW_LINE>addrPool.setMonitorConfigId(_ctx.stringValue("DescribeGtmInstanceAddressPoolsResponse.AddrPools[" + i + "].MonitorConfigId"));<NEW_LINE>addrPool.setMonitorStatus(_ctx.stringValue("DescribeGtmInstanceAddressPoolsResponse.AddrPools[" + i + "].MonitorStatus"));<NEW_LINE>addrPool.setName(_ctx.stringValue("DescribeGtmInstanceAddressPoolsResponse.AddrPools[" + i + "].Name"));<NEW_LINE>addrPool.setStatus(_ctx.stringValue("DescribeGtmInstanceAddressPoolsResponse.AddrPools[" + i + "].Status"));<NEW_LINE>addrPool.setType(_ctx.stringValue<MASK><NEW_LINE>addrPools.add(addrPool);<NEW_LINE>}<NEW_LINE>describeGtmInstanceAddressPoolsResponse.setAddrPools(addrPools);<NEW_LINE>return describeGtmInstanceAddressPoolsResponse;<NEW_LINE>}
("DescribeGtmInstanceAddressPoolsResponse.AddrPools[" + i + "].Type"));
331,437
public void consume(Order order) throws IOException {<NEW_LINE>log.info("Order received to process: {}", order);<NEW_LINE>if (OrderStatus.INITIATION_SUCCESS.equals(order.getOrderStatus())) {<NEW_LINE>orderRepository.findById(order.getId()).map(o -> {<NEW_LINE>orderProducer.sendMessage(o.setOrderStatus(OrderStatus.RESERVE_INVENTORY));<NEW_LINE>return o.setOrderStatus(order.getOrderStatus()).setResponseMessage(order.getResponseMessage());<NEW_LINE>}).flatMap(orderRepository::save).subscribe();<NEW_LINE>} else if (OrderStatus.INVENTORY_SUCCESS.equals(order.getOrderStatus())) {<NEW_LINE>orderRepository.findById(order.getId()).map(o -> {<NEW_LINE>orderProducer.sendMessage(o.setOrderStatus(OrderStatus.PREPARE_SHIPPING));<NEW_LINE>return o.setOrderStatus(order.getOrderStatus()).setResponseMessage(order.getResponseMessage());<NEW_LINE>}).flatMap(orderRepository::save).subscribe();<NEW_LINE>} else if (OrderStatus.SHIPPING_FAILURE.equals(order.getOrderStatus())) {<NEW_LINE>orderRepository.findById(order.getId()).map(o -> {<NEW_LINE>orderProducer.sendMessage(o.setOrderStatus(OrderStatus.REVERT_INVENTORY));<NEW_LINE>return o.setOrderStatus(order.getOrderStatus()).<MASK><NEW_LINE>}).flatMap(orderRepository::save).subscribe();<NEW_LINE>} else {<NEW_LINE>orderRepository.findById(order.getId()).map(o -> {<NEW_LINE>return o.setOrderStatus(order.getOrderStatus()).setResponseMessage(order.getResponseMessage());<NEW_LINE>}).flatMap(orderRepository::save).subscribe();<NEW_LINE>}<NEW_LINE>}
setResponseMessage(order.getResponseMessage());
1,338,973
public static void chromaResidual(int mbX, int mbY, BitWriter out, int qp, int[][] ac1, int[][] ac2, CAVLC cavlc1, CAVLC cavlc2, MBType leftMBType, MBType topMBType, MBType curMBType) {<NEW_LINE>int crQpOffset = 0;<NEW_LINE>int chrQp = calcQpChroma(qp, crQpOffset);<NEW_LINE>transformChroma(ac1);<NEW_LINE>transformChroma(ac2);<NEW_LINE>int[] dc1 = extractDC(ac1);<NEW_LINE>int[] dc2 = extractDC(ac2);<NEW_LINE>writeDC(cavlc1, mbX, mbY, out, chrQp, mbX << 1, mbY << 1, dc1, leftMBType, topMBType);<NEW_LINE>writeDC(cavlc2, mbX, mbY, out, chrQp, mbX << 1, mbY << 1, dc2, leftMBType, topMBType);<NEW_LINE>writeAC(cavlc1, mbX, mbY, out, mbX << 1, mbY << 1, ac1, chrQp, leftMBType, topMBType, curMBType, DUMMY);<NEW_LINE>writeAC(cavlc2, mbX, mbY, out, mbX << 1, mbY << 1, ac2, chrQp, leftMBType, topMBType, curMBType, DUMMY);<NEW_LINE><MASK><NEW_LINE>restorePlane(dc2, ac2, chrQp);<NEW_LINE>}
restorePlane(dc1, ac1, chrQp);
1,378,126
public void eliminateSharedStreams() {<NEW_LINE>if (!sharedStreams)<NEW_LINE>return;<NEW_LINE>sharedStreams = false;<NEW_LINE>if (pageRefs.size() == 1)<NEW_LINE>return;<NEW_LINE>List<PdfObject> newRefs = new ArrayList<>();<NEW_LINE>List<PdfObject> newStreams = new ArrayList<>();<NEW_LINE>IntHashtable visited = new IntHashtable();<NEW_LINE>for (int k = 1; k <= pageRefs.size(); ++k) {<NEW_LINE>PdfDictionary page = pageRefs.getPageN(k);<NEW_LINE>if (page == null)<NEW_LINE>continue;<NEW_LINE>PdfObject contents = getPdfObject(page.get(PdfName.CONTENTS));<NEW_LINE>if (contents == null)<NEW_LINE>continue;<NEW_LINE>if (contents.isStream()) {<NEW_LINE>PRIndirectReference ref = (PRIndirectReference) page.get(PdfName.CONTENTS);<NEW_LINE>if (visited.containsKey(ref.getNumber())) {<NEW_LINE>// need to duplicate<NEW_LINE>newRefs.add(ref);<NEW_LINE>newStreams.add(new PRStream((PRStream) contents, null));<NEW_LINE>} else<NEW_LINE>visited.put(ref.getNumber(), 1);<NEW_LINE>} else if (contents.isArray()) {<NEW_LINE>PdfArray array = (PdfArray) contents;<NEW_LINE>for (int j = 0; j < array.size(); ++j) {<NEW_LINE>PRIndirectReference ref = (PRIndirectReference) array.getPdfObject(j);<NEW_LINE>if (visited.containsKey(ref.getNumber())) {<NEW_LINE>// need to duplicate<NEW_LINE>newRefs.add(ref);<NEW_LINE>newStreams.add(new PRStream((PRStream) <MASK><NEW_LINE>} else<NEW_LINE>visited.put(ref.getNumber(), 1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (newStreams.isEmpty())<NEW_LINE>return;<NEW_LINE>for (int k = 0; k < newStreams.size(); ++k) {<NEW_LINE>xrefObj.add(newStreams.get(k));<NEW_LINE>PRIndirectReference ref = (PRIndirectReference) newRefs.get(k);<NEW_LINE>ref.setNumber(xrefObj.size() - 1, 0);<NEW_LINE>}<NEW_LINE>}
getPdfObject(ref), null));
733,022
public boolean blockInteract(GlowPlayer player, GlowBlock block, BlockFace face, Vector clickedLoc) {<NEW_LINE>GlowBlockState state = block.getState();<NEW_LINE>MaterialData data = state.getData();<NEW_LINE>if (!(data instanceof FlowerPot)) {<NEW_LINE><MASK><NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (state instanceof GlowFlowerPot) {<NEW_LINE>GlowFlowerPot pot = (GlowFlowerPot) state;<NEW_LINE>ItemStack heldItem = player.getItemInHand();<NEW_LINE>// Only change contents if there is none and if the held item is valid pot contents.<NEW_LINE>if (pot.getContents() == null && heldItem != null && isValidContents(heldItem.getData())) {<NEW_LINE>// Null-check in isValidContents.<NEW_LINE>pot.setContents(heldItem.getData().clone());<NEW_LINE>return pot.update();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
warnMaterialData(FlowerPot.class, data);
1,183,911
private CompletableFuture<XContentBuilder> executeSimpleRequest(Session session, String stmt, List<Object> args, boolean includeTypes) throws IOException {<NEW_LINE>long startTimeInNs = System.nanoTime();<NEW_LINE>session.parse(UNNAMED, stmt, emptyList());<NEW_LINE>session.bind(UNNAMED, UNNAMED, args == null ? <MASK><NEW_LINE>DescribeResult description = session.describe('P', UNNAMED);<NEW_LINE>List<Symbol> resultFields = description.getFields();<NEW_LINE>ResultReceiver<XContentBuilder> resultReceiver;<NEW_LINE>if (resultFields == null) {<NEW_LINE>resultReceiver = new RestRowCountReceiver(JsonXContent.contentBuilder(), startTimeInNs, includeTypes);<NEW_LINE>} else {<NEW_LINE>CircuitBreaker breaker = circuitBreakerProvider.apply(HierarchyCircuitBreakerService.QUERY);<NEW_LINE>RamAccounting ramAccounting = new BlockBasedRamAccounting(b -> breaker.addEstimateBytesAndMaybeBreak(b, "http-result"), MAX_BLOCK_SIZE_IN_BYTES);<NEW_LINE>resultReceiver = new RestResultSetReceiver(JsonXContent.contentBuilder(), resultFields, startTimeInNs, new RowAccountingWithEstimators(Symbols.typeView(resultFields), ramAccounting), includeTypes);<NEW_LINE>resultReceiver.completionFuture().whenComplete((result, error) -> ramAccounting.close());<NEW_LINE>}<NEW_LINE>session.execute(UNNAMED, 0, resultReceiver);<NEW_LINE>return session.sync().thenCompose(ignored -> resultReceiver.completionFuture());<NEW_LINE>}
emptyList() : args, null);
1,121,970
private void applyStyleRecord(ParsableByteArray parsableByteArray, SpannableStringBuilder cueText) throws SubtitleDecoderException {<NEW_LINE>assertTrue(parsableByteArray.bytesLeft() >= SIZE_STYLE_RECORD);<NEW_LINE>int start = parsableByteArray.readUnsignedShort();<NEW_LINE>int end = parsableByteArray.readUnsignedShort();<NEW_LINE>// font identifier<NEW_LINE>parsableByteArray.skipBytes(2);<NEW_LINE>int fontFace = parsableByteArray.readUnsignedByte();<NEW_LINE>// font size<NEW_LINE>parsableByteArray.skipBytes(1);<NEW_LINE><MASK><NEW_LINE>if (end > cueText.length()) {<NEW_LINE>Log.w(TAG, "Truncating styl end (" + end + ") to cueText.length() (" + cueText.length() + ").");<NEW_LINE>end = cueText.length();<NEW_LINE>}<NEW_LINE>if (start >= end) {<NEW_LINE>Log.w(TAG, "Ignoring styl with start (" + start + ") >= end (" + end + ").");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>attachFontFace(cueText, fontFace, defaultFontFace, start, end, SPAN_PRIORITY_HIGH);<NEW_LINE>attachColor(cueText, colorRgba, defaultColorRgba, start, end, SPAN_PRIORITY_HIGH);<NEW_LINE>}
int colorRgba = parsableByteArray.readInt();
644,614
public com.amazonaws.services.codedeploy.model.IamSessionArnAlreadyRegisteredException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.codedeploy.model.IamSessionArnAlreadyRegisteredException iamSessionArnAlreadyRegisteredException = new com.amazonaws.services.codedeploy.model.IamSessionArnAlreadyRegisteredException(null);<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>} 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 iamSessionArnAlreadyRegisteredException;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
1,325,806
private <T> T doSaveVersioned(AdaptibleEntity<T> source, String collectionName) {<NEW_LINE>if (source.isNew()) {<NEW_LINE>return (T) doInsert(collectionName, source.getBean(), this.mongoConverter);<NEW_LINE>}<NEW_LINE>// Create query for entity with the id and old version<NEW_LINE>Query query = source.getQueryForVersion();<NEW_LINE>// Bump version number<NEW_LINE>T toSave = source.incrementVersion();<NEW_LINE>toSave = maybeEmitEvent(new BeforeConvertEvent<T>(toSave, collectionName)).getSource();<NEW_LINE>toSave = maybeCallBeforeConvert(toSave, collectionName);<NEW_LINE>if (source.getBean() != toSave) {<NEW_LINE>source = operations.forEntity(<MASK><NEW_LINE>}<NEW_LINE>source.assertUpdateableIdIfNotSet();<NEW_LINE>MappedDocument mapped = source.toMappedDocument(mongoConverter);<NEW_LINE>maybeEmitEvent(new BeforeSaveEvent<>(toSave, mapped.getDocument(), collectionName));<NEW_LINE>toSave = maybeCallBeforeSave(toSave, mapped.getDocument(), collectionName);<NEW_LINE>UpdateDefinition update = mapped.updateWithoutId();<NEW_LINE>UpdateResult result = doUpdate(collectionName, query, update, toSave.getClass(), false, false);<NEW_LINE>if (result.getModifiedCount() == 0) {<NEW_LINE>throw new OptimisticLockingFailureException(String.format("Cannot save entity %s with version %s to collection %s. Has it been modified meanwhile?", source.getId(), source.getVersion(), collectionName));<NEW_LINE>}<NEW_LINE>maybeEmitEvent(new AfterSaveEvent<>(toSave, mapped.getDocument(), collectionName));<NEW_LINE>return maybeCallAfterSave(toSave, mapped.getDocument(), collectionName);<NEW_LINE>}
toSave, mongoConverter.getConversionService());
1,333,017
private void gaussNewton(double[] betas) {<NEW_LINE>A_temp.reshape(L_full.numRows, numControl);<NEW_LINE>v_temp.reshape(L_full.numRows, 1);<NEW_LINE>x.<MASK><NEW_LINE>// don't check numControl inside in hope that the JVM can optimize the code better<NEW_LINE>if (numControl == 4) {<NEW_LINE>for (int i = 0; i < numIterations; i++) {<NEW_LINE>UtilLepetitEPnP.jacobian_Control4(L_full, betas, A_temp);<NEW_LINE>UtilLepetitEPnP.residuals_Control4(L_full, y, betas, v_temp.data);<NEW_LINE>if (!solver.setA(A_temp))<NEW_LINE>return;<NEW_LINE>solver.solve(v_temp, x);<NEW_LINE>for (int j = 0; j < numControl; j++) {<NEW_LINE>betas[j] -= x.data[j];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>for (int i = 0; i < numIterations; i++) {<NEW_LINE>UtilLepetitEPnP.jacobian_Control3(L_full, betas, A_temp);<NEW_LINE>UtilLepetitEPnP.residuals_Control3(L_full, y, betas, v_temp.data);<NEW_LINE>if (!solver.setA(A_temp))<NEW_LINE>return;<NEW_LINE>solver.solve(v_temp, x);<NEW_LINE>for (int j = 0; j < numControl; j++) {<NEW_LINE>betas[j] -= x.data[j];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
reshape(numControl, 1, false);
1,813,026
private static boolean skipBuildingPartitionMetricSample(TopicPartition tpDotNotHandled, TopicPartition tpWithDotHandled, int leaderId, BrokerLoad brokerLoad, Map<Integer, Short> cachedNumCoresByBroker) {<NEW_LINE>if (brokerLoad == null || !brokerLoad.brokerMetricAvailable(BROKER_CPU_UTIL)) {<NEW_LINE>// Broker load or its BROKER_CPU_UTIL metric is not available.<NEW_LINE>LOG.debug("{}partition {} because {} metric for broker {} is unavailable.", <MASK><NEW_LINE>return true;<NEW_LINE>} else if (cachedNumCoresByBroker.get(leaderId) == null) {<NEW_LINE>// Broker load is available but the corresponding number of cores was not cached.<NEW_LINE>LOG.debug("{}partition {} because the number of CPU cores of its leader broker {} is unavailable. Please ensure that " + "either the broker capacity config resolver provides the number of CPU cores without estimation or allow " + "CPU capacity estimation during sampling (i.e. set {} to true).", SKIP_BUILDING_SAMPLE_PREFIX, tpDotNotHandled, leaderId, SAMPLING_ALLOW_CPU_CAPACITY_ESTIMATION_CONFIG);<NEW_LINE>return true;<NEW_LINE>} else if (!brokerLoad.allDotHandledTopicMetricsAvailable(tpWithDotHandled.topic())) {<NEW_LINE>// Topic metrics are not available.<NEW_LINE>LOG.debug("{}partition {} because broker {} has no metric or topic metrics are not available", SKIP_BUILDING_SAMPLE_PREFIX, tpDotNotHandled, leaderId);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
SKIP_BUILDING_SAMPLE_PREFIX, tpDotNotHandled, BROKER_CPU_UTIL, leaderId);
672,129
public void paintEntity(Graphics g) {<NEW_LINE>Graphics2D g2 = (Graphics2D) g;<NEW_LINE>g2.setFont(HandlerElementMap.getHandlerForElement(this).getFontHandler().getFont());<NEW_LINE>// enable colors<NEW_LINE>Composite[] composites = colorize(g2);<NEW_LINE>g2.setColor(fgColor);<NEW_LINE>Polygon poly = new Polygon();<NEW_LINE>poly.addPoint(0, 0);<NEW_LINE>poly.addPoint(getRectangle().width - 1, 0);<NEW_LINE>poly.addPoint(getRectangle().width - 1, getRectangle().height - 1);<NEW_LINE>poly.addPoint(0, getRectangle().height - 1);<NEW_LINE>poly.addPoint((int) HandlerElementMap.getHandlerForElement(this).getFontHandler().getFontSize() - 2, getRectangle().height / 2);<NEW_LINE>g2.setComposite(composites[1]);<NEW_LINE>g2.setColor(bgColor);<NEW_LINE>g2.fillPolygon(poly);<NEW_LINE>g2.setComposite(composites[0]);<NEW_LINE>if (HandlerElementMap.getHandlerForElement(this).getDrawPanel().getSelector().isSelected(this)) {<NEW_LINE>g2.setColor(fgColor);<NEW_LINE>} else {<NEW_LINE>g2.setColor(fgColorBase);<NEW_LINE>}<NEW_LINE>g2.drawPolygon(poly);<NEW_LINE>Vector<String> tmp = Utils.decomposeStrings(getPanelAttributes());<NEW_LINE>int yPos = getRectangle().height / 2 - tmp.size() * (int) (HandlerElementMap.getHandlerForElement(this).getFontHandler().getFontSize() + HandlerElementMap.getHandlerForElement(this).getFontHandler(<MASK><NEW_LINE>for (int i = 0; i < tmp.size(); i++) {<NEW_LINE>String s = tmp.elementAt(i);<NEW_LINE>yPos += (int) HandlerElementMap.getHandlerForElement(this).getFontHandler().getFontSize();<NEW_LINE>HandlerElementMap.getHandlerForElement(this).getFontHandler().writeText(g2, s, getRectangle().width / 2.0, yPos, AlignHorizontal.CENTER);<NEW_LINE>yPos += HandlerElementMap.getHandlerForElement(this).getFontHandler().getDistanceBetweenTexts();<NEW_LINE>}<NEW_LINE>}
).getDistanceBetweenTexts()) / 2;