idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
870,295
public void testClientLtpaHander_ClientNoTokenWithSSLDefault(Map<String, String> param, StringBuilder ret) {<NEW_LINE>String serverIP = param.get("hostname");<NEW_LINE>String serverPort = param.get("secport");<NEW_LINE>final String threadName = "jaxrs21Thread";<NEW_LINE>ThreadFactory jaxrs21ThreadFactory = Executors.defaultThreadFactory();<NEW_LINE>Thread jaxrs21Thread = jaxrs21ThreadFactory.newThread(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>String runThreadName = Thread.currentThread().getName();<NEW_LINE>if (!(runThreadName.equals(threadName))) {<NEW_LINE>throw new RuntimeException("testClientLtpaHander_ClientNoTokenWithSSLDefault: incorrect thread name");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>jaxrs21Thread.setName(threadName);<NEW_LINE>ExecutorService executorService = Executors.newSingleThreadExecutor(jaxrs21ThreadFactory);<NEW_LINE>ClientBuilder cb = ClientBuilder.newBuilder().executorService(executorService);<NEW_LINE>Client c = cb.build();<NEW_LINE><MASK><NEW_LINE>WebTarget t = c.target("https://" + serverIP + ":" + serverPort + "/" + moduleName + "/Test/BasicResource").path("echo").path(param.get("param"));<NEW_LINE>Builder builder = t.request();<NEW_LINE>CompletionStageRxInvoker completionStageRxInvoker = builder.rx();<NEW_LINE>CompletionStage<String> completionStage = completionStageRxInvoker.get(String.class);<NEW_LINE>CompletableFuture<String> completableFuture = completionStage.toCompletableFuture();<NEW_LINE>try {<NEW_LINE>String response = completableFuture.get();<NEW_LINE>ret.append(response);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>} catch (ExecutionException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>c.close();<NEW_LINE>}
c.property("com.ibm.ws.jaxrs.client.ltpa.handler", "true");
1,246,525
TreePath findSubPath(String subPath, String indexes, String delimiter) {<NEW_LINE>String[] indexStr = tree().parseString(indexes, delimiter);<NEW_LINE>int[] indexInt = new int[indexStr.length];<NEW_LINE>for (int i = 0; i < indexStr.length; i++) {<NEW_LINE>indexInt[i] = Integer<MASK><NEW_LINE>}<NEW_LINE>TreePath foundTreePath;<NEW_LINE>try {<NEW_LINE>foundTreePath = tree().findPath(new Node.StringArraySubPathChooser(getTreePath(), tree().parseString(subPath, delimiter), indexInt, getComparator()));<NEW_LINE>} catch (JTreeOperator.NoSuchPathException e) {<NEW_LINE>// try it once more. Probably IDE somehow changed nodes.<NEW_LINE>foundTreePath = tree().findPath(new Node.StringArraySubPathChooser(getTreePath(), tree().parseString(subPath, delimiter), indexInt, getComparator()));<NEW_LINE>}<NEW_LINE>return foundTreePath;<NEW_LINE>}
.parseInt(indexStr[i]);
195,120
private double sample3d(int sectionX, int sectionY, int sectionZ, double localX, double localY, double localZ, double fadeLocalX, double fadeLocalY, double fadeLocalZ) {<NEW_LINE>int i = this.getGradient(sectionX) + sectionY;<NEW_LINE>int j = this.getGradient(i) + sectionZ;<NEW_LINE>int k = this.getGradient(i + 1) + sectionZ;<NEW_LINE>int l = this.getGradient(sectionX + 1) + sectionY;<NEW_LINE>int m = this.getGradient(l) + sectionZ;<NEW_LINE>int n = this.getGradient(l + 1) + sectionZ;<NEW_LINE>double d = grad3d(this.getGradient(j), localX, localY, localZ);<NEW_LINE>double e = grad3d(this.getGradient(m), localX - 1.0D, localY, localZ);<NEW_LINE>double f = grad3d(this.getGradient(k), <MASK><NEW_LINE>double g = grad3d(this.getGradient(n), localX - 1.0D, localY - 1.0D, localZ);<NEW_LINE>double h = grad3d(this.getGradient(j + 1), localX, localY, localZ - 1.0D);<NEW_LINE>double o = grad3d(this.getGradient(m + 1), localX - 1.0D, localY, localZ - 1.0D);<NEW_LINE>double p = grad3d(this.getGradient(k + 1), localX, localY - 1.0D, localZ - 1.0D);<NEW_LINE>double q = grad3d(this.getGradient(n + 1), localX - 1.0D, localY - 1.0D, localZ - 1.0D);<NEW_LINE>return lerp3(fadeLocalX, fadeLocalY, fadeLocalZ, d, e, f, g, h, o, p, q);<NEW_LINE>}
localX, localY - 1.0D, localZ);
1,677,650
public FluidPositionInfo interpolateB(long tick, float partialTicks) {<NEW_LINE>if (!positionB.moves) {<NEW_LINE>return positionB;<NEW_LINE>}<NEW_LINE>if (tick < positionB.startMoving) {<NEW_LINE>return positionB;<NEW_LINE>}<NEW_LINE>float position = 0;<NEW_LINE>if (tick >= positionB.endMoving) {<NEW_LINE>position = 0;<NEW_LINE>} else {<NEW_LINE>long tickDiff = positionB.endMoving - positionB.startMoving;<NEW_LINE>if (tickDiff <= 0) {<NEW_LINE>position = 1;<NEW_LINE>} else {<NEW_LINE>position = (positionB.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>// TODO: Make this respect direction, and move on a curve (Changing the direction as appropriate)<NEW_LINE>Vec3d diff = positionB.point.subtract(positionA.point);<NEW_LINE>Vec3d offset = Utils.multiply(diff, 1 - position);<NEW_LINE>FluidPositionInfoBuilder builder = new FluidPositionInfoBuilder(positionB);<NEW_LINE>builder.setMin(builder.min.add(offset));<NEW_LINE>builder.setMax(builder.max.add(offset));<NEW_LINE>builder.setPoint(builder.point.add(offset));<NEW_LINE>return builder.build();<NEW_LINE>}
endMoving - tick - partialTicks) / tickDiff;
743,386
public static List<MXFMetadata> readPartitionMeta(SeekableByteChannel ff, MXFPartition header) throws IOException {<NEW_LINE>KLV kl;<NEW_LINE>long basePos = ff.position();<NEW_LINE>List<MXFMetadata> local = new ArrayList<MXFMetadata>();<NEW_LINE>ByteBuffer metaBuffer = NIOUtils.fetchFromChannel(ff, (int) Math.max(0, header<MASK><NEW_LINE>while (metaBuffer.hasRemaining() && (kl = KLV.readKLFromBuffer(metaBuffer, basePos)) != null) {<NEW_LINE>if (metaBuffer.remaining() >= kl.len) {<NEW_LINE>MXFMetadata meta = parseMeta(kl.key, NIOUtils.read(metaBuffer, (int) kl.len));<NEW_LINE>if (meta != null)<NEW_LINE>local.add(meta);<NEW_LINE>} else {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return local;<NEW_LINE>}
.getEssenceFilePos() - basePos));
378,232
private CompletableFuture<Pair<List<String>, String>> readAll(int limit, String continuationToken, String tableName, OperationContext context) {<NEW_LINE>List<String> taken = new ArrayList<>();<NEW_LINE>AtomicReference<String> token = new AtomicReference<>(continuationToken);<NEW_LINE><MASK><NEW_LINE>return Futures.exceptionallyExpecting(storeHelper.getKeysPaginated(tableName, Unpooled.wrappedBuffer(Base64.getDecoder().decode(token.get())), limit, context.getRequestId()).thenApply(result -> {<NEW_LINE>if (result.getValue().isEmpty()) {<NEW_LINE>canContinue.set(false);<NEW_LINE>} else {<NEW_LINE>taken.addAll(result.getValue());<NEW_LINE>}<NEW_LINE>token.set(Base64.getEncoder().encodeToString(result.getKey().array()));<NEW_LINE>return new ImmutablePair<>(taken, token.get());<NEW_LINE>}), DATA_NOT_FOUND_PREDICATE, new ImmutablePair<>(Collections.emptyList(), token.get()));<NEW_LINE>}
AtomicBoolean canContinue = new AtomicBoolean(true);
1,594,420
protected String callHostPluginThroughMaster(final Connection conn, final String plugin, final String cmd, final String... params) {<NEW_LINE>final Map<String, String> args = new HashMap<String, String>();<NEW_LINE>try {<NEW_LINE>final Map<Pool, Pool.Record> poolRecs = Pool.getAllRecords(conn);<NEW_LINE>if (poolRecs.size() != 1) {<NEW_LINE>throw new CloudRuntimeException("There are " + poolRecs.size() + " pool for host :" + _host.getUuid());<NEW_LINE>}<NEW_LINE>final Host master = poolRecs.values().iterator<MASK><NEW_LINE>for (int i = 0; i < params.length; i += 2) {<NEW_LINE>args.put(params[i], params[i + 1]);<NEW_LINE>}<NEW_LINE>if (s_logger.isTraceEnabled()) {<NEW_LINE>s_logger.trace("callHostPlugin executing for command " + cmd + " with " + getArgsString(args));<NEW_LINE>}<NEW_LINE>final String result = master.callPlugin(conn, plugin, cmd, args);<NEW_LINE>if (s_logger.isTraceEnabled()) {<NEW_LINE>s_logger.trace("callHostPlugin Result: " + result);<NEW_LINE>}<NEW_LINE>return result.replace("\n", "");<NEW_LINE>} catch (final Types.HandleInvalid e) {<NEW_LINE>s_logger.warn("callHostPlugin failed for cmd: " + cmd + " with args " + getArgsString(args) + " due to HandleInvalid clazz:" + e.clazz + ", handle:" + e.handle);<NEW_LINE>} catch (final XenAPIException e) {<NEW_LINE>s_logger.warn("callHostPlugin failed for cmd: " + cmd + " with args " + getArgsString(args) + " due to " + e.toString(), e);<NEW_LINE>} catch (final XmlRpcException e) {<NEW_LINE>s_logger.warn("callHostPlugin failed for cmd: " + cmd + " with args " + getArgsString(args) + " due to " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
().next().master;
1,133,129
public Serialized serialize(final QuarkusPersistenceUnitDefinition obj) {<NEW_LINE>final Serialized s = new Serialized();<NEW_LINE>// First, fields from LightPersistenceXmlDescriptor:<NEW_LINE>s.setPuName(obj.actualHibernateDescriptor.getName());<NEW_LINE>s.setPuProviderClassName(obj.actualHibernateDescriptor.getProviderClassName());<NEW_LINE>s.setPuUseQuotedIdentifiers(obj.actualHibernateDescriptor.isUseQuotedIdentifiers());<NEW_LINE>s.setPuTransactionType(obj.actualHibernateDescriptor.getTransactionType());<NEW_LINE>s.setPuValidationMode(obj.actualHibernateDescriptor.getValidationMode());<NEW_LINE>s.setPuSharedCachemode(obj.actualHibernateDescriptor.getSharedCacheMode());<NEW_LINE>s.setPuManagedClassNames(obj.actualHibernateDescriptor.getManagedClassNames());<NEW_LINE>s.setPuProperties(obj.actualHibernateDescriptor.getProperties());<NEW_LINE>// Remaining fields of QuarkusPersistenceUnitDefinition<NEW_LINE>s.setDataSource(obj.getDataSource());<NEW_LINE>s.<MASK><NEW_LINE>s.setXmlMappingBindings(obj.getXmlMappings());<NEW_LINE>s.setReactive(obj.isReactive);<NEW_LINE>s.setFromPersistenceXml(obj.isFromPersistenceXml());<NEW_LINE>s.setIntegrationStaticDescriptors(obj.getIntegrationStaticDescriptors());<NEW_LINE>return s;<NEW_LINE>}
setMultitenancyStrategy(obj.getMultitenancyStrategy());
1,778,298
protected void translateCore(final ITranslationEnvironment environment, final IInstruction instruction, final List<ReilInstruction> instructions) {<NEW_LINE>final IOperandTreeNode registerOperand1 = instruction.getOperands().get(0).getRootNode().getChildren().get(0);<NEW_LINE>final IOperandTreeNode registerOperand2 = instruction.getOperands().get(1).getRootNode().getChildren().get(0);<NEW_LINE>final IOperandTreeNode registerOperand3 = instruction.getOperands().get(2).getRootNode().getChildren().get(0);<NEW_LINE>final IOperandTreeNode registerOperand4 = instruction.getOperands().get(3).getRootNode().getChildren().get(0);<NEW_LINE>final String targetRegister <MASK><NEW_LINE>final String sourceRegister1 = (registerOperand2.getValue());<NEW_LINE>final String sourceRegister2 = (registerOperand3.getValue());<NEW_LINE>final String sourceRegister3 = (registerOperand4.getValue());<NEW_LINE>final OperandSize wd = OperandSize.WORD;<NEW_LINE>final OperandSize dw = OperandSize.DWORD;<NEW_LINE>final OperandSize qw = OperandSize.QWORD;<NEW_LINE>final String tmpVar1 = environment.getNextVariableString();<NEW_LINE>final String tmpVar2 = environment.getNextVariableString();<NEW_LINE>final String tmpVar3 = environment.getNextVariableString();<NEW_LINE>final String tmpVar4 = environment.getNextVariableString();<NEW_LINE>final String value = environment.getNextVariableString();<NEW_LINE>long baseOffset = ReilHelpers.nextReilAddress(instruction, instructions);<NEW_LINE>Helpers.signedMul(baseOffset, environment, instruction, instructions, dw, sourceRegister1, dw, sourceRegister2, qw, value);<NEW_LINE>baseOffset = ReilHelpers.nextReilAddress(instruction, instructions);<NEW_LINE>instructions.add(ReilHelpers.createBsh(baseOffset++, dw, sourceRegister3, wd, String.valueOf(32), qw, tmpVar1));<NEW_LINE>if (instruction.getMnemonic().contains("R")) {<NEW_LINE>instructions.add(ReilHelpers.createAdd(baseOffset++, qw, value, dw, String.valueOf(0x80000000L), qw, tmpVar2));<NEW_LINE>instructions.add(ReilHelpers.createAdd(baseOffset++, qw, tmpVar2, qw, tmpVar1, qw, tmpVar3));<NEW_LINE>} else {<NEW_LINE>instructions.add(ReilHelpers.createAdd(baseOffset++, qw, value, qw, tmpVar1, qw, tmpVar3));<NEW_LINE>}<NEW_LINE>instructions.add(ReilHelpers.createBsh(baseOffset++, qw, tmpVar3, wd, String.valueOf(-32), dw, tmpVar4));<NEW_LINE>instructions.add(ReilHelpers.createAnd(baseOffset++, dw, tmpVar4, dw, String.valueOf(0xFFFFFFFFL), dw, targetRegister));<NEW_LINE>}
= (registerOperand1.getValue());
1,828,442
private void refreshSnapshotToAMIs(String region) {<NEW_LINE>snapshotToAMIs.clear();<NEW_LINE>LOGGER.info(String.format("Getting mapping from snapshot to AMIs in region %s", region));<NEW_LINE>String url = eddaClient.getBaseUrl(region) + "/aws/images/" + ";_expand:(imageId,blockDeviceMappings:(ebs:(snapshotId)))";<NEW_LINE>JsonNode jsonNode = null;<NEW_LINE>try {<NEW_LINE>jsonNode = eddaClient.getJsonNodeFromUrl(url);<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOGGER.error(String.format("Failed to get Jason node from edda for AMI mapping in region %s.", region), e);<NEW_LINE>}<NEW_LINE>if (jsonNode == null || !jsonNode.isArray()) {<NEW_LINE>throw new RuntimeException(String.format("Failed to get valid document from %s, got: %s", url, jsonNode));<NEW_LINE>}<NEW_LINE>for (Iterator<JsonNode> it = jsonNode.getElements(); it.hasNext(); ) {<NEW_LINE>JsonNode elem = it.next();<NEW_LINE>String imageId = elem.get("imageId").getTextValue();<NEW_LINE>JsonNode <MASK><NEW_LINE>if (blockMappings == null || !blockMappings.isArray() || blockMappings.size() == 0) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>for (Iterator<JsonNode> blockMappingsIt = blockMappings.getElements(); blockMappingsIt.hasNext(); ) {<NEW_LINE>JsonNode blockMappingNode = blockMappingsIt.next();<NEW_LINE>JsonNode ebs = blockMappingNode.get("ebs");<NEW_LINE>if (ebs == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>JsonNode snapshotIdNode = ebs.get("snapshotId");<NEW_LINE>String snapshotId = snapshotIdNode.getTextValue();<NEW_LINE>LOGGER.debug(String.format("Snapshot %s is used to generate AMI %s", snapshotId, imageId));<NEW_LINE>Collection<String> amis = snapshotToAMIs.get(snapshotId);<NEW_LINE>if (amis == null) {<NEW_LINE>amis = Lists.newArrayList();<NEW_LINE>snapshotToAMIs.put(snapshotId, amis);<NEW_LINE>}<NEW_LINE>amis.add(imageId);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
blockMappings = elem.get("blockDeviceMappings");
72,601
public Object evaluateList(Object list1Obj, Object list2Obj) {<NEW_LINE>int len1 = list1Inspector.getListLength(list1Obj);<NEW_LINE>int len2 = list2Inspector.getListLength(list2Obj);<NEW_LINE>if (len1 != len2) {<NEW_LINE>LOG.warn("vector lengths do not match " + list1Obj + " :: " + list2Obj);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Object retList = retListInspector.create(0);<NEW_LINE>for (int i = 0; i < len1; ++i) {<NEW_LINE>Object list1Val = this.<MASK><NEW_LINE>double list1Dbl = NumericUtil.getNumericValue(value1Inspector, list1Val);<NEW_LINE>Object list2Val = this.list2Inspector.getListElement(list2Obj, i);<NEW_LINE>double list2Dbl = NumericUtil.getNumericValue(value2Inspector, list2Val);<NEW_LINE>double newVal = list1Dbl + list2Dbl;<NEW_LINE>retListInspector.set(retList, i, NumericUtil.castToPrimitiveNumeric(newVal, ((PrimitiveObjectInspector) retListInspector.getListElementObjectInspector()).getPrimitiveCategory()));<NEW_LINE>}<NEW_LINE>return retList;<NEW_LINE>}
list1Inspector.getListElement(list1Obj, i);
1,786,979
void replayNormal(ReplaySubscription<T> rs) {<NEW_LINE>final Subscriber<? super T> a = rs.actual();<NEW_LINE>int missed = 1;<NEW_LINE>for (; ; ) {<NEW_LINE>long r = rs.requested();<NEW_LINE>long e = 0L;<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>Node<T> node = (Node<T>) rs.node();<NEW_LINE>if (node == null) {<NEW_LINE>node = head;<NEW_LINE>}<NEW_LINE>while (e != r) {<NEW_LINE>if (rs.isCancelled()) {<NEW_LINE>rs.node(null);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>boolean d = done;<NEW_LINE>Node<T> next = node.get();<NEW_LINE>boolean empty = next == null;<NEW_LINE>if (d && empty) {<NEW_LINE>rs.node(null);<NEW_LINE>Throwable ex = error;<NEW_LINE>if (ex != null) {<NEW_LINE>a.onError(ex);<NEW_LINE>} else {<NEW_LINE>a.onComplete();<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (empty) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>a.onNext(next.value);<NEW_LINE>e++;<NEW_LINE>node = next;<NEW_LINE>if ((next.index + 1) % indexUpdateLimit == 0) {<NEW_LINE>rs.requestMore(next.index + 1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (e == r) {<NEW_LINE>if (rs.isCancelled()) {<NEW_LINE>rs.node(null);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>boolean d = done;<NEW_LINE>boolean empty = node.get() == null;<NEW_LINE>if (d && empty) {<NEW_LINE>rs.node(null);<NEW_LINE>Throwable ex = error;<NEW_LINE>if (ex != null) {<NEW_LINE>a.onError(ex);<NEW_LINE>} else {<NEW_LINE>a.onComplete();<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (e != 0L) {<NEW_LINE>if (r != Long.MAX_VALUE) {<NEW_LINE>rs.produced(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>rs.node(node);<NEW_LINE><MASK><NEW_LINE>if (missed == 0) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
missed = rs.leave(missed);
1,702,093
public void connect() throws IOException {<NEW_LINE>try {<NEW_LINE>VirtualConnectionFactory factory = getOutboundVCFactory();<NEW_LINE>VirtualConnection vc;<NEW_LINE>synchronized (SipOutboundConnLink.class) {<NEW_LINE>s_current = this;<NEW_LINE>vc = factory.createConnection();<NEW_LINE>// now s_current is back to null<NEW_LINE>}<NEW_LINE>setVirtualConnection(vc);<NEW_LINE>if (!(vc instanceof OutboundVirtualConnection)) {<NEW_LINE>throw new IllegalStateException("Not an OutboundVirtualConnection");<NEW_LINE>}<NEW_LINE>OutboundVirtualConnection outboundConnection = (OutboundVirtualConnection) vc;<NEW_LINE>String host = getRemoteHost();<NEW_LINE>int port = getRemotePort();<NEW_LINE>// set the timeout to -1 if "connectTimeout" configured to 0, because for TCPChannel -1 means no timeout<NEW_LINE>if (s_connectTimeout == 0) {<NEW_LINE>s_connectTimeout = -1;<NEW_LINE>}<NEW_LINE>Object connectRequestContext = createConnectRequestContext(host, port, s_connectTimeout);<NEW_LINE><MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {<NEW_LINE>Tr.debug(this, tc, "connect", "Exception", e);<NEW_LINE>}<NEW_LINE>close();<NEW_LINE>throw new IOException(e.getMessage());<NEW_LINE>}<NEW_LINE>}
outboundConnection.connectAsynch(connectRequestContext, this);
1,049,425
private void extractResults(Results results, Statement statement, String sql, boolean hasResults) throws SQLException {<NEW_LINE>// retrieve all results to ensure all errors are detected<NEW_LINE>int updateCount = -1;<NEW_LINE>while (hasResults || (updateCount = statement.getUpdateCount()) != -1) {<NEW_LINE>List<String> columns = null;<NEW_LINE>List<List<String>> data = null;<NEW_LINE>if (hasResults) {<NEW_LINE>try (ResultSet resultSet = statement.getResultSet()) {<NEW_LINE>columns = new ArrayList<>();<NEW_LINE>ResultSetMetaData metadata = resultSet.getMetaData();<NEW_LINE>int columnCount = metadata.getColumnCount();<NEW_LINE>for (int i = 1; i <= columnCount; i++) {<NEW_LINE>columns.add(metadata.getColumnName(i));<NEW_LINE>}<NEW_LINE>data = new ArrayList<>();<NEW_LINE>while (resultSet.next()) {<NEW_LINE>List<String> row = new ArrayList<>();<NEW_LINE>for (int i = 1; i <= columnCount; i++) {<NEW_LINE>row.add<MASK><NEW_LINE>}<NEW_LINE>data.add(row);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>results.addResult(new Result(updateCount, columns, data, sql));<NEW_LINE>hasResults = statement.getMoreResults();<NEW_LINE>}<NEW_LINE>}
(resultSet.getString(i));
156,072
public static void renderSelections(ISelection[] selections) {<NEW_LINE>float opacity = settings.selectionOpacity.value;<NEW_LINE>boolean ignoreDepth = settings.renderSelectionIgnoreDepth.value;<NEW_LINE><MASK><NEW_LINE>if (!settings.renderSelection.value) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>IRenderer.startLines(settings.colorSelection.value, opacity, lineWidth, ignoreDepth);<NEW_LINE>for (ISelection selection : selections) {<NEW_LINE>IRenderer.drawAABB(selection.aabb(), SELECTION_BOX_EXPANSION);<NEW_LINE>}<NEW_LINE>if (settings.renderSelectionCorners.value) {<NEW_LINE>IRenderer.glColor(settings.colorSelectionPos1.value, opacity);<NEW_LINE>for (ISelection selection : selections) {<NEW_LINE>IRenderer.drawAABB(new AxisAlignedBB(selection.pos1(), selection.pos1().add(1, 1, 1)));<NEW_LINE>}<NEW_LINE>IRenderer.glColor(settings.colorSelectionPos2.value, opacity);<NEW_LINE>for (ISelection selection : selections) {<NEW_LINE>IRenderer.drawAABB(new AxisAlignedBB(selection.pos2(), selection.pos2().add(1, 1, 1)));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>IRenderer.endLines(ignoreDepth);<NEW_LINE>}
float lineWidth = settings.selectionLineWidth.value;
300,880
public SdkFileEntry[] generateSourceFiles(ServiceModel serviceModel) throws Exception {<NEW_LINE>// for c++, the way serialization works, we want to remove all required fields so we can do a value has been set<NEW_LINE>// check on all fields.<NEW_LINE>serviceModel.getShapes().values().stream().filter(hasMembers -> hasMembers.getMembers() != null).forEach(shape -> shape.getMembers().values().stream().filter(shapeMember -> shapeMember.isRequired()).forEach(member -> member.setRequired(false)));<NEW_LINE>getOperationsToRemove().stream().forEach(operation -> {<NEW_LINE>serviceModel.getOperations().remove(operation);<NEW_LINE>});<NEW_LINE>List<SdkFileEntry> fileList = new ArrayList<>();<NEW_LINE>fileList.addAll(generateModelHeaderFiles(serviceModel));<NEW_LINE>fileList.addAll(generateModelSourceFiles(serviceModel));<NEW_LINE>fileList.add(generateClientHeaderFile(serviceModel));<NEW_LINE>fileList.add(generateClientSourceFile(serviceModel));<NEW_LINE>fileList.add(generateARNHeaderFile(serviceModel));<NEW_LINE>fileList.add(generateARNSourceFile(serviceModel));<NEW_LINE>fileList.add(generateClientConfigurationFile(serviceModel));<NEW_LINE>fileList.add(generateRegionHeaderFile(serviceModel));<NEW_LINE>fileList.add(generateRegionSourceFile(serviceModel));<NEW_LINE>fileList.add(generateErrorsHeaderFile(serviceModel));<NEW_LINE>fileList<MASK><NEW_LINE>fileList.add(generateErrorSourceFile(serviceModel));<NEW_LINE>fileList.add(generateErrorMarshallingSourceFile(serviceModel));<NEW_LINE>fileList.add(generateServiceRequestHeader(serviceModel));<NEW_LINE>fileList.add(generateExportHeader(serviceModel));<NEW_LINE>fileList.add(generateCmakeFile(serviceModel));<NEW_LINE>SdkFileEntry[] retArray = new SdkFileEntry[fileList.size()];<NEW_LINE>return fileList.toArray(retArray);<NEW_LINE>}
.add(generateErrorMarshallerHeaderFile(serviceModel));
655,759
protected String doIt() throws Exception {<NEW_LINE>log.info("C_PeriodControl_ID=" + p_C_PeriodControl_ID);<NEW_LINE>MPeriodControl pc = new MPeriodControl(getCtx(), p_C_PeriodControl_ID, get_TrxName());<NEW_LINE>if (pc.get_ID() == 0)<NEW_LINE>throw new AdempiereUserError("@NotFound@ @C_PeriodControl_ID@=" + p_C_PeriodControl_ID);<NEW_LINE>// Permanently closed<NEW_LINE>if (MPeriodControl.PERIODACTION_PermanentlyClosePeriod.equals(pc.getPeriodStatus()))<NEW_LINE>throw new AdempiereUserError("@PeriodStatus@ = " + pc.getPeriodStatus());<NEW_LINE>// No Action<NEW_LINE>if (MPeriodControl.PERIODACTION_NoAction.equals(pc.getPeriodAction()))<NEW_LINE>return "@OK@";<NEW_LINE>// Open<NEW_LINE>if (MPeriodControl.PERIODACTION_OpenPeriod.equals(pc.getPeriodAction()))<NEW_LINE>pc.setPeriodStatus(MPeriodControl.PERIODSTATUS_Open);<NEW_LINE>// Close<NEW_LINE>if (MPeriodControl.PERIODACTION_ClosePeriod.equals(pc.getPeriodAction()))<NEW_LINE>pc.setPeriodStatus(MPeriodControl.PERIODSTATUS_Closed);<NEW_LINE>// Close Permanently<NEW_LINE>if (MPeriodControl.PERIODACTION_PermanentlyClosePeriod.equals(pc.getPeriodAction()))<NEW_LINE>pc.setPeriodStatus(MPeriodControl.PERIODSTATUS_PermanentlyClosed);<NEW_LINE>pc.setPeriodAction(MPeriodControl.PERIODACTION_NoAction);<NEW_LINE>//<NEW_LINE>boolean ok = pc.save();<NEW_LINE>// Reset Cache<NEW_LINE>CacheMgt.get(<MASK><NEW_LINE>CacheMgt.get().reset("C_Period", pc.getC_Period_ID());<NEW_LINE>if (!ok)<NEW_LINE>return "@Error@";<NEW_LINE>return "@OK@";<NEW_LINE>}
).reset("C_PeriodControl", 0);
1,704,041
private Task<ImageWatcher> defaultContainerRestartTask() {<NEW_LINE>return watcher -> {<NEW_LINE>// Stop old one<NEW_LINE><MASK><NEW_LINE>PortMapping mappedPorts = runService.createPortMapping(imageConfig.getRunConfiguration(), watcher.getWatchContext().getMojoParameters().getProject().getProperties());<NEW_LINE>String id = watcher.getContainerId();<NEW_LINE>String optionalPreStop = getPreStopCommand(imageConfig);<NEW_LINE>if (optionalPreStop != null) {<NEW_LINE>runService.execInContainer(id, optionalPreStop, watcher.getImageConfiguration());<NEW_LINE>}<NEW_LINE>runService.stopPreviouslyStartedContainer(id, false, false);<NEW_LINE>// Start new one<NEW_LINE>StartContainerExecutor helper = new StartContainerExecutor.Builder().dispatcher(watcher.watchContext.dispatcher).follow(watcher.watchContext.follow).log(log).portMapping(mappedPorts).gavLabel(watcher.watchContext.getGavLabel()).projectProperties(watcher.watchContext.mojoParameters.getProject().getProperties()).basedir(watcher.watchContext.mojoParameters.getProject().getBasedir()).imageConfig(imageConfig).serviceHub(watcher.watchContext.hub).logOutputSpecFactory(watcher.watchContext.serviceHubFactory.getLogOutputSpecFactory()).showLogs(watcher.watchContext.showLogs).containerNamePattern(watcher.watchContext.containerNamePattern).buildTimestamp(watcher.watchContext.buildTimestamp).build();<NEW_LINE>String containerId = helper.startContainer();<NEW_LINE>watcher.setContainerId(containerId);<NEW_LINE>};<NEW_LINE>}
ImageConfiguration imageConfig = watcher.getImageConfiguration();
289,485
private List<RemoteRepository> resolveCurrentProjectRepos(List<RemoteRepository> repos) throws BootstrapMavenException {<NEW_LINE>final Artifact projectArtifact;<NEW_LINE>if (currentProject == null) {<NEW_LINE>final Model model = loadCurrentProjectModel();<NEW_LINE>if (model == null) {<NEW_LINE>return repos;<NEW_LINE>}<NEW_LINE>projectArtifact = new DefaultArtifact(ModelUtils.getGroupId(model), model.getArtifactId(), null, "pom", ModelUtils.getVersion(model));<NEW_LINE>} else {<NEW_LINE>projectArtifact = new DefaultArtifact(currentProject.getGroupId(), currentProject.getArtifactId(), null, <MASK><NEW_LINE>}<NEW_LINE>final List<RemoteRepository> rawRepos;<NEW_LINE>try {<NEW_LINE>rawRepos = getRepositorySystem().readArtifactDescriptor(getRepositorySystemSession(), new ArtifactDescriptorRequest().setArtifact(projectArtifact).setRepositories(repos)).getRepositories();<NEW_LINE>} catch (ArtifactDescriptorException e) {<NEW_LINE>throw new BootstrapMavenException("Failed to read artifact descriptor for " + projectArtifact, e);<NEW_LINE>}<NEW_LINE>return getRepositorySystem().newResolutionRepositories(getRepositorySystemSession(), rawRepos);<NEW_LINE>}
"pom", currentProject.getVersion());
11,108
public void onSpeechButtonClicked(View v) {<NEW_LINE>// 'hello' is the ID of your text view<NEW_LINE>TextView txt = (TextView) this.findViewById(R.id.hello);<NEW_LINE>try {<NEW_LINE>Future<IntentRecognitionResult> task = reco.recognizeOnceAsync();<NEW_LINE>// Note: this will block the UI thread, so eventually, you want to register for the event (see full samples)<NEW_LINE>IntentRecognitionResult result = task.get();<NEW_LINE>String res = "";<NEW_LINE>// Checks result.<NEW_LINE>if (result.getReason() == ResultReason.RecognizedIntent) {<NEW_LINE>res = res.concat("RECOGNIZED: Text=" + result.getText());<NEW_LINE>res = res.concat(" Intent Id: " + result.getIntentId());<NEW_LINE>res = res.concat(" Intent Service JSON: " + result.getProperties().getProperty(PropertyId.LanguageUnderstandingServiceResponse_JsonResult));<NEW_LINE>} else if (result.getReason() == ResultReason.RecognizedSpeech) {<NEW_LINE>res = res.concat("RECOGNIZED: Text=" + result.getText());<NEW_LINE>res = res.concat(" Intent not recognized.");<NEW_LINE>} else if (result.getReason() == ResultReason.NoMatch) {<NEW_LINE>res = res.concat("NOMATCH: Speech could not be recognized.");<NEW_LINE>} else if (result.getReason() == ResultReason.Canceled) {<NEW_LINE>CancellationDetails cancellation = CancellationDetails.fromResult(result);<NEW_LINE>res = res.concat("CANCELED: Reason=" + cancellation.getReason());<NEW_LINE>if (cancellation.getReason() == CancellationReason.Error) {<NEW_LINE>res = res.concat("CANCELED: ErrorCode=" + cancellation.getErrorCode());<NEW_LINE>res = res.concat("CANCELED: ErrorDetails=" + cancellation.getErrorDetails());<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>txt.setText(res);<NEW_LINE>result.close();<NEW_LINE>} catch (Exception ex) {<NEW_LINE>Log.e("SpeechSDKDemo", "unexpected " + ex.getMessage());<NEW_LINE>assert (false);<NEW_LINE>}<NEW_LINE>}
res = res.concat("CANCELED: Did you update the subscription info?");
992,383
public void drag(Collection<Direction> resizeDirection, int diffX, int diffY, Point mousePosBeforeDrag, boolean isShiftKeyDown, boolean firstDrag, StickableMap stickables, boolean undoable) {<NEW_LINE>Rectangle oldRect = getRectangle();<NEW_LINE>StickingPolygon stickingPolygonBeforeLocationChange = generateStickingBorder();<NEW_LINE>String oldAddAttr = getAdditionalAttributes();<NEW_LINE>if (resizeDirection.isEmpty()) {<NEW_LINE>// Move GridElement<NEW_LINE>setLocationDifference(diffX, diffY);<NEW_LINE>} else {<NEW_LINE>// Resize GridElement<NEW_LINE>Rectangle rect = getRectangle();<NEW_LINE>if (isShiftKeyDown && diagonalResize(resizeDirection)) {<NEW_LINE>// Proportional Resize<NEW_LINE>boolean mouseToRight = diffX > 0 && diffX > diffY;<NEW_LINE>boolean mouseDown = diffY > 0 && diffY > diffX;<NEW_LINE>boolean mouseLeft = diffX < 0 && diffX < diffY;<NEW_LINE>boolean mouseUp <MASK><NEW_LINE>if (mouseToRight || mouseLeft) {<NEW_LINE>diffY = diffX;<NEW_LINE>}<NEW_LINE>if (mouseDown || mouseUp) {<NEW_LINE>diffX = diffY;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (resizeDirection.contains(Direction.LEFT) && resizeDirection.contains(Direction.RIGHT)) {<NEW_LINE>rect.setX(rect.getX() - diffX / 2);<NEW_LINE>rect.setWidth(Math.max(rect.getWidth() + diffX, minSize()));<NEW_LINE>} else if (resizeDirection.contains(Direction.LEFT)) {<NEW_LINE>int newWidth = rect.getWidth() - diffX;<NEW_LINE>if (newWidth >= minSize()) {<NEW_LINE>rect.setX(rect.getX() + diffX);<NEW_LINE>rect.setWidth(newWidth);<NEW_LINE>}<NEW_LINE>} else if (resizeDirection.contains(Direction.RIGHT)) {<NEW_LINE>rect.setWidth(Math.max(rect.getWidth() + diffX, minSize()));<NEW_LINE>}<NEW_LINE>if (resizeDirection.contains(Direction.UP)) {<NEW_LINE>int newHeight = rect.getHeight() - diffY;<NEW_LINE>if (newHeight >= minSize()) {<NEW_LINE>rect.setY(rect.getY() + diffY);<NEW_LINE>rect.setHeight(newHeight);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (resizeDirection.contains(Direction.DOWN)) {<NEW_LINE>rect.setHeight(Math.max(rect.getHeight() + diffY, minSize()));<NEW_LINE>}<NEW_LINE>setRectangle(rect);<NEW_LINE>updateModelFromText();<NEW_LINE>}<NEW_LINE>moveStickables(stickables, undoable, oldRect, stickingPolygonBeforeLocationChange, oldAddAttr);<NEW_LINE>}
= diffY < 0 && diffY < diffX;
44,261
public static void compress(MapBasedCharNgramLanguageModel model, File output) throws IOException {<NEW_LINE>Mphf[] mphfs = new MultiLevelMphf[model.getOrder() + 1];<NEW_LINE>DoubleLookup[] lookups = new DoubleLookup[model.getOrder() + 1];<NEW_LINE>try (DataOutputStream dos = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(output)))) {<NEW_LINE>dos.writeInt(model.getOrder());<NEW_LINE>dos.writeUTF(model.getId());<NEW_LINE>for (int i = 1; i <= model.getOrder(); i++) {<NEW_LINE>Histogram<Double> histogram = new Histogram<>();<NEW_LINE>histogram.add(model.gramLogProbs[i].values.values());<NEW_LINE>double[] lookup = new double[histogram.size()];<NEW_LINE>int j = 0;<NEW_LINE>for (Double key : histogram) {<NEW_LINE>lookup[j] = key;<NEW_LINE>j++;<NEW_LINE>}<NEW_LINE>Quantizer quantizer = BinningQuantizer.linearBinning(lookup, 8);<NEW_LINE>lookups[i] = quantizer.getDequantizer();<NEW_LINE>List<String> keys = Lists.newArrayList(model.gramLogProbs[i].values.keySet());<NEW_LINE>int[] fingerprints = new int[keys.size()];<NEW_LINE>int[] probabilityIndexes = new int[keys.size()];<NEW_LINE>mphfs[i] = MultiLevelMphf.generate(new StringListKeyProvider(keys));<NEW_LINE>for (final String key : keys) {<NEW_LINE>final int index = mphfs[i].get(key);<NEW_LINE>fingerprints[index] = MultiLevelMphf.hash<MASK><NEW_LINE>probabilityIndexes[index] = quantizer.getQuantizationIndex(model.gramLogProbs[i].values.get(key));<NEW_LINE>}<NEW_LINE>lookups[i].save(dos);<NEW_LINE>dos.writeInt(keys.size());<NEW_LINE>for (int k = 0; k < keys.size(); k++) {<NEW_LINE>dos.writeShort(fingerprints[k] & 0xffff);<NEW_LINE>dos.writeByte(probabilityIndexes[k]);<NEW_LINE>}<NEW_LINE>mphfs[i].serialize(dos);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
(key, -1) & FINGER_PRINT_MASK;
1,046,274
protected void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception {<NEW_LINE>if (args.length < 1 || args[0].length() < 2) {<NEW_LINE>throw new NotEnoughArgumentsException(tl("mobsAvailable", StringUtil.joinList(Mob.getMobList())));<NEW_LINE>}<NEW_LINE>final Location target = LocationUtil.getTarget(user.getBase());<NEW_LINE>if (target.getBlock().getType() != MOB_SPAWNER) {<NEW_LINE>throw new Exception(tl("mobSpawnTarget"));<NEW_LINE>}<NEW_LINE>final String name = args[0];<NEW_LINE>int delay = 0;<NEW_LINE>final Mob mob = Mob.fromName(name);<NEW_LINE>if (mob == null) {<NEW_LINE>throw new Exception(tl("invalidMob"));<NEW_LINE>}<NEW_LINE>if (ess.getSettings().getProtectPreventSpawn(mob.getType().toString().toLowerCase(Locale.ENGLISH))) {<NEW_LINE>throw new Exception(tl("disabledToSpawnMob"));<NEW_LINE>}<NEW_LINE>if (!user.isAuthorized("essentials.spawner." + mob.name.toLowerCase(Locale.ENGLISH))) {<NEW_LINE>throw new Exception(tl("noPermToSpawnMob"));<NEW_LINE>}<NEW_LINE>if (args.length > 1 && NumberUtil.isInt(args[1]) && user.isAuthorized("essentials.spawner.delay")) {<NEW_LINE>delay = Integer.parseInt(args[1]);<NEW_LINE>}<NEW_LINE>final Trade charge = new Trade("spawner-" + mob.name.toLowerCase(Locale.ENGLISH), ess);<NEW_LINE>charge.isAffordableFor(user);<NEW_LINE>try {<NEW_LINE>final CreatureSpawner spawner = (CreatureSpawner) target.getBlock().getState();<NEW_LINE>spawner.setSpawnedType(mob.getType());<NEW_LINE>if (delay > 0) {<NEW_LINE>final SpawnerBlockProvider spawnerBlockProvider = ess.getSpawnerBlockProvider();<NEW_LINE>spawnerBlockProvider.setMinSpawnDelay(spawner, 1);<NEW_LINE>spawnerBlockProvider.setMaxSpawnDelay(spawner, Integer.MAX_VALUE);<NEW_LINE>spawnerBlockProvider.setMinSpawnDelay(spawner, delay);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>spawner.setDelay(delay);<NEW_LINE>spawner.update();<NEW_LINE>} catch (final Throwable ex) {<NEW_LINE>throw new Exception(tl("mobSpawnError"), ex);<NEW_LINE>}<NEW_LINE>charge.charge(user);<NEW_LINE>user.sendMessage(tl("setSpawner", mob.name));<NEW_LINE>}
spawnerBlockProvider.setMaxSpawnDelay(spawner, delay);
1,333,608
final GetDevicePoolCompatibilityResult executeGetDevicePoolCompatibility(GetDevicePoolCompatibilityRequest getDevicePoolCompatibilityRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getDevicePoolCompatibilityRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetDevicePoolCompatibilityRequest> request = null;<NEW_LINE>Response<GetDevicePoolCompatibilityResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetDevicePoolCompatibilityRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getDevicePoolCompatibilityRequest));<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, "Device Farm");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetDevicePoolCompatibility");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetDevicePoolCompatibilityResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetDevicePoolCompatibilityResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
endClientExecution(awsRequestMetrics, request, response);
1,078,643
public static CodeExpression containerDelegateCodeExpression(RADVisualContainer metaContainer, CodeStructure codeStructure) {<NEW_LINE>CodeExpression containerCodeExpression = metaContainer.getCodeExpression();<NEW_LINE>CodeExpression containerDelegateCodeExpression;<NEW_LINE>java.lang.reflect.Method delegateGetter = metaContainer.getContainerDelegateMethod();<NEW_LINE>if (delegateGetter != null) {<NEW_LINE>// there should be a container delegate<NEW_LINE>Iterator <MASK><NEW_LINE>CodeExpression[] expressions = CodeStructure.filterExpressions(it, delegateGetter);<NEW_LINE>if (expressions.length > 0) {<NEW_LINE>// the expresion for the container delegate already exists<NEW_LINE>containerDelegateCodeExpression = expressions[0];<NEW_LINE>} else {<NEW_LINE>// create a new expresion for the container delegate<NEW_LINE>CodeExpressionOrigin origin = CodeStructure.createOrigin(containerCodeExpression, delegateGetter, null);<NEW_LINE>containerDelegateCodeExpression = codeStructure.createExpression(origin);<NEW_LINE>}<NEW_LINE>} else<NEW_LINE>// no special container delegate<NEW_LINE>containerDelegateCodeExpression = containerCodeExpression;<NEW_LINE>return containerDelegateCodeExpression;<NEW_LINE>}
it = CodeStructure.getDefinedExpressionsIterator(containerCodeExpression);
1,781,189
private Mono<Void> mapRoute(DomainsOracle domains, String appName, CFRoute route, boolean randomRoute) {<NEW_LINE>// Let the client validate if any of these combinations are correct.<NEW_LINE>// However, only set these values only if they are present as not doing so causes NPE<NEW_LINE>Mono<MapRouteRequest.Builder> _builder = Mono.just(MapRouteRequest.builder().applicationName(appName));<NEW_LINE>if (StringUtil.hasText(route.getDomain())) {<NEW_LINE>_builder = _builder.map(builder -> builder.domain(route.getDomain()));<NEW_LINE>}<NEW_LINE>if (randomRoute) {<NEW_LINE>_builder = _builder.flatMap((MapRouteRequest.Builder builder) -> domains.isTcp(route.getDomain()).map(isTcp -> {<NEW_LINE>if (isTcp) {<NEW_LINE>builder.randomPort(randomRoute);<NEW_LINE>} else {<NEW_LINE>if (route.getHost() == null) {<NEW_LINE>builder.host(appName + "-" + RandomStringUtils.randomAlphabetic(8).toLowerCase());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return builder;<NEW_LINE>}));<NEW_LINE>}<NEW_LINE>_builder = _builder.map(builder -> {<NEW_LINE>if (StringUtil.hasText(route.getHost())) {<NEW_LINE>builder.host(route.getHost());<NEW_LINE>}<NEW_LINE>if (StringUtil.hasText(route.getPath())) {<NEW_LINE>builder.path(route.getPath());<NEW_LINE>}<NEW_LINE>if (route.getPort() != CFRoute.NO_PORT) {<NEW_LINE>builder.port(route.getPort());<NEW_LINE>}<NEW_LINE>return builder;<NEW_LINE>});<NEW_LINE>return _builder.flatMap(builder -> {<NEW_LINE>MapRouteRequest mapRouteReq = builder.build();<NEW_LINE>return log("operations.routes.map(" + mapRouteReq + ")", _operations.routes<MASK><NEW_LINE>}).then();<NEW_LINE>}
().map(mapRouteReq));
1,344
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {<NEW_LINE>super.onViewCreated(view, savedInstanceState);<NEW_LINE>// noinspection ConstantConditions<NEW_LINE>mRecyclerView = getView().findViewById(R.id.recycler_view);<NEW_LINE>mLayoutManager = new StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.VERTICAL);<NEW_LINE>// drag & drop manager<NEW_LINE>mRecyclerViewDragDropManager = new RecyclerViewDragDropManager();<NEW_LINE>mRecyclerViewDragDropManager.setDraggingItemShadowDrawable((NinePatchDrawable) ContextCompat.getDrawable(requireContext(), R.drawable.material_shadow_z3));<NEW_LINE>// Start dragging after long press<NEW_LINE>mRecyclerViewDragDropManager.setInitiateOnLongPress(true);<NEW_LINE>mRecyclerViewDragDropManager.setInitiateOnMove(false);<NEW_LINE>mRecyclerViewDragDropManager.setLongPressTimeout(750);<NEW_LINE>// adapter<NEW_LINE>final DraggableStaggeredGridExampleAdapter myItemAdapter = new DraggableStaggeredGridExampleAdapter(getDataProvider());<NEW_LINE>mAdapter = myItemAdapter;<NEW_LINE>// wrap for dragging<NEW_LINE>mWrappedAdapter = mRecyclerViewDragDropManager.createWrappedAdapter(myItemAdapter);<NEW_LINE><MASK><NEW_LINE>mRecyclerView.setLayoutManager(mLayoutManager);<NEW_LINE>// requires *wrapped* adapter<NEW_LINE>mRecyclerView.setAdapter(mWrappedAdapter);<NEW_LINE>mRecyclerView.setItemAnimator(animator);<NEW_LINE>mRecyclerView.setHasFixedSize(false);<NEW_LINE>// additional decorations<NEW_LINE>// noinspection StatementWithEmptyBody<NEW_LINE>if (supportsViewElevation()) {<NEW_LINE>// Lollipop or later has native drop shadow feature. ItemShadowDecorator is not required.<NEW_LINE>} else {<NEW_LINE>mRecyclerView.addItemDecoration(new ItemShadowDecorator((NinePatchDrawable) ContextCompat.getDrawable(requireContext(), R.drawable.material_shadow_z1)));<NEW_LINE>}<NEW_LINE>mRecyclerViewDragDropManager.attachRecyclerView(mRecyclerView);<NEW_LINE>// for debugging<NEW_LINE>// animator.setDebug(true);<NEW_LINE>// animator.setMoveDuration(2000);<NEW_LINE>}
final GeneralItemAnimator animator = new DraggableItemAnimator();
621,834
protected void masterOperation(Task task, GetShardSnapshotRequest request, ClusterState state, ActionListener<GetShardSnapshotResponse> listener) throws Exception {<NEW_LINE>final Set<String> repositories = getRequestedRepositories(request, state);<NEW_LINE>final ShardId shardId = request.getShardId();<NEW_LINE>if (repositories.isEmpty()) {<NEW_LINE>listener.onResponse(GetShardSnapshotResponse.EMPTY);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>GroupedActionListener<Tuple<Optional<ShardSnapshotInfo>, RepositoryException>> groupedActionListener = new GroupedActionListener<>(listener.map(TransportGetShardSnapshotAction::transformToResponse), repositories.size());<NEW_LINE>BlockingQueue<String> repositoriesQueue = new LinkedBlockingQueue<>(repositories);<NEW_LINE>getShardSnapshots(repositoriesQueue, shardId, new ActionListener<>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onResponse(Optional<ShardSnapshotInfo> shardSnapshotInfo) {<NEW_LINE>groupedActionListener.onResponse(Tuple.tuple(shardSnapshotInfo, null));<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onFailure(Exception err) {<NEW_LINE>if (request.isSingleRepositoryRequest() == false && err instanceof RepositoryException) {<NEW_LINE>groupedActionListener.onResponse(Tuple.tuple(Optional.empty(<MASK><NEW_LINE>} else {<NEW_LINE>groupedActionListener.onFailure(err);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
), (RepositoryException) err));
1,370,194
public void updateTrackedQueryKeys(long trackedQueryId, Set<ChildKey> added, Set<ChildKey> removed) {<NEW_LINE>verifyInsideTransaction();<NEW_LINE>long start = System.currentTimeMillis();<NEW_LINE>String whereClause = TRACKED_KEYS_ID_COLUMN_NAME + " = ? AND " + TRACKED_KEYS_KEY_COLUMN_NAME + " = ?";<NEW_LINE>String trackedQueryIdStr = String.valueOf(trackedQueryId);<NEW_LINE>for (ChildKey removedKey : removed) {<NEW_LINE>database.delete(TRACKED_KEYS_TABLE, whereClause, new String[] { trackedQueryIdStr, removedKey.asString() });<NEW_LINE>}<NEW_LINE>for (ChildKey addedKey : added) {<NEW_LINE>ContentValues values = new ContentValues();<NEW_LINE><MASK><NEW_LINE>values.put(TRACKED_KEYS_KEY_COLUMN_NAME, addedKey.asString());<NEW_LINE>database.insertWithOnConflict(TRACKED_KEYS_TABLE, null, values, SQLiteDatabase.CONFLICT_REPLACE);<NEW_LINE>}<NEW_LINE>long duration = System.currentTimeMillis() - start;<NEW_LINE>if (logger.logsDebug()) {<NEW_LINE>logger.debug(String.format(Locale.US, "Updated tracked query keys (%d added, %d removed) for tracked query id %d in %dms", added.size(), removed.size(), trackedQueryId, duration));<NEW_LINE>}<NEW_LINE>}
values.put(TRACKED_KEYS_ID_COLUMN_NAME, trackedQueryId);
1,273,046
final UpdateStudioResult executeUpdateStudio(UpdateStudioRequest updateStudioRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateStudioRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<UpdateStudioRequest> request = null;<NEW_LINE>Response<UpdateStudioResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateStudioRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateStudioRequest));<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, "nimble");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateStudio");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateStudioResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateStudioResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
1,113,975
public RelWriter explainTermsForDisplay(RelWriter pw) {<NEW_LINE>pw.item(RelDrdsWriter.REL_NAME, "MysqlSort");<NEW_LINE>assert fieldExps.size() == collation.getFieldCollations().size();<NEW_LINE>if (pw.nest()) {<NEW_LINE>pw.item("collation", collation);<NEW_LINE>} else {<NEW_LINE>List<String> sortList = new ArrayList<String<MASK><NEW_LINE>for (int i = 0; i < fieldExps.size(); i++) {<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>RexExplainVisitor visitor = new RexExplainVisitor(this);<NEW_LINE>fieldExps.get(i).accept(visitor);<NEW_LINE>sb.append(visitor.toSqlString()).append(" ").append(collation.getFieldCollations().get(i).getDirection().shortString);<NEW_LINE>sortList.add(sb.toString());<NEW_LINE>}<NEW_LINE>String sortString = StringUtils.join(sortList, ",");<NEW_LINE>pw.itemIf("sort", sortString, !StringUtils.isEmpty(sortString));<NEW_LINE>}<NEW_LINE>pw.itemIf("offset", offset, offset != null);<NEW_LINE>pw.itemIf("fetch", fetch, fetch != null);<NEW_LINE>Index index = MysqlSort.canUseIndex(this, getCluster().getMetadataQuery());<NEW_LINE>if (index != null) {<NEW_LINE>pw.item("index", index.getIndexMeta().getPhysicalIndexName());<NEW_LINE>}<NEW_LINE>return pw;<NEW_LINE>}
>(fieldExps.size());
1,813,217
public static Actions forNode(HeapViewerNode node, Collection<HeapViewerNodeAction.Provider> actionProviders, HeapContext context, HeapViewerActions actions, HeapViewerNodeAction... additionalActions) {<NEW_LINE>HeapViewerNode loop = HeapViewerNode.getValue(node, DataType.LOOP, context.getFragment().getHeap());<NEW_LINE>if (loop != null)<NEW_LINE>node = loop;<NEW_LINE>List<HeapViewerNodeAction> actionsList = new ArrayList();<NEW_LINE>for (HeapViewerNodeAction.Provider provider : actionProviders) {<NEW_LINE>HeapViewerNodeAction[] providerActions = provider.getActions(node, context, actions);<NEW_LINE>if (providerActions != null)<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (additionalActions != null)<NEW_LINE>Collections.addAll(actionsList, additionalActions);<NEW_LINE>Collections.sort(actionsList, new Comparator<HeapViewerNodeAction>() {<NEW_LINE><NEW_LINE>public int compare(HeapViewerNodeAction a1, HeapViewerNodeAction a2) {<NEW_LINE>return Integer.compare(a1.getPosition(), a2.getPosition());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return new Actions(actionsList);<NEW_LINE>}
Collections.addAll(actionsList, providerActions);
1,530,000
public static void DumpCharAndRangeMoves(CodeGenerator codeGenerator) {<NEW_LINE>boolean[] dumped = new boolean[Math.max(generatedStates, dummyStateIndex + 1)];<NEW_LINE>Enumeration e = compositeStateTable.keys();<NEW_LINE>int i;<NEW_LINE>DumpHeadForCase(codeGenerator, -1);<NEW_LINE>while (e.hasMoreElements()) DumpCompositeStatesNonAsciiMoves(codeGenerator, (String) e.nextElement(), dumped);<NEW_LINE>for (i = 0; i < allStates.size(); i++) {<NEW_LINE>NfaState temp = (NfaState) allStates.get(i);<NEW_LINE>if (temp.stateName == -1 || dumped[temp.stateName] || temp.lexState != Main.lg.lexStateIndex || !temp.HasTransitions() || temp.dummy)<NEW_LINE>continue;<NEW_LINE>String toPrint = "";<NEW_LINE>if (temp.stateForCase != null) {<NEW_LINE>if (temp.inNextOf == 1)<NEW_LINE>continue;<NEW_LINE>if (dumped[temp.stateForCase.stateName])<NEW_LINE>continue;<NEW_LINE>toPrint = (temp.stateForCase.PrintNoBreak(<MASK><NEW_LINE>if (temp.nonAsciiMethod == -1) {<NEW_LINE>if (toPrint.equals(""))<NEW_LINE>codeGenerator.genCodeLine(" break;");<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (temp.nonAsciiMethod == -1)<NEW_LINE>continue;<NEW_LINE>if (!toPrint.equals(""))<NEW_LINE>codeGenerator.genCode(toPrint);<NEW_LINE>dumped[temp.stateName] = true;<NEW_LINE>// System.out.println("case : " + temp.stateName);<NEW_LINE>codeGenerator.genCodeLine(" case " + temp.stateName + ":");<NEW_LINE>temp.DumpNonAsciiMove(codeGenerator, dumped);<NEW_LINE>}<NEW_LINE>if (Options.getJavaUnicodeEscape() || unicodeWarningGiven) {<NEW_LINE>codeGenerator.genCodeLine(" default : if (i1 == 0 || l1 == 0 || i2 == 0 || l2 == 0) break; else break;");<NEW_LINE>} else {<NEW_LINE>codeGenerator.genCodeLine(" default : break;");<NEW_LINE>}<NEW_LINE>codeGenerator.genCodeLine(" }");<NEW_LINE>codeGenerator.genCodeLine(" } while(i != startsAt);");<NEW_LINE>}
codeGenerator, -1, dumped));
955,197
public static Map<String, MetricValue> allMetrics() {<NEW_LINE>Map<String, MetricValue> metricsMap = new HashMap<>();<NEW_LINE>for (Map.Entry<String, com.codahale.metrics.Metric> entry : METRIC_REGISTRY.getMetrics().entrySet()) {<NEW_LINE>MetricValue.Builder valueBuilder = MetricValue.newBuilder();<NEW_LINE>com.codahale.metrics.Metric metric = entry.getValue();<NEW_LINE>if (metric instanceof Gauge) {<NEW_LINE>Object value = ((Gauge) metric).getValue();<NEW_LINE>if (value instanceof Number) {<NEW_LINE>valueBuilder.setDoubleValue(((Number) value).doubleValue());<NEW_LINE>} else {<NEW_LINE>valueBuilder.setStringValue(value.toString());<NEW_LINE>}<NEW_LINE>valueBuilder.setMetricType(MetricType.GAUGE);<NEW_LINE>} else if (metric instanceof Counter) {<NEW_LINE>valueBuilder.setMetricType(MetricType.COUNTER).setDoubleValue(((Counter) metric).getCount());<NEW_LINE>} else if (metric instanceof Meter) {<NEW_LINE>valueBuilder.setMetricType(MetricType.METER).setDoubleValue(((Meter) metric).getOneMinuteRate());<NEW_LINE>} else if (metric instanceof Timer) {<NEW_LINE>valueBuilder.setMetricType(MetricType.TIMER).setDoubleValue(((Timer) metric).getCount());<NEW_LINE>} else {<NEW_LINE>LOG.warn("Metric {} has invalid metric type {}", entry.getKey(), metric.<MASK><NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>metricsMap.put(unescape(entry.getKey()), valueBuilder.build());<NEW_LINE>}<NEW_LINE>return metricsMap;<NEW_LINE>}
getClass().getName());
1,184,815
public static void registerCustom() {<NEW_LINE>registerCustomComponent("Table", com.codename1.<MASK><NEW_LINE>registerCustomComponent("MediaPlayer", com.codename1.components.MediaPlayer.class);<NEW_LINE>registerCustomComponent("ContainerList", com.codename1.ui.list.ContainerList.class);<NEW_LINE>registerCustomComponent("ComponentGroup", com.codename1.ui.ComponentGroup.class);<NEW_LINE>registerCustomComponent("Tree", com.codename1.ui.tree.Tree.class);<NEW_LINE>registerCustomComponent("HTMLComponent", com.codename1.ui.html.HTMLComponent.class);<NEW_LINE>registerCustomComponent("RSSReader", com.codename1.components.RSSReader.class);<NEW_LINE>registerCustomComponent("FileTree", com.codename1.components.FileTree.class);<NEW_LINE>registerCustomComponent("WebBrowser", com.codename1.components.WebBrowser.class);<NEW_LINE>registerCustomComponent("NumericSpinner", com.codename1.ui.spinner.NumericSpinner.class);<NEW_LINE>registerCustomComponent("DateSpinner", com.codename1.ui.spinner.DateSpinner.class);<NEW_LINE>registerCustomComponent("TimeSpinner", com.codename1.ui.spinner.TimeSpinner.class);<NEW_LINE>registerCustomComponent("DateTimeSpinner", com.codename1.ui.spinner.DateTimeSpinner.class);<NEW_LINE>registerCustomComponent("GenericSpinner", com.codename1.ui.spinner.GenericSpinner.class);<NEW_LINE>registerCustomComponent("LikeButton", com.codename1.facebook.ui.LikeButton.class);<NEW_LINE>registerCustomComponent("InfiniteProgress", com.codename1.components.InfiniteProgress.class);<NEW_LINE>registerCustomComponent("MultiButton", com.codename1.components.MultiButton.class);<NEW_LINE>registerCustomComponent("SpanButton", com.codename1.components.SpanButton.class);<NEW_LINE>registerCustomComponent("SpanLabel", com.codename1.components.SpanLabel.class);<NEW_LINE>registerCustomComponent("Ads", com.codename1.components.Ads.class);<NEW_LINE>registerCustomComponent("MapComponent", com.codename1.maps.MapComponent.class);<NEW_LINE>registerCustomComponent("MultiList", com.codename1.ui.list.MultiList.class);<NEW_LINE>registerCustomComponent("ShareButton", com.codename1.components.ShareButton.class);<NEW_LINE>registerCustomComponent("OnOffSwitch", com.codename1.components.OnOffSwitch.class);<NEW_LINE>registerCustomComponent("ImageViewer", com.codename1.components.ImageViewer.class);<NEW_LINE>registerCustomComponent("AutoCompleteTextField", com.codename1.ui.AutoCompleteTextField.class);<NEW_LINE>registerCustomComponent("Picker", com.codename1.ui.spinner.Picker.class);<NEW_LINE>}
ui.table.Table.class);
209,816
private void printUsage() {<NEW_LINE>System.out.println("J9 NLS Tool 1.2");<NEW_LINE>System.out.println("Usage: J9NLS [options]\n");<NEW_LINE>System.out.println("[options]");<NEW_LINE>System.out.println(" -help prints this message");<NEW_LINE>System.out.println(" -out xxx generates output named as xxx");<NEW_LINE>System.out.println(" -source path to the source directory");<NEW_LINE>System.out.println(" -[no]html xxx [do not] generates HTML file, which contains output results, named as xxx");<NEW_LINE>System.out.println(" -palm generates output as Palm resources\n");<NEW_LINE>System.out.println(" -debug generates informational output\n");<NEW_LINE>System.out.println("Defaults are:");<NEW_LINE>System.out.println(<MASK><NEW_LINE>System.out.println(" -source . ");<NEW_LINE>}
" -out " + propertiesFileName + "-html" + htmlFileName);
1,291,769
protected void initCoreTypes() {<NEW_LINE>if (JSweetDefTranslatorConfig.isJDKReplacementMode()) {<NEW_LINE>registerType("java.util.function.Function", TypeDeclaration.createExternalTypeDeclaration("Function"));<NEW_LINE>registerType("java.util.function.BiFunction", TypeDeclaration.createExternalTypeDeclaration("BiFunction"));<NEW_LINE>registerType("java.util.function.TriFunction"<MASK><NEW_LINE>registerType("java.util.function.Supplier", TypeDeclaration.createExternalTypeDeclaration("Supplier"));<NEW_LINE>registerType("java.util.function.Consumer", TypeDeclaration.createExternalTypeDeclaration("Consumer"));<NEW_LINE>registerType("java.util.function.BiConsumer", TypeDeclaration.createExternalTypeDeclaration("BiConsumer"));<NEW_LINE>registerType("java.util.function.TriConsumer", TypeDeclaration.createExternalTypeDeclaration("TriConsumer"));<NEW_LINE>} else {<NEW_LINE>registerType("java.lang.Object", TypeDeclaration.createExternalTypeDeclaration("Object"));<NEW_LINE>registerType("java.lang.Boolean", TypeDeclaration.createExternalTypeDeclaration("Boolean"));<NEW_LINE>registerType("java.lang.String", TypeDeclaration.createExternalTypeDeclaration("String"));<NEW_LINE>registerType("java.util.function.Function", TypeDeclaration.createExternalTypeDeclaration("Function"));<NEW_LINE>registerType("java.util.function.BiFunction", TypeDeclaration.createExternalTypeDeclaration("BiFunction"));<NEW_LINE>registerType("jsweet.util.function.TriFunction", TypeDeclaration.createExternalTypeDeclaration("TriFunction"));<NEW_LINE>registerType("java.util.function.Supplier", TypeDeclaration.createExternalTypeDeclaration("Supplier"));<NEW_LINE>registerType("java.util.function.Consumer", TypeDeclaration.createExternalTypeDeclaration("Consumer"));<NEW_LINE>registerType("java.util.function.BiConsumer", TypeDeclaration.createExternalTypeDeclaration("BiConsumer"));<NEW_LINE>registerType("jsweet.util.function.TriConsumer", TypeDeclaration.createExternalTypeDeclaration("TriConsumer"));<NEW_LINE>}<NEW_LINE>registerType("java.lang.Double", TypeDeclaration.createExternalTypeDeclaration("Double"));<NEW_LINE>registerType("java.lang.Runnable", TypeDeclaration.createExternalTypeDeclaration("Runnable"));<NEW_LINE>registerType("java.lang.Void", TypeDeclaration.createExternalTypeDeclaration("Void"));<NEW_LINE>registerType("double", TypeDeclaration.createExternalTypeDeclaration("double"));<NEW_LINE>registerType("boolean", TypeDeclaration.createExternalTypeDeclaration("boolean"));<NEW_LINE>registerType("void", TypeDeclaration.createExternalTypeDeclaration("void"));<NEW_LINE>registerType("any", TypeDeclaration.createExternalTypeDeclaration("any"));<NEW_LINE>registerType("string", TypeDeclaration.createExternalTypeDeclaration("string"));<NEW_LINE>registerType("number", TypeDeclaration.createExternalTypeDeclaration("number"));<NEW_LINE>registerType("symbol", TypeDeclaration.createExternalTypeDeclaration("symbol"));<NEW_LINE>registerType(JSweetDefTranslatorConfig.UNION_CLASS_NAME, TypeDeclaration.createExternalTypeDeclaration("interface", "Union"));<NEW_LINE>for (int i = 2; i <= 6; i++) {<NEW_LINE>registerType(JSweetDefTranslatorConfig.TUPLE_CLASSES_PACKAGE + "." + JSweetDefTranslatorConfig.TUPLE_CLASSES_PREFIX + i, TypeDeclaration.createExternalTypeDeclaration(JSweetDefTranslatorConfig.TUPLE_CLASSES_PREFIX + i));<NEW_LINE>}<NEW_LINE>}
, TypeDeclaration.createExternalTypeDeclaration("TriFunction"));
953,421
private boolean processGlobalRequestsOptimized(@Nonnull MultiMap<Set<IdIndexEntry>, RequestWithProcessor> singles, @Nonnull ProgressIndicator progress, @Nonnull final Map<RequestWithProcessor, Processor<PsiElement>> localProcessors) {<NEW_LINE>if (singles.isEmpty()) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (singles.size() == 1) {<NEW_LINE>final Collection<? extends RequestWithProcessor> requests = singles.values();<NEW_LINE>if (requests.size() == 1) {<NEW_LINE>final RequestWithProcessor theOnly = requests.iterator().next();<NEW_LINE>return processSingleRequest(theOnly.request, theOnly.refProcessor);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>progress.pushState();<NEW_LINE>progress.setText<MASK><NEW_LINE>boolean result;<NEW_LINE>try {<NEW_LINE>// intersectionCandidateFiles holds files containing words from all requests in `singles` and words in corresponding container names<NEW_LINE>final MultiMap<VirtualFile, RequestWithProcessor> intersectionCandidateFiles = createMultiMap();<NEW_LINE>// restCandidateFiles holds files containing words from all requests in `singles` but EXCLUDING words in corresponding container names<NEW_LINE>final MultiMap<VirtualFile, RequestWithProcessor> restCandidateFiles = createMultiMap();<NEW_LINE>collectFiles(singles, progress, intersectionCandidateFiles, restCandidateFiles);<NEW_LINE>if (intersectionCandidateFiles.isEmpty() && restCandidateFiles.isEmpty()) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>final Set<String> allWords = new TreeSet<>();<NEW_LINE>for (RequestWithProcessor singleRequest : localProcessors.keySet()) {<NEW_LINE>allWords.add(singleRequest.request.word);<NEW_LINE>}<NEW_LINE>progress.setText(PsiBundle.message("psi.search.for.word.progress", getPresentableWordsDescription(allWords)));<NEW_LINE>if (intersectionCandidateFiles.isEmpty()) {<NEW_LINE>result = processCandidates(localProcessors, restCandidateFiles, progress, restCandidateFiles.size(), 0);<NEW_LINE>} else {<NEW_LINE>int totalSize = restCandidateFiles.size() + intersectionCandidateFiles.size();<NEW_LINE>result = processCandidates(localProcessors, intersectionCandidateFiles, progress, totalSize, 0);<NEW_LINE>if (result) {<NEW_LINE>result = processCandidates(localProcessors, restCandidateFiles, progress, totalSize, intersectionCandidateFiles.size());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>progress.popState();<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
(PsiBundle.message("psi.scanning.files.progress"));
1,598,748
public boolean instantiateTo(int value, ICause cause) throws ContradictionException {<NEW_LINE>// BEWARE: THIS CODE SHOULD NOT BE MOVED TO THE DOMAIN TO NOT DECREASE PERFORMANCES!<NEW_LINE>assert cause != null;<NEW_LINE>if ((mValue < kUNDEF && mValue != value) || (value < kFALSE || value > kTRUE)) {<NEW_LINE>model.getSolver().getEventObserver().instantiateTo(this, value, cause, getLB(), getUB());<NEW_LINE>this.contradiction(cause, mValue < kUNDEF ? MSG_INST : (value > kTRUE ? MSG_LOW : MSG_UPP));<NEW_LINE>} else if (mValue == kUNDEF) {<NEW_LINE>IntEventType e = IntEventType.INSTANTIATE;<NEW_LINE>this.getModel().getEnvironment().save(status);<NEW_LINE>if (reactOnRemoval) {<NEW_LINE>delta.add(kTRUE - value, cause);<NEW_LINE>}<NEW_LINE>mValue = value;<NEW_LINE>model.getSolver().getEventObserver().instantiateTo(this, value, cause, kFALSE, kTRUE);<NEW_LINE><MASK><NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
this.notifyPropagators(e, cause);
323,732
public boolean writeToWindows(String filename, int floor) throws IOException {<NEW_LINE>File file = new File(DataConnector.DATA_PATH + filename + "_" + dampingParameter + "_" + floor + ".wtxt");<NEW_LINE>if (file.isDirectory()) {<NEW_LINE><MASK><NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (file.exists()) {<NEW_LINE>System.out.println("[Info]: File: " + filename + " would be overwritten");<NEW_LINE>}<NEW_LINE>BufferedWriter bf = new BufferedWriter(new FileWriter(file));<NEW_LINE>for (CleanPoi p : vertices) if (Integer.parseInt(p.getFloor()) == floor)<NEW_LINE>bf.write(p.getId() + " " + p.getLat() + " " + p.getLon() + " " + p.getPagerank() + "\n");<NEW_LINE>bf.close();<NEW_LINE>System.out.println("[Info]: File: " + filename + " successfuly saved");<NEW_LINE>return true;<NEW_LINE>}
System.err.println("[Error]: This is a directory");
475,907
private void updatePerSubscriptionNextNotificationDate(final UUID subscriptionId, final LocalDate nextBillingCycleDate, final List<InvoiceItem> newProposedItems, final BillingMode billingMode, final Map<UUID, SubscriptionFutureNotificationDates> perSubscriptionFutureNotificationDates) {<NEW_LINE>LocalDate nextNotificationDate = null;<NEW_LINE>switch(billingMode) {<NEW_LINE>case IN_ADVANCE:<NEW_LINE>for (final InvoiceItem item : newProposedItems) {<NEW_LINE>if ((item.getEndDate() != null) && (item.getAmount() == null || item.getAmount().compareTo(BigDecimal.ZERO) >= 0)) {<NEW_LINE>if (nextNotificationDate == null) {<NEW_LINE>nextNotificationDate = item.getEndDate();<NEW_LINE>} else {<NEW_LINE>nextNotificationDate = nextNotificationDate.compareTo(item.getEndDate()) > 0 ? nextNotificationDate : item.getEndDate();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case IN_ARREAR:<NEW_LINE>nextNotificationDate = nextBillingCycleDate;<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new IllegalStateException("Unrecognized billing mode " + billingMode);<NEW_LINE>}<NEW_LINE>if (nextNotificationDate != null) {<NEW_LINE>SubscriptionFutureNotificationDates <MASK><NEW_LINE>if (subscriptionFutureNotificationDates == null) {<NEW_LINE>subscriptionFutureNotificationDates = new SubscriptionFutureNotificationDates(billingMode);<NEW_LINE>perSubscriptionFutureNotificationDates.put(subscriptionId, subscriptionFutureNotificationDates);<NEW_LINE>}<NEW_LINE>subscriptionFutureNotificationDates.updateNextRecurringDateIfRequired(nextNotificationDate);<NEW_LINE>}<NEW_LINE>}
subscriptionFutureNotificationDates = perSubscriptionFutureNotificationDates.get(subscriptionId);
799,261
private void markExpiredUsingHUContext(@NonNull final HuId huId, @NonNull final IHUContext huContext) {<NEW_LINE>try {<NEW_LINE>countChecked++;<NEW_LINE>final IAttributeStorage huAttributes = getHUAttributes(huId, huContext);<NEW_LINE>final String expiredOld = huAttributes.getValueAsString(HUAttributeConstants.ATTR_Expired);<NEW_LINE>if (HUAttributeConstants.ATTR_Expired_Value_Expired.equals(expiredOld)) {<NEW_LINE>Loggables.addLog("Already marked as Expired: M_HU_ID={}", huId);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>huAttributes.setSaveOnChange(true);<NEW_LINE>huAttributes.setValue(HUAttributeConstants.ATTR_Expired, HUAttributeConstants.ATTR_Expired_Value_Expired);<NEW_LINE>countUpdated++;<NEW_LINE>Loggables.addLog("Successfully processed M_HU_ID={}", huId);<NEW_LINE>} catch (final AdempiereException ex) {<NEW_LINE>Loggables.addLog("!!! Failed processing M_HU_ID={}: {} !!!", <MASK><NEW_LINE>logger.warn("Failed processing M_HU_ID={}. Skipped", huId, ex);<NEW_LINE>}<NEW_LINE>}
huId, ex.getLocalizedMessage());
787,678
public TopicConfig createTopicOfTranCheckMaxTime(final int clientDefaultTopicQueueNums, final int perm) {<NEW_LINE>TopicConfig topicConfig = this.topicConfigTable.get(TopicValidator.RMQ_SYS_TRANS_CHECK_MAX_TIME_TOPIC);<NEW_LINE>if (topicConfig != null)<NEW_LINE>return topicConfig;<NEW_LINE>boolean createNew = false;<NEW_LINE>try {<NEW_LINE>if (this.topicConfigTableLock.tryLock(LOCK_TIMEOUT_MILLIS, TimeUnit.MILLISECONDS)) {<NEW_LINE>try {<NEW_LINE>topicConfig = this.topicConfigTable.get(TopicValidator.RMQ_SYS_TRANS_CHECK_MAX_TIME_TOPIC);<NEW_LINE>if (topicConfig != null)<NEW_LINE>return topicConfig;<NEW_LINE>topicConfig = new TopicConfig(TopicValidator.RMQ_SYS_TRANS_CHECK_MAX_TIME_TOPIC);<NEW_LINE>topicConfig.setReadQueueNums(clientDefaultTopicQueueNums);<NEW_LINE>topicConfig.setWriteQueueNums(clientDefaultTopicQueueNums);<NEW_LINE>topicConfig.setPerm(perm);<NEW_LINE>topicConfig.setTopicSysFlag(0);<NEW_LINE>log.info("create new topic {}", topicConfig);<NEW_LINE>this.topicConfigTable.put(TopicValidator.RMQ_SYS_TRANS_CHECK_MAX_TIME_TOPIC, topicConfig);<NEW_LINE>createNew = true;<NEW_LINE>this.dataVersion.nextVersion();<NEW_LINE>this.persist();<NEW_LINE>} finally {<NEW_LINE>this.topicConfigTableLock.unlock();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (createNew) {<NEW_LINE>this.brokerController.registerBrokerAll(false, true, true);<NEW_LINE>}<NEW_LINE>return topicConfig;<NEW_LINE>}
log.error("create TRANS_CHECK_MAX_TIME_TOPIC exception", e);
514,749
final DeleteTransitGatewayPrefixListReferenceResult executeDeleteTransitGatewayPrefixListReference(DeleteTransitGatewayPrefixListReferenceRequest deleteTransitGatewayPrefixListReferenceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteTransitGatewayPrefixListReferenceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteTransitGatewayPrefixListReferenceRequest> request = null;<NEW_LINE>Response<DeleteTransitGatewayPrefixListReferenceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteTransitGatewayPrefixListReferenceRequestMarshaller().marshall(super.beforeMarshalling(deleteTransitGatewayPrefixListReferenceRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteTransitGatewayPrefixListReference");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DeleteTransitGatewayPrefixListReferenceResult> responseHandler = new StaxResponseHandler<DeleteTransitGatewayPrefixListReferenceResult>(new DeleteTransitGatewayPrefixListReferenceResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
1,393,175
// Rewrite IconCrack items to new format :)<NEW_LINE>private static ParticleDataHandler iconcrackHandler() {<NEW_LINE>return new ParticleDataHandler() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Particle handler(Particle particle, Integer[] data) {<NEW_LINE>Item item;<NEW_LINE>if (data.length == 1)<NEW_LINE>item = new DataItem(data[0], (byte) 1<MASK><NEW_LINE>else if (data.length == 2)<NEW_LINE>item = new DataItem(data[0], (byte) 1, data[1].shortValue(), null);<NEW_LINE>else<NEW_LINE>return particle;<NEW_LINE>// Transform to new Item<NEW_LINE>Via.getManager().getProtocolManager().getProtocol(Protocol1_13To1_12_2.class).getItemRewriter().handleItemToClient(item);<NEW_LINE>// Item Slot The item that will be used.<NEW_LINE>particle.getArguments().add(new Particle.ParticleData(Type.FLAT_ITEM, item));<NEW_LINE>return particle;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
, (short) 0, null);
1,041,838
final ListAssignmentsForHITResult executeListAssignmentsForHIT(ListAssignmentsForHITRequest listAssignmentsForHITRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listAssignmentsForHITRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListAssignmentsForHITRequest> request = null;<NEW_LINE>Response<ListAssignmentsForHITResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListAssignmentsForHITRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listAssignmentsForHITRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "MTurk");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListAssignmentsForHIT");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListAssignmentsForHITResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListAssignmentsForHITResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
1,368,203
public void created(CLabelPadding feedback) {<NEW_LINE>feedback.setText(MessageText.getString("statusbar.feedback"));<NEW_LINE>Listener feedback_listener = new Listener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void handleEvent(Event e) {<NEW_LINE>String url = "feedback.start?" + Utils.getWidgetBGColorURLParam() + "&fromWeb=false&os.name=" + UrlUtils.encode(Constants.OSName) + "&os.version=" + UrlUtils.encode(System.getProperty("os.version")) + "&java.version=" + <MASK><NEW_LINE>// Utils.launch( url );<NEW_LINE>UIFunctionsManagerSWT.getUIFunctionsSWT().viewURL(url, null, 600, 520, true, false);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>Utils.setTT(feedback, MessageText.getString("statusbar.feedback.tooltip"));<NEW_LINE>feedback.setCursor(display.getSystemCursor(SWT.CURSOR_HAND));<NEW_LINE>feedback.setForeground(display.getSystemColor(SWT.COLOR_LINK_FOREGROUND));<NEW_LINE>feedback.addListener(SWT.MouseUp, feedback_listener);<NEW_LINE>feedback.addListener(SWT.MouseDoubleClick, feedback_listener);<NEW_LINE>feedback.setVisible(true);<NEW_LINE>}
UrlUtils.encode(Constants.JAVA_VERSION);
257,330
public void execute(DelegateExecution execution) {<NEW_LINE>try {<NEW_LINE>boolean isSkipExpressionEnabled = SkipExpressionUtil.isSkipExpressionEnabled(execution, skipExpression);<NEW_LINE>if (!isSkipExpressionEnabled || (isSkipExpressionEnabled && !SkipExpressionUtil.shouldSkipFlowElement(execution, skipExpression))) {<NEW_LINE>if (Context.getProcessEngineConfiguration().isEnableProcessDefinitionInfoCache()) {<NEW_LINE>ObjectNode taskElementProperties = Context.getBpmnOverrideElementProperties(serviceTaskId, execution.getProcessDefinitionId());<NEW_LINE>if (taskElementProperties != null && taskElementProperties.has(DynamicBpmnConstants.SERVICE_TASK_DELEGATE_EXPRESSION)) {<NEW_LINE>String overrideExpression = taskElementProperties.get(DynamicBpmnConstants.SERVICE_TASK_DELEGATE_EXPRESSION).asText();<NEW_LINE>if (StringUtils.isNotEmpty(overrideExpression) && !overrideExpression.equals(expression.getExpressionText())) {<NEW_LINE>expression = Context.getProcessEngineConfiguration().getExpressionManager().createExpression(overrideExpression);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Object delegate = DelegateExpressionUtil.resolveDelegateExpression(expression, execution, fieldDeclarations);<NEW_LINE>if (delegate instanceof ActivityBehavior) {<NEW_LINE>if (delegate instanceof AbstractBpmnActivityBehavior) {<NEW_LINE>((AbstractBpmnActivityBehavior) delegate).setMultiInstanceActivityBehavior(getMultiInstanceActivityBehavior());<NEW_LINE>}<NEW_LINE>Context.getProcessEngineConfiguration().getDelegateInterceptor().handleInvocation(new ActivityBehaviorInvocation(<MASK><NEW_LINE>} else if (delegate instanceof JavaDelegate) {<NEW_LINE>Context.getProcessEngineConfiguration().getDelegateInterceptor().handleInvocation(new JavaDelegateInvocation((JavaDelegate) delegate, execution));<NEW_LINE>leave(execution);<NEW_LINE>} else {<NEW_LINE>throw new ActivitiIllegalArgumentException("Delegate expression " + expression + " did neither resolve to an implementation of " + ActivityBehavior.class + " nor " + JavaDelegate.class);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>leave(execution);<NEW_LINE>}<NEW_LINE>} catch (Exception exc) {<NEW_LINE>Throwable cause = exc;<NEW_LINE>BpmnError error = null;<NEW_LINE>while (cause != null) {<NEW_LINE>if (cause instanceof BpmnError) {<NEW_LINE>error = (BpmnError) cause;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>cause = cause.getCause();<NEW_LINE>}<NEW_LINE>if (error != null) {<NEW_LINE>ErrorPropagation.propagateError(error, execution);<NEW_LINE>} else {<NEW_LINE>throw new ActivitiException(exc.getMessage(), exc);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
(ActivityBehavior) delegate, execution));
488,280
final UpdateModelResult executeUpdateModel(UpdateModelRequest updateModelRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateModelRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateModelRequest> request = null;<NEW_LINE>Response<UpdateModelResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateModelRequestProtocolMarshaller(protocolFactory).marshall<MASK><NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "ApiGatewayV2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateModel");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateModelResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateModelResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
(super.beforeMarshalling(updateModelRequest));
779,020
private Hover sliceHover(CpuTrack.Data data, Fonts.TextMeasurer m, double x, int mods) {<NEW_LINE>mouseXpos = x;<NEW_LINE>long t = state.pxToTime(x);<NEW_LINE>for (int i = 0; i < data.starts.length; i++) {<NEW_LINE>if (data.starts[i] <= t && t <= data.ends[i]) {<NEW_LINE>hoveredThread = ThreadInfo.getDisplay(state, data.utids[i], true);<NEW_LINE>if (hoveredThread == null) {<NEW_LINE>return Hover.NONE;<NEW_LINE>}<NEW_LINE>hoveredWidth = Math.max(m.measure(Fonts.Style.Normal, hoveredThread.title).w, m.measure(Fonts.Style.Normal, hoveredThread.subTitle).w);<NEW_LINE>long id = data.ids[i];<NEW_LINE>long utid = data.utids[i];<NEW_LINE>return new Hover() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Area getRedraw() {<NEW_LINE>return new Area(x + HOVER_MARGIN, 0, hoveredWidth + 2 * HOVER_PADDING, HEIGHT);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void stop() {<NEW_LINE>hoveredThread = null;<NEW_LINE>mouseXpos = 0;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Cursor getCursor(Display display) {<NEW_LINE>return <MASK><NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean click() {<NEW_LINE>if ((mods & SWT.MOD1) == SWT.MOD1) {<NEW_LINE>state.addSelection(Selection.Kind.Cpu, track.getSlice(id));<NEW_LINE>state.addSelectedThread(state.getThreadInfo(utid));<NEW_LINE>} else {<NEW_LINE>state.setSelection(Selection.Kind.Cpu, track.getSlice(id));<NEW_LINE>state.setSelectedThread(state.getThreadInfo(utid));<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return Hover.NONE;<NEW_LINE>}
display.getSystemCursor(SWT.CURSOR_HAND);
528,831
private static Object v1(final Environment environment, final String prefix, final boolean handlePlaceholder) {<NEW_LINE>Class<?> resolverClass = Class.forName("org.springframework.boot.bind.RelaxedPropertyResolver");<NEW_LINE>Constructor<?> resolverConstructor = resolverClass.getDeclaredConstructor(PropertyResolver.class);<NEW_LINE>Method getSubPropertiesMethod = resolverClass.getDeclaredMethod("getSubProperties", String.class);<NEW_LINE>Object resolverObject = resolverConstructor.newInstance(environment);<NEW_LINE>String prefixParam = prefix.endsWith(".") ? prefix : prefix + ".";<NEW_LINE>Method getPropertyMethod = resolverClass.getDeclaredMethod("getProperty", String.class);<NEW_LINE>Map<String, Object> dataSourceProps = (Map<String, Object>) <MASK><NEW_LINE>Map<String, Object> result = new HashMap<>(dataSourceProps.size(), 1);<NEW_LINE>for (Entry<String, Object> entry : dataSourceProps.entrySet()) {<NEW_LINE>String key = entry.getKey();<NEW_LINE>Object value = entry.getValue();<NEW_LINE>if (handlePlaceholder && value instanceof String && ((String) value).contains(PlaceholderConfigurerSupport.DEFAULT_PLACEHOLDER_PREFIX)) {<NEW_LINE>String resolvedValue = (String) getPropertyMethod.invoke(resolverObject, prefixParam + key);<NEW_LINE>result.put(key, resolvedValue);<NEW_LINE>} else {<NEW_LINE>result.put(key, value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
getSubPropertiesMethod.invoke(resolverObject, prefixParam);
1,403,879
public void addTextRect(ObjectInfo[] objectstatus) {<NEW_LINE>point_lines_list.clear();<NEW_LINE>labels.clear();<NEW_LINE>if (objectstatus != null && objectstatus.length != 0) {<NEW_LINE>for (int i = 0; i < objectstatus.length; i++) {<NEW_LINE>float[] point_lines = new float[4 * 4];<NEW_LINE>point_lines[0] = objectstatus[i].key_points[0][0];<NEW_LINE>point_lines[1] = objectstatus[i].key_points[0][1];<NEW_LINE>point_lines[2] = objectstatus[i].key_points[1][0];<NEW_LINE>point_lines[3] = objectstatus[i].key_points[1][1];<NEW_LINE>point_lines[4] = objectstatus[i].key_points[1][0];<NEW_LINE>point_lines[5] = objectstatus[i].key_points[1][1];<NEW_LINE>point_lines[6] = objectstatus[i].key_points[2][0];<NEW_LINE>point_lines[7] = objectstatus[i].key_points[2][1];<NEW_LINE>point_lines[8] = objectstatus[i]<MASK><NEW_LINE>point_lines[9] = objectstatus[i].key_points[2][1];<NEW_LINE>point_lines[10] = objectstatus[i].key_points[3][0];<NEW_LINE>point_lines[11] = objectstatus[i].key_points[3][1];<NEW_LINE>point_lines[12] = objectstatus[i].key_points[3][0];<NEW_LINE>point_lines[13] = objectstatus[i].key_points[3][1];<NEW_LINE>point_lines[14] = objectstatus[i].key_points[0][0];<NEW_LINE>point_lines[15] = objectstatus[i].key_points[0][1];<NEW_LINE>point_lines_list.add(point_lines);<NEW_LINE>labels.add(String.format("%s", objectstatus[i].label));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>postInvalidate();<NEW_LINE>}
.key_points[2][0];
363,973
public boolean onOptionsItemSelected(MenuItem item) {<NEW_LINE>switch(item.getItemId()) {<NEW_LINE>case MENU_SEARCH:<NEW_LINE>mBottomBarControls.showSearch(true);<NEW_LINE>break;<NEW_LINE>case MENU_PLAYBACK:<NEW_LINE>openPlaybackActivity();<NEW_LINE>break;<NEW_LINE>case MENU_GO_HOME:<NEW_LINE>mPagerAdapter.setLimiter(FileSystemAdapter.buildHomeLimiter(getApplicationContext()));<NEW_LINE>updateLimiterViews();<NEW_LINE>break;<NEW_LINE>case MENU_SORT:<NEW_LINE>{<NEW_LINE>SortableAdapter adapter = (SortableAdapter) mCurrentAdapter;<NEW_LINE>LinearLayout list = (LinearLayout) getLayoutInflater().inflate(R.layout.sort_dialog, null);<NEW_LINE>CheckBox reverseSort = (CheckBox) list.findViewById(R.id.reverse_sort);<NEW_LINE>int[<MASK><NEW_LINE>String[] items = new String[itemIds.length];<NEW_LINE>Resources res = getResources();<NEW_LINE>for (int i = 0; i < itemIds.length; i++) {<NEW_LINE>items[i] = res.getString(itemIds[i]);<NEW_LINE>}<NEW_LINE>int mode = adapter.getSortModeIndex();<NEW_LINE>reverseSort.setChecked(adapter.isSortDescending());<NEW_LINE>AlertDialog.Builder builder = new AlertDialog.Builder(this);<NEW_LINE>builder.setTitle(R.string.sort_by);<NEW_LINE>builder.setSingleChoiceItems(items, mode, this);<NEW_LINE>builder.setPositiveButton(R.string.done, null);<NEW_LINE>AlertDialog dialog = builder.create();<NEW_LINE>dialog.getListView().addFooterView(list);<NEW_LINE>dialog.setOnDismissListener(this);<NEW_LINE>dialog.show();<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>default:<NEW_LINE>return super.onOptionsItemSelected(item);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
] itemIds = adapter.getSortEntries();
389,922
private void liftOverToTargetBuild(final Build37ExtendedIlluminaManifestRecord build37ExtendedIlluminaManifestRecord, final IlluminaManifestRecord illuminaManifestRecord) {<NEW_LINE>final String supportedBuildNumber = illuminaManifestRecord.getMajorGenomeBuild();<NEW_LINE>final File chainFileToTargetBuild = chainFilesMap.get(supportedBuildNumber);<NEW_LINE>final LiftOver liftOver = new LiftOver(chainFileToTargetBuild);<NEW_LINE>final Interval interval = new Interval(illuminaManifestRecord.getChr(), illuminaManifestRecord.getPosition(), illuminaManifestRecord.getPosition());<NEW_LINE>final Interval targetBuildInterval = liftOver.liftOver(interval);<NEW_LINE>if (targetBuildInterval != null) {<NEW_LINE>build37ExtendedIlluminaManifestRecord.b37Chr = targetBuildInterval.getContig();<NEW_LINE>build37ExtendedIlluminaManifestRecord.b37Pos = targetBuildInterval.getStart();<NEW_LINE>// Validate that the reference allele at the lifted over coordinates matches that of the original.<NEW_LINE>String originalRefAllele = getSequenceAt(referenceFilesMap.get(supportedBuildNumber), illuminaManifestRecord.getChr(), illuminaManifestRecord.getPosition(), illuminaManifestRecord.getPosition());<NEW_LINE>String newRefAllele = getSequenceAt(referenceFilesMap.get(targetBuild), build37ExtendedIlluminaManifestRecord.b37Chr, <MASK><NEW_LINE>if (originalRefAllele.equals(newRefAllele)) {<NEW_LINE>log.debug("Lifted over record " + build37ExtendedIlluminaManifestRecord);<NEW_LINE>log.debug(" From build " + supportedBuildNumber + " chr=" + illuminaManifestRecord.getChr() + ", position=" + illuminaManifestRecord.getPosition() + " To build " + targetBuild + " chr=" + build37ExtendedIlluminaManifestRecord.b37Chr + ", position=" + build37ExtendedIlluminaManifestRecord.b37Pos);<NEW_LINE>} else {<NEW_LINE>build37ExtendedIlluminaManifestRecord.flag = Build37ExtendedIlluminaManifestRecord.Flag.LIFTOVER_FAILED;<NEW_LINE>log.error("Liftover failed for record: " + build37ExtendedIlluminaManifestRecord);<NEW_LINE>log.error(" Sequence at lifted over position does not match that at original position");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>build37ExtendedIlluminaManifestRecord.flag = Build37ExtendedIlluminaManifestRecord.Flag.LIFTOVER_FAILED;<NEW_LINE>log.error("Liftover failed for record: " + build37ExtendedIlluminaManifestRecord);<NEW_LINE>}<NEW_LINE>}
build37ExtendedIlluminaManifestRecord.b37Pos, build37ExtendedIlluminaManifestRecord.b37Pos);
1,651,826
public void change(Database database, DatabaseSession databaseSession) throws NotImplementedException, BimserverDatabaseException {<NEW_LINE>EClass eClass = eReference.getEContainingClass();<NEW_LINE>KeyValueStore keyValueStore = database.getKeyValueStore();<NEW_LINE>for (EClass subClass : schema.getSubClasses(eClass)) {<NEW_LINE>try {<NEW_LINE>if (subClass.getEAnnotation("nodatabase") == null) {<NEW_LINE>RecordIterator recordIterator = keyValueStore.getRecordIterator(subClass.getEPackage().getName() + "_" + subClass.getName(), databaseSession);<NEW_LINE>try {<NEW_LINE>Record record = recordIterator.next();<NEW_LINE>while (record != null) {<NEW_LINE>ByteBuffer buffer = ByteBuffer.wrap(record.getValue());<NEW_LINE>int nrStartBytesBefore = (int) Math.ceil(nrFeaturesBefore / 8.0);<NEW_LINE>int newIndex = nrFeaturesBefore + 1;<NEW_LINE>int nrStartBytesAfter = (int) <MASK><NEW_LINE>byte[] unsetted = new byte[nrStartBytesAfter];<NEW_LINE>buffer.get(unsetted, 0, nrStartBytesBefore);<NEW_LINE>if (eReference.isUnsettable()) {<NEW_LINE>unsetted[newIndex / 8] |= (1 << (newIndex % 8));<NEW_LINE>}<NEW_LINE>int extra = 0;<NEW_LINE>if (!eReference.isUnsettable()) {<NEW_LINE>if (eReference.isMany()) {<NEW_LINE>extra = 4;<NEW_LINE>} else {<NEW_LINE>extra = 2;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ByteBuffer newBuffer = ByteBuffer.allocate(record.getValue().length + (nrStartBytesAfter - nrStartBytesBefore) + extra);<NEW_LINE>newBuffer.put(unsetted);<NEW_LINE>buffer.position(nrStartBytesBefore);<NEW_LINE>newBuffer.put(buffer);<NEW_LINE>if (!eReference.isUnsettable()) {<NEW_LINE>if (eReference.isMany()) {<NEW_LINE>newBuffer.putInt(0);<NEW_LINE>} else {<NEW_LINE>buffer.order(ByteOrder.LITTLE_ENDIAN);<NEW_LINE>newBuffer.putShort((short) -1);<NEW_LINE>buffer.order(ByteOrder.BIG_ENDIAN);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>keyValueStore.store(subClass.getEPackage().getName() + "_" + subClass.getName(), record.getKey(), newBuffer.array(), databaseSession);<NEW_LINE>record = recordIterator.next();<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>recordIterator.close();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (BimserverLockConflictException e) {<NEW_LINE>LOGGER.error("", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
Math.ceil(newIndex / 8.0);
1,846,768
@NoCache<NEW_LINE>@Consumes(MediaType.APPLICATION_JSON)<NEW_LINE>public Response addExecutionToFlow(@PathParam("flowAlias") String flowAlias, Map<String, String> data) {<NEW_LINE>auth.realm().requireManageRealm();<NEW_LINE>AuthenticationFlowModel parentFlow = realm.getFlowByAlias(flowAlias);<NEW_LINE>if (parentFlow == null) {<NEW_LINE>throw new BadRequestException("Parent flow doesn't exist");<NEW_LINE>}<NEW_LINE>if (parentFlow.isBuiltIn()) {<NEW_LINE>throw new BadRequestException("It is illegal to add execution to a built in flow");<NEW_LINE>}<NEW_LINE>String provider = data.get("provider");<NEW_LINE>// make sure provider is one of the registered providers<NEW_LINE>ProviderFactory f;<NEW_LINE>if (parentFlow.getProviderId().equals(AuthenticationFlow.CLIENT_FLOW)) {<NEW_LINE>f = session.getKeycloakSessionFactory().getProviderFactory(ClientAuthenticator.class, provider);<NEW_LINE>} else if (parentFlow.getProviderId().equals(AuthenticationFlow.FORM_FLOW)) {<NEW_LINE>f = session.getKeycloakSessionFactory().getProviderFactory(FormAction.class, provider);<NEW_LINE>} else {<NEW_LINE>f = session.getKeycloakSessionFactory().getProviderFactory(Authenticator.class, provider);<NEW_LINE>}<NEW_LINE>if (f == null) {<NEW_LINE>throw new BadRequestException("No authentication provider found for id: " + provider);<NEW_LINE>}<NEW_LINE>AuthenticationExecutionModel execution = new AuthenticationExecutionModel();<NEW_LINE>execution.setParentFlow(parentFlow.getId());<NEW_LINE>ConfigurableAuthenticatorFactory conf = (ConfigurableAuthenticatorFactory) f;<NEW_LINE>if (conf.getRequirementChoices().length == 1)<NEW_LINE>execution.setRequirement(conf.getRequirementChoices()[0]);<NEW_LINE>else<NEW_LINE>execution.setRequirement(AuthenticationExecutionModel.Requirement.DISABLED);<NEW_LINE>execution.setAuthenticatorFlow(false);<NEW_LINE>execution.setAuthenticator(provider);<NEW_LINE>execution.setPriority(getNextPriority(parentFlow));<NEW_LINE>execution = realm.addAuthenticatorExecution(execution);<NEW_LINE>data.put("id", execution.getId());<NEW_LINE>adminEvent.operation(OperationType.CREATE).resource(ResourceType.AUTH_EXECUTION).resourcePath(session.getContext().getUri()).representation(data).success();<NEW_LINE>String addExecutionPathSegment = UriBuilder.fromMethod(AuthenticationManagementResource.class, "addExecutionToFlow").build(parentFlow.getAlias()).getPath();<NEW_LINE>return Response.created(session.getContext().getUri().getBaseUriBuilder().path(session.getContext().getUri().getPath().replace(addExecutionPathSegment, "")).path("executions").path(execution.getId()).<MASK><NEW_LINE>}
build()).build();
870,973
private Map<String, String> extractAllAttributes(JsonNode productDetailsJson) {<NEW_LINE>Map<String, String> productAttrs = new HashMap<>();<NEW_LINE>productAttrs.put("sku", productDetailsJson.get("sku").textValue());<NEW_LINE>productAttrs.put("productFamily", productDetailsJson.get("productFamily") != null ? productDetailsJson.get("productFamily").textValue() : "");<NEW_LINE>// Iterate over all the attributes.<NEW_LINE>Iterator<String> iter = productDetailsJson.get("attributes").fieldNames();<NEW_LINE>while (iter.hasNext()) {<NEW_LINE>String key = iter.next();<NEW_LINE>productAttrs.put(key, productDetailsJson.get("attributes").get(key).textValue());<NEW_LINE>}<NEW_LINE>if (enableVerboseLogging) {<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>sb.append("Product: sku=").append(productDetailsJson.get("sku").textValue());<NEW_LINE>sb.append(", productFamily=").append(productDetailsJson.get("productFamily").textValue());<NEW_LINE>for (String key : productAttrs.keySet()) {<NEW_LINE>sb.append(", ").append(key).append("=").append<MASK><NEW_LINE>}<NEW_LINE>LOG.info(sb.toString());<NEW_LINE>}<NEW_LINE>return productAttrs;<NEW_LINE>}
(productAttrs.get(key));
1,005,545
public DataType toDataType() throws DuplicateNameException, IOException {<NEW_LINE>StructureDataType struct = new StructureDataType(NAME + "_" + cls_def_cnt + <MASK><NEW_LINE>struct.setCategoryPath(ObjectiveC1_Constants.CATEGORY_PATH);<NEW_LINE>struct.add(DWORD, "sel_ref_cnt", null);<NEW_LINE>struct.add(DWORD, "refs", null);<NEW_LINE>struct.add(WORD, "cls_def_cnt", null);<NEW_LINE>struct.add(WORD, "cat_def_cnt", null);<NEW_LINE>for (int i = 0; i < cls_def_cnt; ++i) {<NEW_LINE>struct.add(PointerDataType.getPointer(classes.get(i).toDataType(), _state.pointerSize), "class" + i, null);<NEW_LINE>}<NEW_LINE>for (int i = 0; i < cat_def_cnt; ++i) {<NEW_LINE>struct.add(PointerDataType.getPointer(categories.get(i).toDataType(), _state.pointerSize), "category" + i, null);<NEW_LINE>}<NEW_LINE>return struct;<NEW_LINE>}
"_" + cat_def_cnt + "_", 0);
64,278
public Path call() throws Exception {<NEW_LINE>final Path chunkPath = (chunk == 0) ? downloadTo : Paths.get(downloadTo + "_" + chunk + "_" + retryNum);<NEW_LINE>chunkPath.toFile().deleteOnExit();<NEW_LINE>final long startTime = System.currentTimeMillis();<NEW_LINE>final long byteRangeStart = chunk * chunkSize;<NEW_LINE>final long byteRangeEnd = Math.min((chunk + 1) * chunkSize - 1, length);<NEW_LINE>log.info("Downloading {} - chunk {} (retry {}) ({}-{}) to {}", s3Artifact.getFilename(), chunk, retryNum, byteRangeStart, byteRangeEnd, chunkPath);<NEW_LINE>GetObjectRequest getObjectRequest = new GetObjectRequest(s3Artifact.getS3Bucket(), s3Artifact.getS3ObjectKey()).withRange(byteRangeStart, byteRangeEnd);<NEW_LINE>S3Object fetchedObject = s3.getObject(getObjectRequest);<NEW_LINE>try (InputStream is = fetchedObject.getObjectContent()) {<NEW_LINE>Files.copy(is, chunkPath, StandardCopyOption.REPLACE_EXISTING);<NEW_LINE>}<NEW_LINE>log.info("Finished downloading chunk {} (retry {}) of {} ({} bytes) in {}", chunk, retryNum, s3Artifact.getFilename(), byteRangeEnd - byteRangeStart<MASK><NEW_LINE>return chunkPath;<NEW_LINE>}
, JavaUtils.duration(startTime));
1,306,016
public FormFrame startForm(final int AD_Form_ID) {<NEW_LINE>// metas: tsa: begin: US831: Open one window per session per user (2010101810000044)<NEW_LINE>final Properties ctx = Env.getCtx();<NEW_LINE>final I_AD_Form form = InterfaceWrapperHelper.create(ctx, AD_Form_ID, I_AD_Form.class, ITrx.TRXNAME_None);<NEW_LINE>if (form == null) {<NEW_LINE>ADialog.warn(0, null, "Error", msgBL.parseTranslation(ctx, "@NotFound@ @AD_Form_ID@"));<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>final WindowManager windowManager = getWindowManager();<NEW_LINE>// metas: tsa: end: US831: Open one window per session per user (2010101810000044)<NEW_LINE>if (// metas: tsa: us831<NEW_LINE>Ini.isPropertyBool(Ini.P_SINGLE_INSTANCE_PER_WINDOW) || form.isOneInstanceOnly()) {<NEW_LINE>final FormFrame <MASK><NEW_LINE>if (ffExisting != null) {<NEW_LINE>// metas: tsa: use this method because toFront() is not working when window is minimized<NEW_LINE>AEnv.showWindow(ffExisting);<NEW_LINE>// ff.toFront(); // metas: tsa: commented original code<NEW_LINE>return ffExisting;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final FormFrame ff = new FormFrame();<NEW_LINE>// metas: tsa: us831<NEW_LINE>final boolean ok = ff.openForm(form);<NEW_LINE>if (!ok) {<NEW_LINE>ff.dispose();<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>windowManager.add(ff);<NEW_LINE>// Center the window<NEW_LINE>ff.showFormWindow();<NEW_LINE>return ff;<NEW_LINE>}
ffExisting = windowManager.findForm(AD_Form_ID);
1,102,525
public GoPluginBundleDescriptor unloadPlugin(GoPluginBundleDescriptor bundleDescriptor) {<NEW_LINE>final GoPluginDescriptor firstPluginDescriptor = bundleDescriptor.descriptors().get(0);<NEW_LINE>final GoPluginDescriptor pluginInBundle = getPluginByIdOrFileName(firstPluginDescriptor.id(), firstPluginDescriptor.fileName());<NEW_LINE>if (pluginInBundle == null) {<NEW_LINE>throw new RuntimeException("Could not find existing plugin with ID: " + firstPluginDescriptor.id());<NEW_LINE>}<NEW_LINE>final GoPluginBundleDescriptor bundleToRemove = pluginInBundle.bundleDescriptor();<NEW_LINE>for (GoPluginDescriptor pluginDescriptor : bundleToRemove.descriptors()) {<NEW_LINE>if (getPluginByIdOrFileName(pluginDescriptor.id(), pluginDescriptor.fileName()) == null) {<NEW_LINE>throw new RuntimeException(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (GoPluginDescriptor pluginDescriptor : bundleToRemove.descriptors()) {<NEW_LINE>idToDescriptorMap.remove(pluginDescriptor.id().toLowerCase());<NEW_LINE>}<NEW_LINE>return bundleToRemove;<NEW_LINE>}
"Could not find existing plugin with ID: " + pluginDescriptor.id());
1,106,537
private void parseSubTitles(final Element e, final Metadata md) {<NEW_LINE>final List<Element> subTitleElements = e.getChildren("subTitle", getNS());<NEW_LINE>final SubTitle[] subtitles = new SubTitle[subTitleElements.size()];<NEW_LINE>for (int i = 0; i < subTitleElements.size(); i++) {<NEW_LINE>subtitles[i] = new SubTitle();<NEW_LINE>subtitles[i].setType(subTitleElements.get(<MASK><NEW_LINE>subtitles[i].setLang(subTitleElements.get(i).getAttributeValue("lang"));<NEW_LINE>if (subTitleElements.get(i).getAttributeValue("href") != null) {<NEW_LINE>try {<NEW_LINE>subtitles[i].setHref(new URL(subTitleElements.get(i).getAttributeValue("href")));<NEW_LINE>} catch (MalformedURLException ex) {<NEW_LINE>LOG.warn("Exception parsing subTitle href attribute.", ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>md.setSubTitles(subtitles);<NEW_LINE>}
i).getAttributeValue("type"));
1,721,612
private void parseRsa(String[] cliArgs) {<NEW_LINE>this.algorithm = Algorithm.rsa;<NEW_LINE>// /path/to/pkcs12keystore keystorePassphrase "<NEW_LINE>// + "publicCertAlias secretToEncrypt<NEW_LINE>if (cliArgs.length < 4) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (cliArgs.length == 4) {<NEW_LINE>secret = "";<NEW_LINE>} else {<NEW_LINE>secret = cliArgs[4];<NEW_LINE>}<NEW_LINE>Path keyPath = Paths.get(cliArgs[1]);<NEW_LINE>if (!Files.exists(keyPath) || !Files.isRegularFile(keyPath)) {<NEW_LINE>throw new ValidationException("For rsa encryption the second parameter must be a keystore path, " + "yet it is not accessible as a file: " + keyPath.toAbsolutePath());<NEW_LINE>}<NEW_LINE>String certAlias = cliArgs[3];<NEW_LINE>KeyConfig kc = KeyConfig.keystoreBuilder().keystore(Resource.create(keyPath)).keystorePassphrase(cliArgs[2].toCharArray()).certAlias(certAlias).build();<NEW_LINE>publicKey = kc.publicKey().orElseThrow(() -> new ValidationException("There is no public key available for cert alias: " + certAlias));<NEW_LINE>}
throw new ValidationException("RSA encryption must have at least three parameters: keystorePath, keystorePassword and alias of " + "certificate for public key");
23,704
private void updateState(List components) {<NEW_LINE>if ((components == null) || (components.size() < 1)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>FormModel formModel = ((RADComponent) components.get(0)).getFormModel();<NEW_LINE>LayoutModel layoutModel = formModel.getLayoutModel();<NEW_LINE>FormDesigner formDesigner = FormEditor.getFormDesigner(formModel);<NEW_LINE>LayoutDesigner layoutDesigner = formDesigner.getLayoutDesigner();<NEW_LINE>Iterator iter = components.iterator();<NEW_LINE>boolean[] matchAlignment = new boolean[4];<NEW_LINE>boolean[] cannotChangeTo = new boolean[4];<NEW_LINE>while (iter.hasNext()) {<NEW_LINE>RADComponent radC = <MASK><NEW_LINE>String id = radC.getId();<NEW_LINE>LayoutComponent comp = layoutModel.getLayoutComponent(id);<NEW_LINE>int[][] alignment = new int[][] { layoutDesigner.getAdjustableComponentAlignment(comp, LayoutConstants.HORIZONTAL), layoutDesigner.getAdjustableComponentAlignment(comp, LayoutConstants.VERTICAL) };<NEW_LINE>for (int i = 0; i < 4; i++) {<NEW_LINE>if ((alignment[i / 2][1] & (1 << i % 2)) == 0) {<NEW_LINE>// the alignment cannot be changed<NEW_LINE>cannotChangeTo[i] = true;<NEW_LINE>}<NEW_LINE>if (alignment[i / 2][0] != -1) {<NEW_LINE>matchAlignment[i] = matchAlignment[i] || (alignment[i / 2][0] == i % 2);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int i = 0; i < 4; i++) {<NEW_LINE>boolean match;<NEW_LINE>boolean miss;<NEW_LINE>match = matchAlignment[i];<NEW_LINE>miss = matchAlignment[2 * (i / 2) + 1 - i % 2];<NEW_LINE>items[i].setEnabled((match || miss) && (!cannotChangeTo[i]));<NEW_LINE>items[i].setSelected(!miss && match);<NEW_LINE>}<NEW_LINE>}
(RADComponent) iter.next();
1,532,789
public void track(T image) {<NEW_LINE>// configure the different regions based on size<NEW_LINE>region0.set(region);<NEW_LINE>region1.set(region);<NEW_LINE>region2.set(region);<NEW_LINE>region0.width *= 1 - scaleChange;<NEW_LINE>region0.height *= 1 - scaleChange;<NEW_LINE>region2.width *= 1 + scaleChange;<NEW_LINE>region2.height *= 1 + scaleChange;<NEW_LINE>// distance from histogram<NEW_LINE>double distance0 = 1, distance1, distance2 = 1;<NEW_LINE>// perform mean-shift at the different sizes and compute their distance<NEW_LINE>if (!constantScale) {<NEW_LINE>if (region0.width >= minimumWidth) {<NEW_LINE>updateLocation(image, region0);<NEW_LINE>distance0 = distanceHistogram(<MASK><NEW_LINE>if (updateHistogram)<NEW_LINE>System.arraycopy(calcHistogram.getHistogram(), 0, histogram0, 0, histogram0.length);<NEW_LINE>}<NEW_LINE>updateLocation(image, region2);<NEW_LINE>distance2 = distanceHistogram(keyHistogram, calcHistogram.getHistogram());<NEW_LINE>if (updateHistogram)<NEW_LINE>System.arraycopy(calcHistogram.getHistogram(), 0, histogram2, 0, histogram2.length);<NEW_LINE>}<NEW_LINE>// update the no scale change hypothesis<NEW_LINE>updateLocation(image, region1);<NEW_LINE>if (!constantScale) {<NEW_LINE>distance1 = distanceHistogram(keyHistogram, calcHistogram.getHistogram());<NEW_LINE>} else {<NEW_LINE>// force it to select<NEW_LINE>distance1 = 0;<NEW_LINE>}<NEW_LINE>if (updateHistogram)<NEW_LINE>System.arraycopy(calcHistogram.getHistogram(), 0, histogram1, 0, histogram1.length);<NEW_LINE>RectangleRotate_F32 selected;<NEW_LINE>float[] selectedHist;<NEW_LINE>switch(selectBest(distance0, distance1, distance2)) {<NEW_LINE>case 0 -><NEW_LINE>{<NEW_LINE>selected = region0;<NEW_LINE>selectedHist = histogram0;<NEW_LINE>}<NEW_LINE>case 1 -><NEW_LINE>{<NEW_LINE>selected = region1;<NEW_LINE>selectedHist = histogram1;<NEW_LINE>}<NEW_LINE>case 2 -><NEW_LINE>{<NEW_LINE>selected = region2;<NEW_LINE>selectedHist = histogram2;<NEW_LINE>}<NEW_LINE>default -><NEW_LINE>throw new RuntimeException("Bug in selectBest");<NEW_LINE>}<NEW_LINE>// Set region to the best scale, but reduce sensitivity by weighting it against the original size<NEW_LINE>// equation 14<NEW_LINE>float w = selected.width * (1 - gamma) + gamma * region.width;<NEW_LINE>float h = selected.height * (1 - gamma) + gamma * region.height;<NEW_LINE>region.set(selected);<NEW_LINE>region.width = w;<NEW_LINE>region.height = h;<NEW_LINE>if (updateHistogram) {<NEW_LINE>System.arraycopy(selectedHist, 0, keyHistogram, 0, keyHistogram.length);<NEW_LINE>}<NEW_LINE>}
keyHistogram, calcHistogram.getHistogram());
486,373
public int loadLibrary(String soName, int loadFlags, StrictMode.ThreadPolicy threadPolicy) throws IOException {<NEW_LINE>if (SoLoader.sSoFileLoader == null) {<NEW_LINE>throw new IllegalStateException("SoLoader.init() not yet called");<NEW_LINE>}<NEW_LINE>if (!mLibsInApk.contains(soName) || TextUtils.isEmpty(mDirectApkLdPath)) {<NEW_LINE>Log.d(SoLoader.TAG, soName + " not found on " + mDirectApkLdPath);<NEW_LINE>return LOAD_RESULT_NOT_FOUND;<NEW_LINE>}<NEW_LINE>loadDependencies(soName, loadFlags, threadPolicy);<NEW_LINE>try {<NEW_LINE>loadFlags |= SoLoader.SOLOADER_LOOK_IN_ZIP;<NEW_LINE>SoLoader.sSoFileLoader.load(mDirectApkLdPath + File.separator + soName, loadFlags);<NEW_LINE>} catch (UnsatisfiedLinkError e) {<NEW_LINE>Log.w(SoLoader.TAG, soName + " not found on DirectAPKSoSource: " + loadFlags, e);<NEW_LINE>return LOAD_RESULT_NOT_FOUND;<NEW_LINE>}<NEW_LINE>Log.d(SoLoader.<MASK><NEW_LINE>return LOAD_RESULT_LOADED;<NEW_LINE>}
TAG, soName + " found on DirectAPKSoSource: " + loadFlags);
1,809,752
protected byte[] engineWrap(Key key) throws IllegalBlockSizeException, InvalidKeyException {<NEW_LINE>byte[] encoded = key.getEncoded();<NEW_LINE>if (encoded == null) {<NEW_LINE>throw new InvalidKeyException("Cannot wrap key, null encoding.");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>SecretWithEncapsulation secEnc = kemGen.generateEncapsulated(wrapKey.getKeyParams());<NEW_LINE>Wrapper kWrap = WrapUtil.getWrapper(kemParameterSpec.getKeyAlgorithmName());<NEW_LINE>KeyParameter keyParameter = new KeyParameter(secEnc.getSecret());<NEW_LINE>kWrap.init(true, keyParameter);<NEW_LINE>byte[] encapsulation = secEnc.getEncapsulation();<NEW_LINE>secEnc.destroy();<NEW_LINE>byte[] keyToWrap = key.getEncoded();<NEW_LINE>byte[] rv = Arrays.concatenate(encapsulation, kWrap.wrap(keyToWrap<MASK><NEW_LINE>Arrays.clear(keyToWrap);<NEW_LINE>return rv;<NEW_LINE>} catch (IllegalArgumentException e) {<NEW_LINE>throw new IllegalBlockSizeException("unable to generate KTS secret: " + e.getMessage());<NEW_LINE>} catch (DestroyFailedException e) {<NEW_LINE>throw new IllegalBlockSizeException("unable to destroy interim values: " + e.getMessage());<NEW_LINE>}<NEW_LINE>}
, 0, keyToWrap.length));
1,474,200
public Dialog onCreateDialog(Bundle savedInstanceState) {<NEW_LINE>final SiteModel site = (SiteModel) getArguments(<MASK><NEW_LINE>AlertDialog.Builder builder = new MaterialAlertDialogBuilder(getActivity());<NEW_LINE>builder.setTitle(R.string.role);<NEW_LINE>builder.setNegativeButton(R.string.cancel, null);<NEW_LINE>builder.setPositiveButton(android.R.string.ok, (dialog, which) -> {<NEW_LINE>String role = mRoleListAdapter.getSelectedRole();<NEW_LINE>Bundle args = getArguments();<NEW_LINE>if (args != null) {<NEW_LINE>long personID = args.getLong(PERSON_ID_TAG);<NEW_LINE>if (site != null) {<NEW_LINE>EventBus.getDefault().post(new RoleChangeEvent(personID, site.getId(), role));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>if (mRoleListAdapter == null && site != null) {<NEW_LINE>List<RoleModel> roleList = mSiteStore.getUserRoles(site);<NEW_LINE>RoleModel[] userRoles = roleList.toArray(new RoleModel[roleList.size()]);<NEW_LINE>mRoleListAdapter = new RoleListAdapter(getActivity(), R.layout.role_list_row, userRoles);<NEW_LINE>}<NEW_LINE>if (savedInstanceState != null) {<NEW_LINE>String savedRole = savedInstanceState.getString(ROLE_TAG);<NEW_LINE>mRoleListAdapter.setSelectedRole(savedRole);<NEW_LINE>} else {<NEW_LINE>Bundle args = getArguments();<NEW_LINE>if (args != null) {<NEW_LINE>String role = args.getString(ROLE_TAG);<NEW_LINE>mRoleListAdapter.setSelectedRole(role);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>builder.setAdapter(mRoleListAdapter, null);<NEW_LINE>return builder.create();<NEW_LINE>}
).getSerializable(WordPress.SITE);
1,673,822
public static Type createType(Class<?> clazz, List<AnnotationElement> dynamicAnnotations, List<ValueDescriptor> dynamicFields) {<NEW_LINE>if (Thread.class == clazz) {<NEW_LINE>return Type.THREAD;<NEW_LINE>}<NEW_LINE>if (Class.class.isAssignableFrom(clazz)) {<NEW_LINE>return Type.CLASS;<NEW_LINE>}<NEW_LINE>if (String.class.equals(clazz)) {<NEW_LINE>return Type.STRING;<NEW_LINE>}<NEW_LINE>if (isDefined(clazz)) {<NEW_LINE>return getType(clazz);<NEW_LINE>}<NEW_LINE>if (clazz.isPrimitive()) {<NEW_LINE>return defineType(clazz, null, false);<NEW_LINE>}<NEW_LINE>if (clazz.isArray()) {<NEW_LINE>throw new InternalError("Arrays not supported");<NEW_LINE>}<NEW_LINE>// STRUCT<NEW_LINE>String superType = null;<NEW_LINE>boolean eventType = false;<NEW_LINE>if (Event.class.isAssignableFrom(clazz)) {<NEW_LINE>superType = Type.SUPER_TYPE_EVENT;<NEW_LINE>eventType = true;<NEW_LINE>}<NEW_LINE>if (Control.class.isAssignableFrom(clazz)) {<NEW_LINE>superType = Type.SUPER_TYPE_SETTING;<NEW_LINE>}<NEW_LINE>// forward declare to avoid infinite recursion<NEW_LINE><MASK><NEW_LINE>Type type = getType(clazz);<NEW_LINE>if (eventType) {<NEW_LINE>addImplicitFields(type, true, true, true, true, false);<NEW_LINE>addUserFields(clazz, type, dynamicFields);<NEW_LINE>type.trimFields();<NEW_LINE>}<NEW_LINE>addAnnotations(clazz, type, dynamicAnnotations);<NEW_LINE>if (clazz.getClassLoader() == null) {<NEW_LINE>type.log("Added", LogTag.JFR_SYSTEM_METADATA, LogLevel.INFO);<NEW_LINE>} else {<NEW_LINE>type.log("Added", LogTag.JFR_METADATA, LogLevel.INFO);<NEW_LINE>}<NEW_LINE>return type;<NEW_LINE>}
defineType(clazz, superType, eventType);
1,854,472
public void marshall(StartDocumentClassificationJobRequest startDocumentClassificationJobRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (startDocumentClassificationJobRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(startDocumentClassificationJobRequest.getDocumentClassifierArn(), DOCUMENTCLASSIFIERARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(startDocumentClassificationJobRequest.getInputDataConfig(), INPUTDATACONFIG_BINDING);<NEW_LINE>protocolMarshaller.marshall(startDocumentClassificationJobRequest.getOutputDataConfig(), OUTPUTDATACONFIG_BINDING);<NEW_LINE>protocolMarshaller.marshall(startDocumentClassificationJobRequest.getDataAccessRoleArn(), DATAACCESSROLEARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(startDocumentClassificationJobRequest.getClientRequestToken(), CLIENTREQUESTTOKEN_BINDING);<NEW_LINE>protocolMarshaller.marshall(startDocumentClassificationJobRequest.getVolumeKmsKeyId(), VOLUMEKMSKEYID_BINDING);<NEW_LINE>protocolMarshaller.marshall(startDocumentClassificationJobRequest.getVpcConfig(), VPCCONFIG_BINDING);<NEW_LINE>protocolMarshaller.marshall(startDocumentClassificationJobRequest.getTags(), TAGS_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
startDocumentClassificationJobRequest.getJobName(), JOBNAME_BINDING);
929,694
public static List<RegressionExecution> executions() {<NEW_LINE>List<RegressionExecution> execs = new ArrayList<>();<NEW_LINE>execs.add(new EPLOtherNullPrimitive());<NEW_LINE>execs.add(new EPLOtherChainedInstance());<NEW_LINE>execs.add(new EPLOtherChainedStatic());<NEW_LINE>execs.add(new EPLOtherEscape());<NEW_LINE>execs.add(new EPLOtherReturnsMapIndexProperty());<NEW_LINE>execs.add(new EPLOtherPattern());<NEW_LINE>execs.add(new EPLOtherRuntimeException());<NEW_LINE>execs.add(new EPLOtherArrayParameter());<NEW_LINE>execs.add(new EPLOtherNoParameters());<NEW_LINE>execs.add(new EPLOtherPerfConstantParameters());<NEW_LINE>execs.add(new EPLOtherPerfConstantParametersNested());<NEW_LINE>execs.add(new EPLOtherSingleParameterOM());<NEW_LINE>execs.add(new EPLOtherSingleParameterCompile());<NEW_LINE>execs.add(new EPLOtherSingleParameter());<NEW_LINE>execs.add(new EPLOtherTwoParameters());<NEW_LINE>execs.add(new EPLOtherUserDefined());<NEW_LINE>execs.add(new EPLOtherComplexParameters());<NEW_LINE>execs.add(new EPLOtherMultipleMethodInvocations());<NEW_LINE>execs.add(new EPLOtherOtherClauses());<NEW_LINE>execs.add(new EPLOtherNestedFunction());<NEW_LINE>execs.add(new EPLOtherPassthru());<NEW_LINE>execs<MASK><NEW_LINE>execs.add(new EPLOtherStaticFuncWCurrentTimeStamp());<NEW_LINE>execs.add(new EPLOtherStaticFuncEnumConstant());<NEW_LINE>return execs;<NEW_LINE>}
.add(new EPLOtherPrimitiveConversion());
1,696,431
private Registration register(Path key, Registration value) {<NEW_LINE>if (value == null) {<NEW_LINE>LOG.debug("Starting to watch path {}", key);<NEW_LINE>try {<NEW_LINE>WatchEvent.Modifier[] mods;<NEW_LINE>try {<NEW_LINE>mods = new WatchEvent.Modifier[] { com.sun.nio.file.SensitivityWatchEventModifier.HIGH };<NEW_LINE>} catch (Throwable t) {<NEW_LINE>mods = null;<NEW_LINE>}<NEW_LINE>final WatchKey watchKey = key.register(watchService, new WatchEvent.Kind[] { StandardWatchEventKinds.ENTRY_DELETE, StandardWatchEventKinds.ENTRY_MODIFY }, mods);<NEW_LINE>return new Registration(watchKey);<NEW_LINE>} catch (NoSuchFileException e) {<NEW_LINE>// we allow this exception in case of a missing reactor artifact<NEW_LINE>return null;<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>int cnt <MASK><NEW_LINE>LOG.debug("Already {} watchers for path {}", cnt, key);<NEW_LINE>return value;<NEW_LINE>}<NEW_LINE>}
= value.count.incrementAndGet();
722,230
final ListEntitiesDetectionV2JobsResult executeListEntitiesDetectionV2Jobs(ListEntitiesDetectionV2JobsRequest listEntitiesDetectionV2JobsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listEntitiesDetectionV2JobsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListEntitiesDetectionV2JobsRequest> request = null;<NEW_LINE>Response<ListEntitiesDetectionV2JobsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListEntitiesDetectionV2JobsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listEntitiesDetectionV2JobsRequest));<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.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListEntitiesDetectionV2Jobs");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListEntitiesDetectionV2JobsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListEntitiesDetectionV2JobsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.SERVICE_ID, "ComprehendMedical");
316,844
public void layoutContainer(Container parent) {<NEW_LINE>int maxWidth = 0;<NEW_LINE>for (JLabel label : labelMap.values()) {<NEW_LINE>int labelPrefWidth = label.getPreferredSize().width;<NEW_LINE>if (labelPrefWidth > maxWidth) {<NEW_LINE>maxWidth = labelPrefWidth;<NEW_LINE>}<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>int curY = 0;<NEW_LINE>int curX = 0;<NEW_LINE>int maxY = parent.getHeight();<NEW_LINE>int maxCompWidth = parent.getWidth() - maxWidth - insets.left - insets.right - GUTTER_WIDTH;<NEW_LINE>curY = insets.top;<NEW_LINE>curX = insets.left;<NEW_LINE>maxY = maxY - insets.bottom;<NEW_LINE>for (Component c : compList) {<NEW_LINE>if (!(c instanceof PreferencesPanel)) {<NEW_LINE>JLabel label = labelMap.get(c);<NEW_LINE>if (label != null) {<NEW_LINE>Dimension labelPrefSize = label.getPreferredSize();<NEW_LINE>label.setSize(labelPrefSize);<NEW_LINE>label.setLocation(curX + maxWidth - labelPrefSize.width, curY + 2);<NEW_LINE>}<NEW_LINE>Dimension prefCompSize = c.getPreferredSize();<NEW_LINE>c.setSize(prefCompSize.width < maxCompWidth ? prefCompSize.width : maxCompWidth, prefCompSize.height);<NEW_LINE>c.setLocation(curX + maxWidth + GUTTER_WIDTH, curY);<NEW_LINE>curY = curY + prefCompSize.height + ROW_MARGIN;<NEW_LINE>} else {<NEW_LINE>c.setLocation(curX, curY);<NEW_LINE>Dimension prefSize = c.getPreferredSize();<NEW_LINE>c.setSize(parent.getWidth(), prefSize.height);<NEW_LINE>curY = curY + prefSize.height + ROW_MARGIN;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
Insets insets = parent.getInsets();
1,289,556
public RejectedLogEventsInfo unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>RejectedLogEventsInfo rejectedLogEventsInfo = new RejectedLogEventsInfo();<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("tooNewLogEventStartIndex", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>rejectedLogEventsInfo.setTooNewLogEventStartIndex(context.getUnmarshaller(Integer.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("tooOldLogEventEndIndex", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>rejectedLogEventsInfo.setTooOldLogEventEndIndex(context.getUnmarshaller(Integer.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("expiredLogEventEndIndex", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>rejectedLogEventsInfo.setExpiredLogEventEndIndex(context.getUnmarshaller(Integer.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 rejectedLogEventsInfo;<NEW_LINE>}
class).unmarshall(context));
1,556,052
private void payer(Payer payer) throws IOException {<NEW_LINE>// Id,NAME,ADDRESS,CITY,STATE_HEADQUARTERED,ZIP,PHONE,AMOUNT_COVERED,AMOUNT_UNCOVERED,REVENUE,<NEW_LINE>// COVERED_ENCOUNTERS,UNCOVERED_ENCOUNTERS,COVERED_MEDICATIONS,UNCOVERED_MEDICATIONS,<NEW_LINE>// COVERED_PROCEDURES,UNCOVERED_PROCEDURES,COVERED_IMMUNIZATIONS,UNCOVERED_IMMUNIZATIONS,<NEW_LINE>// UNIQUE_CUSTOMERS,QOLS_AVG,MEMBER_MONTHS<NEW_LINE>StringBuilder s = new StringBuilder();<NEW_LINE>// UUID<NEW_LINE>s.append(payer.getResourceID()).append(',');<NEW_LINE>// NAME<NEW_LINE>s.append(payer.getName()).append(',');<NEW_LINE>// Second Class Attributes<NEW_LINE>for (String attribute : new String[] { "address", "city", "state_headquartered", "zip", "phone" }) {<NEW_LINE>String value = (String) payer.getAttributes().getOrDefault(attribute, "");<NEW_LINE>s.append(clean(value)).append(',');<NEW_LINE>}<NEW_LINE>// AMOUNT_COVERED<NEW_LINE>s.append(String.format(Locale.US, "%.2f", payer.getAmountCovered())).append(',');<NEW_LINE>// AMOUNT_UNCOVERED<NEW_LINE>s.append(String.format(Locale.US, "%.2f", payer.getAmountUncovered())).append(',');<NEW_LINE>// REVENUE<NEW_LINE>s.append(String.format(Locale.US, "%.2f", payer.getRevenue())).append(',');<NEW_LINE>// Covered/Uncovered Encounters/Medications/Procedures/Immunizations<NEW_LINE>s.append(payer.getEncountersCoveredCount()).append(",");<NEW_LINE>s.append(payer.getEncountersUncoveredCount()).append(",");<NEW_LINE>s.append(payer.getMedicationsCoveredCount<MASK><NEW_LINE>s.append(payer.getMedicationsUncoveredCount()).append(",");<NEW_LINE>s.append(payer.getProceduresCoveredCount()).append(",");<NEW_LINE>s.append(payer.getProceduresUncoveredCount()).append(",");<NEW_LINE>s.append(payer.getImmunizationsCoveredCount()).append(",");<NEW_LINE>s.append(payer.getImmunizationsUncoveredCount()).append(",");<NEW_LINE>// UNIQUE CUSTOMERS<NEW_LINE>s.append(payer.getUniqueCustomers()).append(",");<NEW_LINE>// QOLS_AVG<NEW_LINE>s.append(payer.getQolsAverage()).append(",");<NEW_LINE>// MEMBER_MONTHS (Note that this converts the number of years covered to months)<NEW_LINE>s.append(payer.getNumYearsCovered() * 12);<NEW_LINE>s.append(NEWLINE);<NEW_LINE>write(s.toString(), payers);<NEW_LINE>}
()).append(",");
963,819
final AssociateRouteTableResult executeAssociateRouteTable(AssociateRouteTableRequest associateRouteTableRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(associateRouteTableRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<AssociateRouteTableRequest> request = null;<NEW_LINE>Response<AssociateRouteTableResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new AssociateRouteTableRequestMarshaller().marshall(super.beforeMarshalling(associateRouteTableRequest));<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.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AssociateRouteTable");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<AssociateRouteTableResult> responseHandler = new StaxResponseHandler<AssociateRouteTableResult>(new AssociateRouteTableResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
1,136,986
/* Entry point for resolve type validators */<NEW_LINE>private ParameterTypeValidator resolveTypeValidator(Parameter parameter) {<NEW_LINE>ParameterTypeValidator candidate = resolveAnyOfOneOfTypeValidator(parameter);<NEW_LINE>if (candidate != null)<NEW_LINE>return candidate;<NEW_LINE>else if (OpenApi3Utils.isParameterArrayType(parameter)) {<NEW_LINE>ArraySchema arraySchema = (ArraySchema) parameter.getSchema();<NEW_LINE>return ArrayTypeValidator.ArrayTypeValidatorFactory.createArrayTypeValidator(this.resolveInnerSchemaPrimitiveTypeValidator(arraySchema.getItems(), true), OpenApi3Utils.resolveStyle(parameter), safeBoolean.apply(parameter.getExplode()), parameter.getSchema().getMaxItems(), parameter.getSchema().getMinItems());<NEW_LINE>} else if (OpenApi3Utils.isParameterObjectOrAllOfType(parameter)) {<NEW_LINE>ObjectTypeValidator objectTypeValidator = ObjectTypeValidator.ObjectTypeValidatorFactory.createObjectTypeValidator(OpenApi3Utils.resolveStyle(parameter), safeBoolean.apply(parameter.getExplode()));<NEW_LINE>resolveObjectTypeFields(<MASK><NEW_LINE>return objectTypeValidator;<NEW_LINE>}<NEW_LINE>return this.resolveInnerSchemaPrimitiveTypeValidator(parameter.getSchema(), true);<NEW_LINE>}
objectTypeValidator, parameter.getSchema());
701,258
private void checkForLinkHeader(final HttpUrl url) {<NEW_LINE>Log.d(Config.LOGTAG, "checking for link header on " + url);<NEW_LINE>this.call = HttpConnectionManager.OK_HTTP_CLIENT.newCall(new Request.Builder().url(url).head().build());<NEW_LINE>this.call.enqueue(new Callback() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onFailure(@NotNull Call call, @NotNull IOException e) {<NEW_LINE>Log.d(Config.LOGTAG, "unable to check HTTP url", e);<NEW_LINE>showError(R.string.no_xmpp_adddress_found);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onResponse(@NotNull Call call, @NotNull Response response) {<NEW_LINE>if (response.isSuccessful()) {<NEW_LINE>final String <MASK><NEW_LINE>if (linkHeader != null && processLinkHeader(linkHeader)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>showError(R.string.no_xmpp_adddress_found);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
linkHeader = response.header("Link");
1,323,367
private IUserRolePermissions retrieveUserRolePermissions(@NonNull final UserRolePermissionsKey key) {<NEW_LINE>final RoleId adRoleId = key.getRoleId();<NEW_LINE>final <MASK><NEW_LINE>final ClientId adClientId = key.getClientId();<NEW_LINE>final LocalDate date = key.getDate();<NEW_LINE>try {<NEW_LINE>final IRolesTreeNode rootRole = roleDAO.retrieveRolesTree(adRoleId, adUserId, date);<NEW_LINE>return rootRole.aggregateBottomUp(new IRolesTreeNode.BottomUpAggregator<UserRolePermissions, UserRolePermissionsBuilder>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public UserRolePermissionsBuilder initialValue(final IRolesTreeNode node) {<NEW_LINE>final UserRolePermissions permissions = getIndividualUserRolePermissions(node.getRoleId(), adUserId, adClientId);<NEW_LINE>return UserRolePermissionsBuilder.of(UserRolePermissionsDAO.this, permissions);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void aggregateValue(final UserRolePermissionsBuilder aggregatedValue, final IRolesTreeNode childNode, final UserRolePermissions value) {<NEW_LINE>aggregatedValue.includeUserRolePermissions(value, childNode.getSeqNo());<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public UserRolePermissions finalValue(final UserRolePermissionsBuilder aggregatedValue) {<NEW_LINE>return aggregatedValue.build();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public UserRolePermissions leafValue(final IRolesTreeNode node) {<NEW_LINE>return getIndividualUserRolePermissions(node.getRoleId(), adUserId, adClientId);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (final Exception e) {<NEW_LINE>throw new RolePermissionsNotFoundException("@AD_Role_ID@=" + adRoleId + ", @AD_User_ID@=" + adUserId + ", @AD_Client_ID@=" + adClientId + ", @Date@=" + date, e);<NEW_LINE>}<NEW_LINE>}
UserId adUserId = key.getUserId();
214,550
public void init(final ExtensionConfig config, WebSocketComponents components) {<NEW_LINE>configRequested = new ExtensionConfig(config);<NEW_LINE>Map<String, String> <MASK><NEW_LINE>for (String key : config.getParameterKeys()) {<NEW_LINE>key = key.trim();<NEW_LINE>switch(key) {<NEW_LINE>case "client_max_window_bits":<NEW_LINE>case "server_max_window_bits":<NEW_LINE>{<NEW_LINE>// Not supported by Jetty<NEW_LINE>// Don't negotiate these parameters<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case "client_no_context_takeover":<NEW_LINE>{<NEW_LINE>paramsNegotiated.put("client_no_context_takeover", null);<NEW_LINE>incomingContextTakeover = false;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case "server_no_context_takeover":<NEW_LINE>{<NEW_LINE>paramsNegotiated.put("server_no_context_takeover", null);<NEW_LINE>outgoingContextTakeover = false;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case "@deflate_buffer_size":<NEW_LINE>{<NEW_LINE>deflateBufferSize = config.getParameter(key, DEFAULT_BUF_SIZE);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case "@inflate_buffer_size":<NEW_LINE>{<NEW_LINE>inflateBufferSize = config.getParameter(key, DEFAULT_BUF_SIZE);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>default:<NEW_LINE>{<NEW_LINE>throw new IllegalArgumentException();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>configNegotiated = new ExtensionConfig(config.getName(), paramsNegotiated);<NEW_LINE>LOG.debug("config: outgoingContextTakover={}, incomingContextTakeover={} : {}", outgoingContextTakeover, incomingContextTakeover, this);<NEW_LINE>super.init(configNegotiated, components);<NEW_LINE>}
paramsNegotiated = new HashMap<>();
1,109,734
private void showCert(byte[] data) throws CryptoException {<NEW_LINE>X509Certificate[] certs = null;<NEW_LINE>try {<NEW_LINE>certs = X509CertUtil.loadCertificates(data);<NEW_LINE>if (certs.length == 0) {<NEW_LINE>JOptionPane.showMessageDialog(frame, res.getString("ExamineClipboardAction.NoCertsFound.message"), res.getString<MASK><NEW_LINE>}<NEW_LINE>} catch (Exception ex) {<NEW_LINE>String problemStr = res.getString("ExamineClipboardAction.NoOpenCert.Problem");<NEW_LINE>String[] causes = new String[] { res.getString("ExamineClipboardAction.NotCert.Cause"), res.getString("ExamineClipboardAction.CorruptedCert.Cause") };<NEW_LINE>Problem problem = new Problem(problemStr, causes, ex);<NEW_LINE>DProblem dProblem = new DProblem(frame, res.getString("ExamineClipboardAction.ProblemOpeningCert.Title"), problem);<NEW_LINE>dProblem.setLocationRelativeTo(frame);<NEW_LINE>dProblem.setVisible(true);<NEW_LINE>}<NEW_LINE>if (certs != null && certs.length > 0) {<NEW_LINE>DViewCertificate dViewCertificate = new DViewCertificate(frame, res.getString("ExamineClipboardAction.CertDetails.Title"), certs, kseFrame, DViewCertificate.IMPORT_EXPORT);<NEW_LINE>dViewCertificate.setLocationRelativeTo(frame);<NEW_LINE>dViewCertificate.setVisible(true);<NEW_LINE>}<NEW_LINE>}
("ExamineClipboardAction.OpenCertificate.Title"), JOptionPane.WARNING_MESSAGE);
125,124
protected void do_proc_termination(EObject exit_reason) throws Pausable {<NEW_LINE>// Precondition: pstate is DONE, exit-action mutator count is zero.<NEW_LINE>this.exit_reason = exit_reason;<NEW_LINE>H me = self_handle();<NEW_LINE>EAtom name = me.name;<NEW_LINE>for (EHandle handle : linksref.get()) {<NEW_LINE>try {<NEW_LINE>handle.exit_signal(me, exit_reason, false);<NEW_LINE>} catch (Error e) {<NEW_LINE>log.severe("EXCEPTION IN EXIT HANDLER");<NEW_LINE>log.log(<MASK><NEW_LINE>throw e;<NEW_LINE>} catch (RuntimeException e) {<NEW_LINE>log.severe("EXCEPTION IN EXIT HANDLER");<NEW_LINE>log.log(Level.FINE, "details: ", e);<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (Map.Entry<ERef, EHandle> ent : monitors.entrySet()) {<NEW_LINE>EHandle pid = ent.getValue();<NEW_LINE>ERef ref = ent.getKey();<NEW_LINE>pid.send_monitor_exit((EHandle) me, ref, exit_reason);<NEW_LINE>}<NEW_LINE>if (name != ERT.am_undefined && name != null) {<NEW_LINE>ERT.unregister(name);<NEW_LINE>}<NEW_LINE>}
Level.FINE, "details: ", e);
1,790,215
final UpdateObjectAttributesResult executeUpdateObjectAttributes(UpdateObjectAttributesRequest updateObjectAttributesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateObjectAttributesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateObjectAttributesRequest> request = null;<NEW_LINE>Response<UpdateObjectAttributesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateObjectAttributesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateObjectAttributesRequest));<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, "CloudDirectory");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateObjectAttributes");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateObjectAttributesResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateObjectAttributesResultJsonUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
invoke(request, responseHandler, executionContext);
1,650,562
private void addFileToConfigFileManager(final Set<ConfigFileGroup> selectedGroups, final File file) throws IOException {<NEW_LINE>final ConfigFileManager manager = getConfigFileManager(Templates.getProject(wizard));<NEW_LINE>try {<NEW_LINE>manager.mutex().writeAccess(new ExceptionAction<Void>() {<NEW_LINE><NEW_LINE>public Void run() throws IOException {<NEW_LINE>List<File> origFiles = manager.getConfigFiles();<NEW_LINE>List<File> newFiles = new ArrayList<File>(origFiles);<NEW_LINE>if (!newFiles.contains(file)) {<NEW_LINE>newFiles.add(file);<NEW_LINE>}<NEW_LINE>List<ConfigFileGroup> origGroups = manager.getConfigFileGroups();<NEW_LINE>List<ConfigFileGroup> newGroups = null;<NEW_LINE>if (selectedGroups.size() > 0) {<NEW_LINE>newGroups = new ArrayList<ConfigFileGroup>(origGroups.size());<NEW_LINE>for (ConfigFileGroup group : origGroups) {<NEW_LINE>if (selectedGroups.contains(group)) {<NEW_LINE>ConfigFileGroup newGroup = addFileToConfigGroup(group, file);<NEW_LINE>newGroups.add(newGroup);<NEW_LINE>} else {<NEW_LINE>newGroups.add(group);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>newGroups = origGroups;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>manager.save();<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (MutexException e) {<NEW_LINE>throw (IOException) e.getException();<NEW_LINE>}<NEW_LINE>}
manager.putConfigFilesAndGroups(newFiles, newGroups);
1,548,766
void checkVersion(Project project, String tool, Pattern versionRegex, int... minVersion) {<NEW_LINE>ByteArrayOutputStream pipe = new ByteArrayOutputStream();<NEW_LINE>project.exec(spec -> {<NEW_LINE>spec.setCommandLine(tool, "--version");<NEW_LINE>spec.setStandardOutput(pipe);<NEW_LINE>});<NEW_LINE>String output = pipe.toString(<MASK><NEW_LINE>Matcher matcher = versionRegex.matcher(output);<NEW_LINE>if (matcher.find() == false) {<NEW_LINE>throw new IllegalStateException(tool + " version output [" + output + "] did not match regex [" + versionRegex.pattern() + "]");<NEW_LINE>}<NEW_LINE>String version = matcher.group(1);<NEW_LINE>List<Integer> versionParts = Stream.of(version.split("\\.")).map(Integer::parseInt).collect(Collectors.toList());<NEW_LINE>for (int i = 0; i < minVersion.length; ++i) {<NEW_LINE>int found = versionParts.get(i);<NEW_LINE>if (found > minVersion[i]) {<NEW_LINE>// most significant version is good<NEW_LINE>break;<NEW_LINE>} else if (found < minVersion[i]) {<NEW_LINE>final String exceptionMessage = String.format(Locale.ROOT, "Unsupported version of %s. Found [%s], expected [%s+]", tool, version, Stream.of(minVersion).map(String::valueOf).collect(Collectors.joining(".")));<NEW_LINE>throw new IllegalStateException(exceptionMessage);<NEW_LINE>}<NEW_LINE>// else equal, so check next element<NEW_LINE>}<NEW_LINE>}
StandardCharsets.UTF_8).trim();
1,047,084
public <T> Boolean notStartsWith(BoundReference<T> ref, Literal<T> lit) {<NEW_LINE>Integer id = ref.fieldId();<NEW_LINE>if (mayContainNull(id)) {<NEW_LINE>return ROWS_MIGHT_MATCH;<NEW_LINE>}<NEW_LINE>ByteBuffer prefixAsBytes = lit.toByteBuffer();<NEW_LINE>Comparator<ByteBuffer<MASK><NEW_LINE>// notStartsWith will match unless all values must start with the prefix. This happens when the lower and upper<NEW_LINE>// bounds both start with the prefix.<NEW_LINE>if (lowerBounds != null && upperBounds != null && lowerBounds.containsKey(id) && upperBounds.containsKey(id)) {<NEW_LINE>ByteBuffer lower = lowerBounds.get(id);<NEW_LINE>// if lower is shorter than the prefix then lower doesn't start with the prefix<NEW_LINE>if (lower.remaining() < prefixAsBytes.remaining()) {<NEW_LINE>return ROWS_MIGHT_MATCH;<NEW_LINE>}<NEW_LINE>int cmp = comparator.compare(BinaryUtil.truncateBinary(lower, prefixAsBytes.remaining()), prefixAsBytes);<NEW_LINE>if (cmp == 0) {<NEW_LINE>ByteBuffer upper = upperBounds.get(id);<NEW_LINE>// if upper is shorter than the prefix then upper can't start with the prefix<NEW_LINE>if (upper.remaining() < prefixAsBytes.remaining()) {<NEW_LINE>return ROWS_MIGHT_MATCH;<NEW_LINE>}<NEW_LINE>cmp = comparator.compare(BinaryUtil.truncateBinary(upper, prefixAsBytes.remaining()), prefixAsBytes);<NEW_LINE>if (cmp == 0) {<NEW_LINE>// both bounds match the prefix, so all rows must match the prefix and therefore do not satisfy<NEW_LINE>// the predicate<NEW_LINE>return ROWS_CANNOT_MATCH;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return ROWS_MIGHT_MATCH;<NEW_LINE>}
> comparator = Comparators.unsignedBytes();
1,442,701
public void valueChanged(ListSelectionEvent e) {<NEW_LINE>if (!e.getValueIsAdjusting()) {<NEW_LINE>Object selectedObject = panel.lstPatches.getSelectedValue();<NEW_LINE>Queue selectedQueue = selectedObject instanceof Queue ? <MASK><NEW_LINE>okButton.setEnabled(true);<NEW_LINE>if (selectedQueue != null && selectedQueue.isActive() && onTopPatch == null) {<NEW_LINE>// NOI18N<NEW_LINE>setInfo(NbBundle.getMessage(GoToPatch.class, "PatchSeriesPanel.lblInfo.noAppliedPatches"));<NEW_LINE>okButton.setEnabled(false);<NEW_LINE>} else if (selectedObject instanceof QPatch && onTopPatch == selectedObject) {<NEW_LINE>// NOI18N<NEW_LINE>setInfo(NbBundle.getMessage(GoToPatch.class, "PatchSeriesPanel.lblInfo.alreadyOnTop"));<NEW_LINE>okButton.setEnabled(false);<NEW_LINE>} else if (selectedObject == null || selectedObject == SEP) {<NEW_LINE>okButton.setEnabled(false);<NEW_LINE>setInfo(null);<NEW_LINE>} else {<NEW_LINE>setInfo(null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
((Queue) selectedObject) : null;
413,068
private static Map<Long, ECPublicKey> parsePublicKeysJson() throws GeneralSecurityException, IOException, JSONException {<NEW_LINE>URL url = new URL(REWARD_VERIFIER_KEYS_URL);<NEW_LINE>HttpURLConnection connection = (HttpURLConnection) url.openConnection();<NEW_LINE>connection.setRequestMethod("GET");<NEW_LINE>BufferedReader reader = new BufferedReader(new InputStreamReader<MASK><NEW_LINE>String inputLine;<NEW_LINE>StringBuffer content = new StringBuffer();<NEW_LINE>while ((inputLine = reader.readLine()) != null) {<NEW_LINE>content.append(inputLine);<NEW_LINE>}<NEW_LINE>reader.close();<NEW_LINE>connection.disconnect();<NEW_LINE>String publicKeysJson = content.toString();<NEW_LINE>JSONArray keys = new JSONObject(publicKeysJson).getJSONArray("keys");<NEW_LINE>Map<Long, ECPublicKey> publicKeys = new HashMap<>();<NEW_LINE>for (int i = 0; i < keys.length(); i++) {<NEW_LINE>JSONObject key = keys.getJSONObject(i);<NEW_LINE>publicKeys.put(key.getLong("keyId"), EllipticCurves.getEcPublicKey(Base64.decode(key.getString("base64"))));<NEW_LINE>}<NEW_LINE>if (publicKeys.isEmpty()) {<NEW_LINE>throw new GeneralSecurityException("No trusted keys are available for this protocol version");<NEW_LINE>}<NEW_LINE>return publicKeys;<NEW_LINE>}
(connection.getInputStream()));
484,908
public NestedVersionTwo decode(ProtoReader reader) throws IOException {<NEW_LINE>Builder builder = new Builder();<NEW_LINE><MASK><NEW_LINE>for (int tag; (tag = reader.nextTag()) != -1; ) {<NEW_LINE>switch(tag) {<NEW_LINE>case 1:<NEW_LINE>builder.i(ProtoAdapter.INT32.decode(reader));<NEW_LINE>break;<NEW_LINE>case 2:<NEW_LINE>builder.v2_i(ProtoAdapter.INT32.decode(reader));<NEW_LINE>break;<NEW_LINE>case 3:<NEW_LINE>builder.v2_s(ProtoAdapter.STRING.decode(reader));<NEW_LINE>break;<NEW_LINE>case 4:<NEW_LINE>builder.v2_f32(ProtoAdapter.FIXED32.decode(reader));<NEW_LINE>break;<NEW_LINE>case 5:<NEW_LINE>builder.v2_f64(ProtoAdapter.FIXED64.decode(reader));<NEW_LINE>break;<NEW_LINE>case 6:<NEW_LINE>builder.v2_rs.add(ProtoAdapter.STRING.decode(reader));<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>{<NEW_LINE>reader.readUnknownField(tag);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>builder.addUnknownFields(reader.endMessageAndGetUnknownFields(token));<NEW_LINE>return builder.build();<NEW_LINE>}
long token = reader.beginMessage();
308,616
public boolean isDemonym(Mention m, Dictionaries dict) {<NEW_LINE>String thisCasedString = this.spanToString();<NEW_LINE><MASK><NEW_LINE>// The US state matching part (only) is done cased<NEW_LINE>String thisNormed = dict.lookupCanonicalAmericanStateName(thisCasedString);<NEW_LINE>String antNormed = dict.lookupCanonicalAmericanStateName(antCasedString);<NEW_LINE>if (thisNormed != null && thisNormed.equals(antNormed)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>// The rest is done uncased<NEW_LINE>String thisString = thisCasedString.toLowerCase(Locale.ENGLISH);<NEW_LINE>String antString = antCasedString.toLowerCase(Locale.ENGLISH);<NEW_LINE>if (thisString.startsWith("the ")) {<NEW_LINE>thisString = thisString.substring(4);<NEW_LINE>}<NEW_LINE>if (antString.startsWith("the ")) {<NEW_LINE>antString = antString.substring(4);<NEW_LINE>}<NEW_LINE>Set<String> thisDemonyms = dict.getDemonyms(thisString);<NEW_LINE>Set<String> antDemonyms = dict.getDemonyms(antString);<NEW_LINE>if (thisDemonyms.contains(antString) || antDemonyms.contains(thisString)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
String antCasedString = m.spanToString();
1,368,029
protected void computeIndentations() {<NEW_LINE>if (fCanvas == null || fCanvas.isDisposed())<NEW_LINE>return;<NEW_LINE>GC gc = new GC(fCanvas);<NEW_LINE>try {<NEW_LINE>gc.setFont(fCanvas.getFont());<NEW_LINE>fIndentation = new int[fCachedNumberOfDigits + 1];<NEW_LINE>char[] nines = new char[fCachedNumberOfDigits];<NEW_LINE><MASK><NEW_LINE>String nineString = new String(nines);<NEW_LINE>Point p = gc.stringExtent(nineString);<NEW_LINE>fIndentation[0] = p.x;<NEW_LINE>for (int i = 1; i <= fCachedNumberOfDigits; i++) {<NEW_LINE>p = gc.stringExtent(nineString.substring(0, i));<NEW_LINE>fIndentation[i] = fIndentation[0] - p.x;<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>gc.dispose();<NEW_LINE>}<NEW_LINE>}
Arrays.fill(nines, '9');
1,714,450
public synchronized void unbindAll(Object bindingDataObject) {<NEW_LINE>BindingData bindingData = (BindingData) bindingDataObject;<NEW_LINE>NamingContext context = bindingData.contexts[<MASK><NEW_LINE>if (context != null) {<NEW_LINE>for (String name : bindingData.bindingNames) {<NEW_LINE>unbind(context, name);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// For contextNames, if completely empty of bindings, unbind the naming context from its parent context.<NEW_LINE>for (int i = bindingData.contextNames.length - 1; i >= 0; i--) {<NEW_LINE>Boolean contextEmpty = isBindingContextEmpty(bindingData.contexts[i]);<NEW_LINE>if (contextEmpty == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (contextEmpty == false) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>NamingContext parentContext = i == 0 ? rootNamingContext : bindingData.contexts[i - 1];<NEW_LINE>unbind(parentContext, bindingData.contextNames[i]);<NEW_LINE>}<NEW_LINE>}
bindingData.contexts.length - 1];
1,180,506
public void marshall(APNSVoipChannelResponse aPNSVoipChannelResponse, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (aPNSVoipChannelResponse == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(aPNSVoipChannelResponse.getApplicationId(), APPLICATIONID_BINDING);<NEW_LINE>protocolMarshaller.marshall(aPNSVoipChannelResponse.getCreationDate(), CREATIONDATE_BINDING);<NEW_LINE>protocolMarshaller.marshall(aPNSVoipChannelResponse.getDefaultAuthenticationMethod(), DEFAULTAUTHENTICATIONMETHOD_BINDING);<NEW_LINE>protocolMarshaller.marshall(aPNSVoipChannelResponse.getEnabled(), ENABLED_BINDING);<NEW_LINE>protocolMarshaller.marshall(aPNSVoipChannelResponse.getHasCredential(), HASCREDENTIAL_BINDING);<NEW_LINE>protocolMarshaller.marshall(aPNSVoipChannelResponse.getHasTokenKey(), HASTOKENKEY_BINDING);<NEW_LINE>protocolMarshaller.marshall(aPNSVoipChannelResponse.getId(), ID_BINDING);<NEW_LINE>protocolMarshaller.marshall(aPNSVoipChannelResponse.getIsArchived(), ISARCHIVED_BINDING);<NEW_LINE>protocolMarshaller.marshall(aPNSVoipChannelResponse.getLastModifiedBy(), LASTMODIFIEDBY_BINDING);<NEW_LINE>protocolMarshaller.marshall(aPNSVoipChannelResponse.getLastModifiedDate(), LASTMODIFIEDDATE_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(aPNSVoipChannelResponse.getVersion(), VERSION_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
aPNSVoipChannelResponse.getPlatform(), PLATFORM_BINDING);
976,145
private void showRemoteTimeseries(PartitionGroup group, ShowTimeSeriesPlan plan, QueryContext context, ShowTimeSeriesHandler handler) {<NEW_LINE>ByteBuffer resultBinary = null;<NEW_LINE>for (Node node : group) {<NEW_LINE>try {<NEW_LINE>resultBinary = showRemoteTimeseries(context, node, group, plan);<NEW_LINE>if (resultBinary != null) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} catch (IOException | TException e) {<NEW_LINE>logger.error(LOG_FAIL_CONNECT, node, e);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>logger.error("Interrupted when getting timeseries schemas in node {}.", node, e);<NEW_LINE>Thread.currentThread().interrupt();<NEW_LINE>} finally {<NEW_LINE>// record the queried node to release resources later<NEW_LINE>((RemoteQueryContext) context).registerRemoteNode(node, group.getHeader());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (resultBinary != null) {<NEW_LINE><MASK><NEW_LINE>List<ShowTimeSeriesResult> results = new ArrayList<>();<NEW_LINE>logger.debug("Fetched remote timeseries {} schemas of {} from {}", size, plan.getPath(), group);<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>results.add(ShowTimeSeriesResult.deserialize(resultBinary));<NEW_LINE>}<NEW_LINE>handler.onComplete(results);<NEW_LINE>} else {<NEW_LINE>String errMsg = String.format("Failed to get timeseries in path %s from group %s", plan.getPath(), group);<NEW_LINE>handler.onError(new MetadataException(errMsg));<NEW_LINE>}<NEW_LINE>}
int size = resultBinary.getInt();
323,452
public static LimitOrder adaptOrder(BithumbOrder order) {<NEW_LINE>final CurrencyPair currencyPair = adaptCurrencyPair(order.getOrderCurrency(<MASK><NEW_LINE>final Order.OrderType orderType = adaptOrderType(order.getType());<NEW_LINE>Order.OrderStatus status = Order.OrderStatus.UNKNOWN;<NEW_LINE>if (order.getUnitsRemaining().compareTo(order.getUnits()) == 0) {<NEW_LINE>status = Order.OrderStatus.NEW;<NEW_LINE>} else if (order.getUnitsRemaining().compareTo(BigDecimal.ZERO) == 0) {<NEW_LINE>status = Order.OrderStatus.FILLED;<NEW_LINE>} else {<NEW_LINE>status = Order.OrderStatus.PARTIALLY_FILLED;<NEW_LINE>}<NEW_LINE>return new LimitOrder.Builder(orderType, currencyPair).id(String.valueOf(order.getOrderId())).limitPrice(order.getPrice()).originalAmount(order.getUnits()).remainingAmount(order.getUnitsRemaining()).orderStatus(status).timestamp(new Date(order.getOrderDate() / 1000L)).build();<NEW_LINE>}
), order.getPaymentCurrency());
1,544,630
private static void writeFragments(final List<? extends PsiFragment> psiFragments, Element duplicateElement, Project project, final boolean shouldWriteOffsets) {<NEW_LINE>final PathMacroManager macroManager = PathMacroManager.getInstance(project);<NEW_LINE>final PsiDocumentManager documentManager = PsiDocumentManager.getInstance(project);<NEW_LINE>for (PsiFragment fragment : psiFragments) {<NEW_LINE>final PsiFile psiFile = fragment.getFile();<NEW_LINE>final VirtualFile virtualFile = psiFile != null ? psiFile.getVirtualFile() : null;<NEW_LINE>if (virtualFile != null) {<NEW_LINE>Element fragmentElement = new Element("fragment");<NEW_LINE>fragmentElement.setAttribute("file", macroManager.collapsePath(virtualFile.getUrl()));<NEW_LINE>if (shouldWriteOffsets) {<NEW_LINE>final Document document = documentManager.getDocument(psiFile);<NEW_LINE>LOG.assertTrue(document != null);<NEW_LINE>int startOffset = fragment.getStartOffset();<NEW_LINE>final int line = document.getLineNumber(startOffset);<NEW_LINE>fragmentElement.setAttribute("line", String.valueOf(line));<NEW_LINE>final int <MASK><NEW_LINE>if (StringUtil.isEmptyOrSpaces(document.getText().substring(lineStartOffset, startOffset))) {<NEW_LINE>startOffset = lineStartOffset;<NEW_LINE>}<NEW_LINE>fragmentElement.setAttribute("start", String.valueOf(startOffset));<NEW_LINE>fragmentElement.setAttribute("end", String.valueOf(fragment.getEndOffset()));<NEW_LINE>if (fragment.containsMultipleFragments()) {<NEW_LINE>final int[][] offsets = fragment.getOffsets();<NEW_LINE>for (int[] offset : offsets) {<NEW_LINE>Element offsetElement = new Element("offset");<NEW_LINE>offsetElement.setAttribute("start", String.valueOf(offset[0]));<NEW_LINE>offsetElement.setAttribute("end", String.valueOf(offset[1]));<NEW_LINE>fragmentElement.addContent(offsetElement);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>duplicateElement.addContent(fragmentElement);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
lineStartOffset = document.getLineStartOffset(line);
1,817,730
final CreateBatchImportJobResult executeCreateBatchImportJob(CreateBatchImportJobRequest createBatchImportJobRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createBatchImportJobRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<CreateBatchImportJobRequest> request = null;<NEW_LINE>Response<CreateBatchImportJobResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateBatchImportJobRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createBatchImportJobRequest));<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, "FraudDetector");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateBatchImportJob");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateBatchImportJobResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateBatchImportJobResultJsonUnmarshaller());<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);
706,023
public static List<Trie> calculateReceiptsTrieRootFor(Block block, ReceiptStore receiptStore, Keccak256 txHash) throws BlockHashesHelperException {<NEW_LINE>Keccak256 bhash = block.getHash();<NEW_LINE>List<Transaction> transactions = block.getTransactionsList();<NEW_LINE>List<TransactionReceipt> receipts = new ArrayList<>();<NEW_LINE>int ntxs = transactions.size();<NEW_LINE>int ntx = -1;<NEW_LINE>for (int k = 0; k < ntxs; k++) {<NEW_LINE>Transaction transaction = transactions.get(k);<NEW_LINE><MASK><NEW_LINE>Optional<TransactionInfo> txInfoOpt = receiptStore.get(txh.getBytes(), bhash.getBytes());<NEW_LINE>if (!txInfoOpt.isPresent()) {<NEW_LINE>throw new BlockHashesHelperException(String.format("Missing receipt for transaction %s in block %s", txh, bhash));<NEW_LINE>}<NEW_LINE>TransactionInfo txInfo = txInfoOpt.get();<NEW_LINE>receipts.add(txInfo.getReceipt());<NEW_LINE>if (txh.equals(txHash)) {<NEW_LINE>ntx = k;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (ntx == -1) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Trie trie = calculateReceiptsTrieRootFor(receipts);<NEW_LINE>List<Trie> nodes = trie.getNodes(RLP.encodeInt(ntx));<NEW_LINE>return nodes;<NEW_LINE>}
Keccak256 txh = transaction.getHash();
1,229,881
private double tenativeUpdate(final Vec[] columnMajor, final int j, final double w_j, final double[] y, final double[] r, final double lambda, final double s, final double[] delta) {<NEW_LINE>double numer = 0, denom = 0;<NEW_LINE>if (columnMajor != null) {<NEW_LINE>Vec col_j = columnMajor[j];<NEW_LINE>if (col_j.nnz() == 0)<NEW_LINE>return 0;<NEW_LINE>for (IndexValue iv : col_j) {<NEW_LINE>final double x_ij = iv.getValue();<NEW_LINE>final int i = iv.getIndex();<NEW_LINE>numer += x_ij * y[i] / (1 + <MASK><NEW_LINE>denom += x_ij * x_ij * F(r[i], delta[j] * abs(x_ij));<NEW_LINE>if (prior == Prior.LAPLACE)<NEW_LINE>numer -= lambda * s;<NEW_LINE>else {<NEW_LINE>numer -= w_j / lambda;<NEW_LINE>denom += 1 / lambda;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else<NEW_LINE>// bias term, all x_ij = 1<NEW_LINE>for (int i = 0; i < y.length; i++) {<NEW_LINE>numer += y[i] / (1 + exp(r[i])) - lambda * s;<NEW_LINE>denom += F(r[i], delta[j]);<NEW_LINE>}<NEW_LINE>return numer / denom;<NEW_LINE>}
exp(r[i]));