idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
1,503,479
public static void main(String[] args) {<NEW_LINE>Adempiere.startup(true);<NEW_LINE>Ini.setProperty(Ini.P_UID, "SuperUser");<NEW_LINE>Ini.setProperty(Ini.P_PWD, "System");<NEW_LINE>Ini.setProperty(Ini.P_ROLE, "GardenWorld Admin");<NEW_LINE>Ini.setProperty(Ini.P_CLIENT, "GardenWorld");<NEW_LINE>Ini.setProperty(Ini.P_ORG, "HQ");<NEW_LINE>Ini.setProperty(Ini.P_WAREHOUSE, "HQ Warehouse");<NEW_LINE>Ini.setProperty(Ini.P_LANGUAGE, "English");<NEW_LINE>// Ini.setProperty(Ini.P_PRINTER,"MyPrinter");<NEW_LINE>Login login = new Login(Env.getCtx());<NEW_LINE>login.batchLogin();<NEW_LINE>MWMInOutBoundLine line = new MWMInOutBoundLine(Env.getCtx(), 1000006, null);<NEW_LINE><MASK><NEW_LINE>MWMInOutBound order = line.getParent();<NEW_LINE>engine.getLocator(line, 0, 0);<NEW_LINE>}
WMRuleEngine engine = WMRuleEngine.get();
1,681,325
private void loadNode1200() throws IOException, SAXException {<NEW_LINE>DataTypeDescriptionTypeNode node = new DataTypeDescriptionTypeNode(this.context, Identifiers.OpcUa_XmlSchema_AxisInformation, new QualifiedName(0, "AxisInformation"), new LocalizedText("en", "AxisInformation"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), new DataValue(Variant.NULL_VALUE), Identifiers.String, -1, new UInteger[] {}, UByte.valueOf(1), UByte.valueOf(1), 0.0, false);<NEW_LINE>node.addReference(new Reference(Identifiers.OpcUa_XmlSchema_AxisInformation, Identifiers.HasTypeDefinition, Identifiers.DataTypeDescriptionType.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.OpcUa_XmlSchema_AxisInformation, Identifiers.HasComponent, Identifiers.OpcUa_XmlSchema.expanded(), false));<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>sb.append("<String xmlns=\"http://opcfoundation.org/UA/2008/02/Types.xsd\">//xs:element[@name='AxisInformation']</String>");<NEW_LINE>String xml = sb.toString();<NEW_LINE>OpcUaXmlStreamDecoder decoder = new OpcUaXmlStreamDecoder(context.getServer().getSerializationContext()).setInput(new StringReader(xml));<NEW_LINE>Object o = decoder.readVariantValue();<NEW_LINE>DataValue value = new <MASK><NEW_LINE>node.setValue(value);<NEW_LINE>this.nodeManager.addNode(node);<NEW_LINE>}
DataValue(new Variant(o));
1,390,037
static BitSet buildReachableBytecodesMask(byte[] code) {<NEW_LINE>NavigableSet<Integer> gotos = new TreeSet<>();<NEW_LINE><MASK><NEW_LINE>BitSet ret = new BitSet(code.length);<NEW_LINE>int lastPush = 0;<NEW_LINE>int lastPushPC = 0;<NEW_LINE>do {<NEW_LINE>// reachable bytecode<NEW_LINE>ret.set(it.getPC());<NEW_LINE>if (it.isPush()) {<NEW_LINE>lastPush = new BigInteger(1, it.getCurOpcodeArg()).intValue();<NEW_LINE>lastPushPC = it.getPC();<NEW_LINE>}<NEW_LINE>if (it.getCurOpcode() == OpCode.JUMP || it.getCurOpcode() == OpCode.JUMPI) {<NEW_LINE>if (it.getPC() != lastPushPC + 1) {<NEW_LINE>// some PC arithmetic we totally can't deal with<NEW_LINE>// assuming all bytecodes are reachable as a fallback<NEW_LINE>ret.set(0, code.length);<NEW_LINE>return ret;<NEW_LINE>}<NEW_LINE>int jumpPC = lastPush;<NEW_LINE>if (!ret.get(jumpPC)) {<NEW_LINE>// code was not explored yet<NEW_LINE>gotos.add(jumpPC);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (it.getCurOpcode() == OpCode.JUMP || it.getCurOpcode() == OpCode.RETURN || it.getCurOpcode() == OpCode.STOP) {<NEW_LINE>if (gotos.isEmpty())<NEW_LINE>break;<NEW_LINE>it.setPC(gotos.pollFirst());<NEW_LINE>}<NEW_LINE>} while (it.next());<NEW_LINE>return ret;<NEW_LINE>}
ByteCodeIterator it = new ByteCodeIterator(code);
1,382,656
public static void passiveADPAgentDemo() {<NEW_LINE>System.out.println("=======================");<NEW_LINE>System.out.println("DEMO: Passive-ADP-Agent");<NEW_LINE>System.out.println("=======================");<NEW_LINE>System.out.println("Figure 21.3");<NEW_LINE>System.out.println("-----------");<NEW_LINE>CellWorld<Double> cw = CellWorldFactory.createCellWorldForFig17_1();<NEW_LINE>CellWorldEnvironment cwe = new CellWorldEnvironment(cw.getCellAt(1, 1), cw.getCells(), MDPFactory.createTransitionProbabilityFunctionForFigure17_1(cw), new JavaRandomizer());<NEW_LINE>Map<Cell<Double>, CellWorldAction> fixedPolicy = new HashMap<>();<NEW_LINE>fixedPolicy.put(cw.getCellAt(1<MASK><NEW_LINE>fixedPolicy.put(cw.getCellAt(1, 2), CellWorldAction.Up);<NEW_LINE>fixedPolicy.put(cw.getCellAt(1, 3), CellWorldAction.Right);<NEW_LINE>fixedPolicy.put(cw.getCellAt(2, 1), CellWorldAction.Left);<NEW_LINE>fixedPolicy.put(cw.getCellAt(2, 3), CellWorldAction.Right);<NEW_LINE>fixedPolicy.put(cw.getCellAt(3, 1), CellWorldAction.Left);<NEW_LINE>fixedPolicy.put(cw.getCellAt(3, 2), CellWorldAction.Up);<NEW_LINE>fixedPolicy.put(cw.getCellAt(3, 3), CellWorldAction.Right);<NEW_LINE>fixedPolicy.put(cw.getCellAt(4, 1), CellWorldAction.Left);<NEW_LINE>PassiveADPAgent<Cell<Double>, CellWorldAction> padpa = new PassiveADPAgent<>(fixedPolicy, cw.getCells(), cw.getCellAt(1, 1), MDPFactory.createActionsFunctionForFigure17_1(cw), new ModifiedPolicyEvaluation<>(10, 1.0));<NEW_LINE>cwe.addAgent(padpa);<NEW_LINE>output_utility_learning_rates(padpa, 20, 100, 100, 1);<NEW_LINE>System.out.println("=========================");<NEW_LINE>}
, 1), CellWorldAction.Up);
678,988
private Runnable createCopyWatchTask(final ImageWatcher watcher, final String assemblyName, final MojoParameters mojoParameters, final String containerBaseDir) throws MojoExecutionException {<NEW_LINE>final ImageConfiguration imageConfig = watcher.getImageConfiguration();<NEW_LINE>final AssemblyFiles files = archiveService.<MASK><NEW_LINE>return new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>List<AssemblyFiles.Entry> entries = files.getUpdatedEntriesAndRefresh();<NEW_LINE>if (entries != null && entries.size() > 0) {<NEW_LINE>try {<NEW_LINE>log.info("%s: Assembly %s changed. Copying changed files to container ...", imageConfig.getDescription(), assemblyName);<NEW_LINE>File changedFilesArchive = archiveService.createChangedFilesArchive(entries, files.getAssemblyDirectory(), imageConfig.getName(), mojoParameters);<NEW_LINE>dockerAccess.copyArchiveToContainer(watcher.getContainerId(), changedFilesArchive, containerBaseDir);<NEW_LINE>callPostExec(watcher);<NEW_LINE>} catch (MojoExecutionException | IOException | ExecException e) {<NEW_LINE>log.error("%s: Error when copying files to container %s: %s", imageConfig.getDescription(), watcher.getContainerId(), e.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
getAssemblyFiles(imageConfig, assemblyName, mojoParameters);
154,802
private static void addField(servletProperties prop, int c, SchemaDeclaration field) {<NEW_LINE>prop.put("fields_" + c + "_solrname", field.getSolrFieldName());<NEW_LINE>prop.put("fields_" + c + "_type", field.getType().printName());<NEW_LINE>prop.put("fields_" + c + <MASK><NEW_LINE>prop.put("fields_" + c + "_indexedChecked", field.isIndexed() ? 1 : 0);<NEW_LINE>prop.put("fields_" + c + "_storedChecked", field.isStored() ? 1 : 0);<NEW_LINE>prop.put("fields_" + c + "_multiValuedChecked", field.isMultiValued() ? 1 : 0);<NEW_LINE>prop.put("fields_" + c + "_omitNormsChecked", field.isOmitNorms() ? 1 : 0);<NEW_LINE>prop.put("fields_" + c + "_docValueChecked", field.isDocValue() ? 1 : 0);<NEW_LINE>}
"_comment", field.getComment());
1,627,026
protected void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>setContentView(R.layout.mobicom_multi_attachment_activity);<NEW_LINE>String jsonString = FileUtils.loadSettingsJsonFile(getApplicationContext());<NEW_LINE>if (!TextUtils.isEmpty(jsonString)) {<NEW_LINE>alCustomizationSettings = (AlCustomizationSettings) GsonUtils.getObjectFromJson(jsonString, AlCustomizationSettings.class);<NEW_LINE>} else {<NEW_LINE>alCustomizationSettings = new AlCustomizationSettings();<NEW_LINE>}<NEW_LINE>restrictedWords = FileUtils.loadRestrictedWordsFile(this);<NEW_LINE>choosenOption = getFilterOptions();<NEW_LINE>fileClientService = new FileClientService(this);<NEW_LINE>userPreferences = MobiComUserPreference.getInstance(this);<NEW_LINE>Intent intent = getIntent();<NEW_LINE>if (intent.getExtras() != null) {<NEW_LINE>userID = intent.getExtras().getString(USER_ID);<NEW_LINE>displayName = intent.getExtras().getString(DISPLAY_NAME);<NEW_LINE>groupID = intent.getExtras().getInt(GROUP_ID, 0);<NEW_LINE>groupName = intent.getExtras().getString(GROUP_NAME);<NEW_LINE>imageUri = (Uri) intent.getParcelableExtra(URI_LIST);<NEW_LINE>if (imageUri != null) {<NEW_LINE>attachmentFileList.add(imageUri);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>initViews();<NEW_LINE>setUpGridView();<NEW_LINE>fileClientService = new FileClientService(this);<NEW_LINE>if (imageUri == null) {<NEW_LINE>Intent getContentIntent = FileUtils.createGetContentIntent(getFilterOptions(), getPackageManager());<NEW_LINE>getContentIntent.<MASK><NEW_LINE>startActivityForResult(getContentIntent, REQUEST_CODE_ATTACH_PHOTO);<NEW_LINE>}<NEW_LINE>connectivityReceiver = new ConnectivityReceiver();<NEW_LINE>registerReceiver(connectivityReceiver, new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION));<NEW_LINE>}
putExtra(Intent.EXTRA_LOCAL_ONLY, true);
1,360,158
void deserialize(final Map<String, SchemaNode> schemaNodes, final SchemaProperty property) {<NEW_LINE>setDefaultValue(property.getDefaultValue());<NEW_LINE>setCompound(property.isCompound());<NEW_LINE>setRequired(property.isRequired());<NEW_LINE>setUnique(property.isUnique());<NEW_LINE>setIndexed(property.isIndexed());<NEW_LINE>setReadOnly(property.isReadOnly());<NEW_LINE>setHint(property.getHint());<NEW_LINE>setCategory(property.getCategory());<NEW_LINE>final String[] _validators = <MASK><NEW_LINE>if (_validators != null) {<NEW_LINE>for (final String validator : _validators) {<NEW_LINE>validators.add(validator);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final String[] _transformators = property.getProperty(SchemaProperty.transformers);<NEW_LINE>if (_transformators != null) {<NEW_LINE>for (final String transformator : _transformators) {<NEW_LINE>transformers.add(transformator);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
property.getProperty(SchemaProperty.validators);
645,816
final ListPoolOriginationIdentitiesResult executeListPoolOriginationIdentities(ListPoolOriginationIdentitiesRequest listPoolOriginationIdentitiesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listPoolOriginationIdentitiesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListPoolOriginationIdentitiesRequest> request = null;<NEW_LINE>Response<ListPoolOriginationIdentitiesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListPoolOriginationIdentitiesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listPoolOriginationIdentitiesRequest));<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, "Pinpoint SMS Voice V2");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListPoolOriginationIdentitiesResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListPoolOriginationIdentitiesResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListPoolOriginationIdentities");
1,107,275
// </editor-fold>//GEN-END:initComponents<NEW_LINE>private void addVarButtonActionPerformed(java.awt.event.ActionEvent evt) {<NEW_LINE>// GEN-FIRST:event_addVarButtonActionPerformed<NEW_LINE>final DefaultTableModel model = (DefaultTableModel) childrenVariablesTable.getModel();<NEW_LINE>model.addRow(new Object[] { "", "" });<NEW_LINE>final int index = model.getRowCount() - 1;<NEW_LINE>childrenVariablesTable.getSelectionModel(<MASK><NEW_LINE>childrenVariablesTable.editCellAt(index, 0);<NEW_LINE>childrenVariablesTable.requestFocus();<NEW_LINE>// DefaultCellEditor ed = (DefaultCellEditor)<NEW_LINE>childrenVariablesTable.getCellEditor(index, 0).shouldSelectCell(new ListSelectionEvent(childrenVariablesTable, index, index, true));<NEW_LINE>addVarButton.setEnabled(false);<NEW_LINE>removeVarButton.setEnabled(false);<NEW_LINE>childrenVariablesTable.getCellEditor(index, 0).addCellEditorListener(new CellEditorListener() {<NEW_LINE><NEW_LINE>public void editingStopped(ChangeEvent e) {<NEW_LINE>SwingUtilities.invokeLater(new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>String value = (String) model.getValueAt(index, 0);<NEW_LINE>if (value.trim().length() == 0) {<NEW_LINE>model.removeRow(index);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>childrenVariablesTable.getCellEditor(index, 0).removeCellEditorListener(this);<NEW_LINE>addVarButton.setEnabled(true);<NEW_LINE>removeVarButton.setEnabled(childrenVariablesTable.getSelectedRow() >= 0);<NEW_LINE>}<NEW_LINE><NEW_LINE>public void editingCanceled(ChangeEvent e) {<NEW_LINE>model.removeRow(index);<NEW_LINE>childrenVariablesTable.getCellEditor(index, 0).removeCellEditorListener(this);<NEW_LINE>addVarButton.setEnabled(true);<NEW_LINE>removeVarButton.setEnabled(childrenVariablesTable.getSelectedRow() >= 0);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
).setSelectionInterval(index, index);
246,906
private void prepare(IParam param, Context ctx) {<NEW_LINE>if (param != null && param.getType() == IParam.Semicolon) {<NEW_LINE>moveParam = param.getSub(1);<NEW_LINE>param = param.getSub(0);<NEW_LINE>}<NEW_LINE>if (param == null) {<NEW_LINE>level = 0;<NEW_LINE>} else if (param.isLeaf()) {<NEW_LINE>Object obj = param.getLeafExpression().calculate(ctx);<NEW_LINE>if (obj instanceof Number) {<NEW_LINE>level = ((Number) obj).intValue();<NEW_LINE>if (level < 0) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("get" + mm.getMessage("function.missingParam"));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("get" + mm.getMessage("function.paramTypeError"));<NEW_LINE>}<NEW_LINE>} else if (param.getSubSize() == 2) {<NEW_LINE>IParam levelParam = param.getSub(0);<NEW_LINE>if (levelParam == null) {<NEW_LINE>level = 0;<NEW_LINE>} else {<NEW_LINE>Object obj = levelParam.getLeafExpression().calculate(ctx);<NEW_LINE>if (obj instanceof Number) {<NEW_LINE>level = ((Number) obj).intValue();<NEW_LINE>if (level < 0) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("get" <MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("get" + mm.getMessage("function.paramTypeError"));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>IParam fieldParam = param.getSub(1);<NEW_LINE>if (fieldParam == null) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("get" + mm.getMessage("function.invalidParam"));<NEW_LINE>}<NEW_LINE>fieldName = fieldParam.getLeafExpression().getIdentifierName();<NEW_LINE>isSeq = fieldName.equals(KeyWord.CURRENTSEQ);<NEW_LINE>} else {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("get" + mm.getMessage("function.invalidParam"));<NEW_LINE>}<NEW_LINE>}
+ mm.getMessage("function.missingParam"));
1,811,233
public void invoke(@NotNull Project project, @NotNull PsiFile file, @Nullable("is null when called from inspection") Editor editor, @NotNull PsiElement startElement, @NotNull PsiElement endElement) {<NEW_LINE>if (editor == null) {<NEW_LINE>LOG.error("Cannot run quick fix without editor: " + getClass().getSimpleName(), AttachmentFactory.createAttachment(file.getVirtualFile()));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!(startElement instanceof GoCallExpr))<NEW_LINE>return;<NEW_LINE>GoCallExpr call = (GoCallExpr) startElement;<NEW_LINE>List<GoExpression> args = call.getArgumentList().getExpressionList();<NEW_LINE>GoType resultType = ContainerUtil.getFirstItem<MASK><NEW_LINE>PsiElement anchor = PsiTreeUtil.findPrevParent(file, call);<NEW_LINE>Template template = TemplateManager.getInstance(project).createTemplate("", "");<NEW_LINE>template.addTextSegment("\nfunc " + myName);<NEW_LINE>setupFunctionParameters(template, args, file);<NEW_LINE>setupFunctionResult(template, resultType);<NEW_LINE>template.addTextSegment(" {\n\t");<NEW_LINE>template.addEndVariable();<NEW_LINE>template.addTextSegment("\n}");<NEW_LINE>int offset = anchor.getTextRange().getEndOffset();<NEW_LINE>editor.getCaretModel().moveToOffset(offset);<NEW_LINE>startTemplate(editor, template, project);<NEW_LINE>}
(GoTypeUtil.getExpectedTypes(call));
1,475,662
static Set<DayOfWeek> mapDayOfWeek(DayOfWeekEnumeration value) {<NEW_LINE>switch(value) {<NEW_LINE>case MONDAY:<NEW_LINE>return EnumSet.of(DayOfWeek.MONDAY);<NEW_LINE>case TUESDAY:<NEW_LINE>return EnumSet.of(DayOfWeek.TUESDAY);<NEW_LINE>case WEDNESDAY:<NEW_LINE>return EnumSet.of(DayOfWeek.WEDNESDAY);<NEW_LINE>case THURSDAY:<NEW_LINE>return EnumSet.of(DayOfWeek.THURSDAY);<NEW_LINE>case FRIDAY:<NEW_LINE>return EnumSet.of(DayOfWeek.FRIDAY);<NEW_LINE>case SATURDAY:<NEW_LINE>return <MASK><NEW_LINE>case SUNDAY:<NEW_LINE>return EnumSet.of(DayOfWeek.SUNDAY);<NEW_LINE>case WEEKDAYS:<NEW_LINE>return EnumSet.range(DayOfWeek.MONDAY, DayOfWeek.FRIDAY);<NEW_LINE>case WEEKEND:<NEW_LINE>return EnumSet.range(DayOfWeek.SATURDAY, DayOfWeek.SUNDAY);<NEW_LINE>case EVERYDAY:<NEW_LINE>return EnumSet.range(DayOfWeek.MONDAY, DayOfWeek.SUNDAY);<NEW_LINE>case NONE:<NEW_LINE>return EnumSet.noneOf(DayOfWeek.class);<NEW_LINE>}<NEW_LINE>throw new IllegalArgumentException("Day of week enum mapping missing: " + value);<NEW_LINE>}
EnumSet.of(DayOfWeek.SATURDAY);
571,612
private static void propagateNewSource(KineticTileEntity currentTE) {<NEW_LINE>BlockPos pos = currentTE.getBlockPos();<NEW_LINE>Level world = currentTE.getLevel();<NEW_LINE>for (KineticTileEntity neighbourTE : getConnectedNeighbours(currentTE)) {<NEW_LINE>float speedOfCurrent = currentTE.getTheoreticalSpeed();<NEW_LINE>float speedOfNeighbour = neighbourTE.getTheoreticalSpeed();<NEW_LINE>float newSpeed = getConveyedSpeed(currentTE, neighbourTE);<NEW_LINE>float oppositeSpeed = getConveyedSpeed(neighbourTE, currentTE);<NEW_LINE>if (newSpeed == 0 && oppositeSpeed == 0)<NEW_LINE>continue;<NEW_LINE>boolean incompatible = Math.signum(newSpeed) != Math.signum(speedOfNeighbour) && (newSpeed != 0 && speedOfNeighbour != 0);<NEW_LINE>boolean tooFast = Math.abs(newSpeed) > AllConfigs.SERVER.kinetics.maxRotationSpeed.get();<NEW_LINE>boolean speedChangedTooOften = currentTE.getFlickerScore() > MAX_FLICKER_SCORE;<NEW_LINE>if (tooFast || speedChangedTooOften) {<NEW_LINE>world.destroyBlock(pos, true);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Opposite directions<NEW_LINE>if (incompatible) {<NEW_LINE>world.destroyBlock(pos, true);<NEW_LINE>return;<NEW_LINE>// Same direction: overpower the slower speed<NEW_LINE>} else {<NEW_LINE>// Neighbour faster, overpower the incoming tree<NEW_LINE>if (Math.abs(oppositeSpeed) > Math.abs(speedOfCurrent)) {<NEW_LINE>float prevSpeed = currentTE.getSpeed();<NEW_LINE>currentTE.setSource(neighbourTE.getBlockPos());<NEW_LINE>currentTE.setSpeed(getConveyedSpeed(neighbourTE, currentTE));<NEW_LINE>currentTE.onSpeedChanged(prevSpeed);<NEW_LINE>currentTE.sendData();<NEW_LINE>propagateNewSource(currentTE);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Current faster, overpower the neighbours' tree<NEW_LINE>if (Math.abs(newSpeed) >= Math.abs(speedOfNeighbour)) {<NEW_LINE>// Do not overpower you own network -> cycle<NEW_LINE>if (!currentTE.hasNetwork() || currentTE.network.equals(neighbourTE.network)) {<NEW_LINE>float epsilon = Math.<MASK><NEW_LINE>if (Math.abs(newSpeed) > Math.abs(speedOfNeighbour) + epsilon)<NEW_LINE>world.destroyBlock(pos, true);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (currentTE.hasSource() && currentTE.source.equals(neighbourTE.getBlockPos()))<NEW_LINE>currentTE.removeSource();<NEW_LINE>float prevSpeed = neighbourTE.getSpeed();<NEW_LINE>neighbourTE.setSource(currentTE.getBlockPos());<NEW_LINE>neighbourTE.setSpeed(getConveyedSpeed(currentTE, neighbourTE));<NEW_LINE>neighbourTE.onSpeedChanged(prevSpeed);<NEW_LINE>neighbourTE.sendData();<NEW_LINE>propagateNewSource(neighbourTE);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (neighbourTE.getTheoreticalSpeed() == newSpeed)<NEW_LINE>continue;<NEW_LINE>float prevSpeed = neighbourTE.getSpeed();<NEW_LINE>neighbourTE.setSpeed(newSpeed);<NEW_LINE>neighbourTE.setSource(currentTE.getBlockPos());<NEW_LINE>neighbourTE.onSpeedChanged(prevSpeed);<NEW_LINE>neighbourTE.sendData();<NEW_LINE>propagateNewSource(neighbourTE);<NEW_LINE>}<NEW_LINE>}
abs(speedOfNeighbour) / 256f / 256f;
890,487
public void marshall(AdvancedFieldSelector advancedFieldSelector, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (advancedFieldSelector == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(advancedFieldSelector.getField(), FIELD_BINDING);<NEW_LINE>protocolMarshaller.marshall(advancedFieldSelector.getEquals(), EQUALS_BINDING);<NEW_LINE>protocolMarshaller.marshall(advancedFieldSelector.getStartsWith(), STARTSWITH_BINDING);<NEW_LINE>protocolMarshaller.marshall(advancedFieldSelector.getEndsWith(), ENDSWITH_BINDING);<NEW_LINE>protocolMarshaller.marshall(advancedFieldSelector.getNotEquals(), NOTEQUALS_BINDING);<NEW_LINE>protocolMarshaller.marshall(advancedFieldSelector.getNotStartsWith(), NOTSTARTSWITH_BINDING);<NEW_LINE>protocolMarshaller.marshall(advancedFieldSelector.getNotEndsWith(), NOTENDSWITH_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + <MASK><NEW_LINE>}<NEW_LINE>}
e.getMessage(), e);
272,240
public Request<DisassociateKmsKeyRequest> marshall(DisassociateKmsKeyRequest disassociateKmsKeyRequest) {<NEW_LINE>if (disassociateKmsKeyRequest == null) {<NEW_LINE>throw new AmazonClientException("Invalid argument passed to marshall(DisassociateKmsKeyRequest)");<NEW_LINE>}<NEW_LINE>Request<DisassociateKmsKeyRequest> request = new DefaultRequest<DisassociateKmsKeyRequest>(disassociateKmsKeyRequest, "AmazonCloudWatchLogs");<NEW_LINE>String target = "Logs_20140328.DisassociateKmsKey";<NEW_LINE>request.addHeader("X-Amz-Target", target);<NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>String uriResourcePath = "/";<NEW_LINE>request.setResourcePath(uriResourcePath);<NEW_LINE>try {<NEW_LINE>StringWriter stringWriter = new StringWriter();<NEW_LINE>AwsJsonWriter jsonWriter = JsonUtils.getJsonWriter(stringWriter);<NEW_LINE>jsonWriter.beginObject();<NEW_LINE>if (disassociateKmsKeyRequest.getLogGroupName() != null) {<NEW_LINE>String logGroupName = disassociateKmsKeyRequest.getLogGroupName();<NEW_LINE>jsonWriter.name("logGroupName");<NEW_LINE>jsonWriter.value(logGroupName);<NEW_LINE>}<NEW_LINE>jsonWriter.endObject();<NEW_LINE>jsonWriter.close();<NEW_LINE>String snippet = stringWriter.toString();<NEW_LINE>byte[] content = snippet.getBytes(UTF8);<NEW_LINE>request.setContent(new StringInputStream(snippet));<NEW_LINE>request.addHeader("Content-Length", Integer<MASK><NEW_LINE>} catch (Throwable t) {<NEW_LINE>throw new AmazonClientException("Unable to marshall request to JSON: " + t.getMessage(), t);<NEW_LINE>}<NEW_LINE>if (!request.getHeaders().containsKey("Content-Type")) {<NEW_LINE>request.addHeader("Content-Type", "application/x-amz-json-1.1");<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>}
.toString(content.length));
103,671
public static Models create(Shell shell, Settings settings, ExceptionHandler handler, Client client, StatusBar status) {<NEW_LINE>Analytics analytics = new Analytics(client, settings, handler);<NEW_LINE>Capture capture = new Capture(shell, analytics, client, settings);<NEW_LINE>Devices devices = new Devices(shell, analytics, client, capture, settings);<NEW_LINE>ConstantSets constants = new ConstantSets(client, devices);<NEW_LINE>CommandStream commands = new CommandStream(shell, analytics, client, capture, devices, constants, settings);<NEW_LINE>Follower follower = new Follower(shell, client);<NEW_LINE>Resources resources = new Resources(shell, analytics, client, capture, devices, commands, follower);<NEW_LINE>ApiState state = new ApiState(shell, analytics, client, devices, follower, commands, constants);<NEW_LINE>Reports reports = new Reports(shell, analytics, client, capture, devices);<NEW_LINE>ImagesModel images = new ImagesModel(client, devices, capture, settings);<NEW_LINE>Geometries geometries = new Geometries(shell, analytics, client, devices, commands);<NEW_LINE>Memory memory = new Memory(shell, analytics, client, devices, commands);<NEW_LINE>MemoryTypes types = new MemoryTypes(client, devices, constants);<NEW_LINE>Perfetto perfetto = new Perfetto(shell, analytics, client, capture, status);<NEW_LINE>Profile profile = new Profile(shell, analytics, client, <MASK><NEW_LINE>UpdateWatcher updateWatcher = new UpdateWatcher(settings, client, status);<NEW_LINE>return new Models(settings, analytics, follower, capture, devices, commands, resources, state, reports, images, constants, geometries, memory, types, perfetto, profile, status, updateWatcher);<NEW_LINE>}
capture, devices, commands, settings);
263,658
protected void checkFormat() {<NEW_LINE>JdbcConf conf = format.getJdbcConf();<NEW_LINE>StringBuilder sb = new StringBuilder(256);<NEW_LINE>if (StringUtils.isBlank(conf.getJdbcUrl())) {<NEW_LINE>sb.append("No jdbc url supplied;\n");<NEW_LINE>}<NEW_LINE>if (conf.getParallelism() > 1) {<NEW_LINE>if (StringUtils.isBlank(conf.getSplitPk())) {<NEW_LINE>sb.append("Must specify the split column when the channel is greater than 1;\n");<NEW_LINE>} else {<NEW_LINE>FieldConf field = FieldConf.getSameNameMetaColumn(conf.getColumn(<MASK><NEW_LINE>if (field == null) {<NEW_LINE>sb.append("split column must in columns;\n");<NEW_LINE>} else if (!ColumnType.isNumberType(field.getType())) {<NEW_LINE>sb.append("split column's type must be number type;\n");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Semantic.getByName(conf.getSemantic());<NEW_LINE>} catch (Exception e) {<NEW_LINE>sb.append(String.format("unsupported semantic type %s", conf.getSemantic()));<NEW_LINE>}<NEW_LINE>if (sb.length() > 0) {<NEW_LINE>throw new IllegalArgumentException(sb.toString());<NEW_LINE>}<NEW_LINE>}
), conf.getSplitPk());
122,126
public Alert alertFrom(DBObject dbo) {<NEW_LINE>String id = dbo.<MASK><NEW_LINE>String checkId = getString(dbo, "checkId");<NEW_LINE>BigDecimal value = getBigDecimal(dbo, "value");<NEW_LINE>String target = getString(dbo, "target");<NEW_LINE>BigDecimal warn = getBigDecimal(dbo, "warn");<NEW_LINE>BigDecimal error = getBigDecimal(dbo, "error");<NEW_LINE>AlertType fromType = AlertType.valueOf(getString(dbo, "fromType"));<NEW_LINE>AlertType toType = AlertType.valueOf(getString(dbo, "toType"));<NEW_LINE>DateTime timestamp = getDateTime(dbo, "timestamp");<NEW_LINE>return new Alert().withId(id).withCheckId(checkId).withValue(value).withTarget(target).withWarn(warn).withError(error).withFromType(fromType).withToType(toType).withTimestamp(timestamp);<NEW_LINE>}
get("_id").toString();
1,022,727
protected C remove(Node node) {<NEW_LINE>Node previous = node.parent;<NEW_LINE>if (node.childrenSize > 0) {<NEW_LINE>// The node which contains the input string and has children, just<NEW_LINE>// NULL out the string<NEW_LINE>node.isWord = false;<NEW_LINE>} else {<NEW_LINE>// The node which contains the input string does NOT have children<NEW_LINE>int index = <MASK><NEW_LINE>// Remove node from previous node<NEW_LINE>previous.removeChild(index);<NEW_LINE>// Go back up the trie removing nodes until you find a node which<NEW_LINE>// represents a string<NEW_LINE>while (previous != null && previous.isWord == false && previous.childrenSize == 0) {<NEW_LINE>if (previous.parent != null) {<NEW_LINE>int idx = previous.parent.childIndex(previous.character);<NEW_LINE>if (idx >= 0)<NEW_LINE>previous.parent.removeChild(idx);<NEW_LINE>}<NEW_LINE>previous = previous.parent;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>size--;<NEW_LINE>return (C) (String.valueOf(node.character));<NEW_LINE>}
previous.childIndex(node.character);
303,215
private void cancelTimeoutOrLog(@Nullable Throwable cause, Consumer<Throwable> actionOnNotTimedOut) {<NEW_LINE>CancellationScheduler responseCancellationScheduler = null;<NEW_LINE>if (ctx instanceof DefaultClientRequestContext) {<NEW_LINE>responseCancellationScheduler = ((DefaultClientRequestContext) ctx).responseCancellationScheduler();<NEW_LINE>}<NEW_LINE>if (responseCancellationScheduler == null || !responseCancellationScheduler.isFinished()) {<NEW_LINE>if (responseCancellationScheduler != null) {<NEW_LINE>responseCancellationScheduler.clearTimeout(false);<NEW_LINE>}<NEW_LINE>// There's no timeout or the response has not been timed out.<NEW_LINE>actionOnNotTimedOut.accept(cause);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (delegate.isOpen()) {<NEW_LINE>closeAction(cause);<NEW_LINE>}<NEW_LINE>// Response has been timed out already.<NEW_LINE>// Log only when it's not a ResponseTimeoutException.<NEW_LINE>if (cause instanceof ResponseTimeoutException) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (cause == null || !logger.isWarnEnabled() || Exceptions.isExpected(cause)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final StringBuilder logMsg = new StringBuilder("Unexpected exception while closing a request");<NEW_LINE>if (ctx != null) {<NEW_LINE>final String authority = ctx<MASK><NEW_LINE>if (authority != null) {<NEW_LINE>logMsg.append(" to ").append(authority);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>logger.warn(logMsg.append(':').toString(), cause);<NEW_LINE>}
.request().authority();
1,518,492
private void createDataBase() throws ClassNotFoundException, IOException, SQLException {<NEW_LINE>String goalUrl = properties.getProperty("spring.datasource.url");<NEW_LINE>this.user = properties.getProperty("spring.datasource.username");<NEW_LINE>this.password = properties.getProperty("spring.datasource.password");<NEW_LINE>String driverName = properties.getProperty("spring.datasource.driver-class-name");<NEW_LINE>boolean flag = driverName.contains("mariadb");<NEW_LINE>if (flag) {<NEW_LINE>databaseType = "mysql";<NEW_LINE>}<NEW_LINE>int first = goalUrl.lastIndexOf("/") + 1;<NEW_LINE>int endTag = goalUrl.indexOf("?");<NEW_LINE>if (endTag == -1) {<NEW_LINE>endTag = goalUrl.length();<NEW_LINE>}<NEW_LINE>this.dbName = goalUrl.substring(first, endTag);<NEW_LINE>// get mysql default url like jdbc:mysql://127.0.0.1:3306<NEW_LINE>String defaultUrl = flag ? goalUrl.substring(0, first) : goalUrl;<NEW_LINE>log.info("dbName:{},defaultUrl:{}, {}", this.dbName, defaultUrl, databaseType);<NEW_LINE>Class.forName(driverName);<NEW_LINE>List<String> tableSqlList = readSql();<NEW_LINE><MASK><NEW_LINE>}
runScript(defaultUrl, flag, tableSqlList);
1,505,867
private AscendingLongIterator predicateIterator(Predicate predicate, TypeConverter converter) {<NEW_LINE>if (predicate instanceof AndPredicate) {<NEW_LINE>Predicate[] predicates = ((AndPredicate) predicate).getPredicates();<NEW_LINE>assert predicates.length > 0;<NEW_LINE>if (predicates.length == 1) {<NEW_LINE>return predicateIterator<MASK><NEW_LINE>} else {<NEW_LINE>return BitmapAlgorithms.and(predicateIterators(predicates, converter));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (predicate instanceof OrPredicate) {<NEW_LINE>Predicate[] predicates = ((OrPredicate) predicate).getPredicates();<NEW_LINE>assert predicates.length > 0;<NEW_LINE>if (predicates.length == 1) {<NEW_LINE>return predicateIterator(predicates[0], converter);<NEW_LINE>} else {<NEW_LINE>return BitmapAlgorithms.or(predicateIterators(predicates, converter));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (predicate instanceof NotPredicate) {<NEW_LINE>Predicate subPredicate = ((NotPredicate) predicate).getPredicate();<NEW_LINE>return BitmapAlgorithms.not(predicateIterator(subPredicate, converter), entries);<NEW_LINE>}<NEW_LINE>if (predicate instanceof NotEqualPredicate) {<NEW_LINE>Comparable value = ((NotEqualPredicate) predicate).getValue();<NEW_LINE>return BitmapAlgorithms.not(valueIterator(value, converter), entries);<NEW_LINE>}<NEW_LINE>if (predicate instanceof EqualPredicate) {<NEW_LINE>Comparable value = ((EqualPredicate) predicate).getFrom();<NEW_LINE>return valueIterator(value, converter);<NEW_LINE>}<NEW_LINE>if (predicate instanceof InPredicate) {<NEW_LINE>Comparable[] values = ((InPredicate) predicate).getValues();<NEW_LINE>return BitmapAlgorithms.or(valueIterators(values, converter));<NEW_LINE>}<NEW_LINE>throw new IllegalArgumentException("unexpected predicate: " + predicate);<NEW_LINE>}
(predicates[0], converter);
822,949
public static String dayify(String x) {<NEW_LINE>StringBuffer sb = new StringBuffer();<NEW_LINE>if (daysOfWeek == null) {<NEW_LINE>daysOfWeek = new HashMap<String, String>();<NEW_LINE>daysOfWeek.put("M", "Monday");<NEW_LINE>daysOfWeek.put("T", "Tuesday");<NEW_LINE><MASK><NEW_LINE>daysOfWeek.put("R", "Thursday");<NEW_LINE>daysOfWeek.put("F", "Friday");<NEW_LINE>daysOfWeek.put("S", "Saturday");<NEW_LINE>daysOfWeek.put("&", "Sunday");<NEW_LINE>}<NEW_LINE>if (x.indexOf("ARR") > -1) {<NEW_LINE>return "to be arranged";<NEW_LINE>}<NEW_LINE>char[] chrs = x.toCharArray();<NEW_LINE>for (int i = 0; i < chrs.length; i++) {<NEW_LINE>if (daysOfWeek.get(String.valueOf(chrs[i])) != null) {<NEW_LINE>if (sb.length() > 0)<NEW_LINE>sb.append(", ");<NEW_LINE>sb.append(daysOfWeek.get(String.valueOf(chrs[i])));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return sb.toString();<NEW_LINE>}
daysOfWeek.put("W", "Wednesday");
1,423,125
protected void flowThrough(AnalysisInfo in, Unit u, List<AnalysisInfo> fallOut, List<AnalysisInfo> branchOuts) {<NEW_LINE>AnalysisInfo out = new AnalysisInfo(in);<NEW_LINE>AnalysisInfo outBranch = new AnalysisInfo(in);<NEW_LINE>Stmt s = (Stmt) u;<NEW_LINE>// in case of an if statement, we neet to compute the branch-flow;<NEW_LINE>// e.g. for a statement "if(x!=null) goto s" we have x==null for the fallOut and<NEW_LINE>// x!=null for the branchOut<NEW_LINE>// or for an instanceof expression<NEW_LINE>if (s instanceof JIfStmt) {<NEW_LINE>handleIfStmt((JIfStmt) s, in, out, outBranch);<NEW_LINE>} else if (s instanceof MonitorStmt) {<NEW_LINE>// in case of a monitor statement, we know that if it succeeds, we have a non-null value<NEW_LINE>out.put(((MonitorStmt) s<MASK><NEW_LINE>}<NEW_LINE>// if we have an array ref, set the base to non-null<NEW_LINE>if (s.containsArrayRef()) {<NEW_LINE>handleArrayRef(s.getArrayRef(), out);<NEW_LINE>}<NEW_LINE>// for field refs, set the receiver object to non-null, if there is one<NEW_LINE>if (s.containsFieldRef()) {<NEW_LINE>handleFieldRef(s.getFieldRef(), out);<NEW_LINE>}<NEW_LINE>// for invoke expr, set the receiver object to non-null, if there is one<NEW_LINE>if (s.containsInvokeExpr()) {<NEW_LINE>handleInvokeExpr(s.getInvokeExpr(), out);<NEW_LINE>}<NEW_LINE>// if we have a definition (assignment) statement to a ref-like type, handle it,<NEW_LINE>// i.e. assign it TOP, except in the following special cases:<NEW_LINE>// x=null, assign NULL<NEW_LINE>// x=@this or x= new... assign NON_NULL<NEW_LINE>// x=y, copy the info for y (for locals x,y)<NEW_LINE>if (s instanceof DefinitionStmt) {<NEW_LINE>DefinitionStmt defStmt = (DefinitionStmt) s;<NEW_LINE>if (defStmt.getLeftOp().getType() instanceof RefLikeType) {<NEW_LINE>handleRefTypeAssignment(defStmt, out);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// now copy the computed info to all successors<NEW_LINE>for (AnalysisInfo next : fallOut) {<NEW_LINE>copy(out, next);<NEW_LINE>}<NEW_LINE>for (AnalysisInfo next : branchOuts) {<NEW_LINE>copy(outBranch, next);<NEW_LINE>}<NEW_LINE>}
).getOp(), NON_NULL);
1,644,328
protected Control createContents(Composite parent) {<NEW_LINE>Composite main = new Composite(parent, SWT.NONE);<NEW_LINE>main.setLayoutData(new GridData(SWT.FILL, SWT<MASK><NEW_LINE>GridLayout layout = new GridLayout(2, false);<NEW_LINE>layout.marginHeight = 0;<NEW_LINE>layout.marginWidth = 0;<NEW_LINE>main.setLayout(layout);<NEW_LINE>Label label = new Label(main, SWT.LEFT);<NEW_LINE>label.setText(Messages.SynchronizationPropertyPage_lastSyncConnection);<NEW_LINE>fSitesCombo = new Combo(main, SWT.DROP_DOWN | SWT.READ_ONLY);<NEW_LINE>// adds the sites that have the selected resource as the source<NEW_LINE>ISiteConnection[] sites = SiteConnectionUtils.findSitesForSource(fResource);<NEW_LINE>for (ISiteConnection site : sites) {<NEW_LINE>fSitesCombo.add(site.getDestination().getName());<NEW_LINE>}<NEW_LINE>fSitesCombo.select(0);<NEW_LINE>String connection = ResourceSynchronizationUtils.getLastSyncConnection(fResource);<NEW_LINE>if (connection != null && !connection.equals("")) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>fSitesCombo.setText(connection);<NEW_LINE>}<NEW_LINE>fUseAsDefaultButton = new Button(main, SWT.CHECK);<NEW_LINE>fUseAsDefaultButton.setText(Messages.SynchronizationPropertyPage_useConnectionsAsDefault);<NEW_LINE>fUseAsDefaultButton.setSelection(ResourceSynchronizationUtils.isRememberDecision(fResource));<NEW_LINE>GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, false);<NEW_LINE>gridData.horizontalSpan = 2;<NEW_LINE>fUseAsDefaultButton.setLayoutData(gridData);<NEW_LINE>return main;<NEW_LINE>}
.FILL, true, true));
1,630,873
public ListRunsResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ListRunsResult listRunsResult = new ListRunsResult();<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 listRunsResult;<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("runs", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listRunsResult.setRuns(new ListUnmarshaller<Run>(RunJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("nextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listRunsResult.setNextToken(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return listRunsResult;<NEW_LINE>}
class).unmarshall(context));
837,522
public int copyPhasesFrom(final MProject fromProject) {<NEW_LINE>if (isProcessed() || fromProject == null)<NEW_LINE>return 0;<NEW_LINE>int count = 0;<NEW_LINE>int taskCount = 0;<NEW_LINE>// Get Phases<NEW_LINE>final <MASK><NEW_LINE>final MProjectPhase[] fromPhases = fromProject.getPhases();<NEW_LINE>// Copy Phases<NEW_LINE>for (final MProjectPhase fromPhase : fromPhases) {<NEW_LINE>// Check if Phase already exists<NEW_LINE>final int C_Phase_ID = fromPhase.getC_Phase_ID();<NEW_LINE>boolean exists = false;<NEW_LINE>if (C_Phase_ID == 0)<NEW_LINE>exists = false;<NEW_LINE>else {<NEW_LINE>for (final MProjectPhase myPhase : myPhases) {<NEW_LINE>if (myPhase.getC_Phase_ID() == C_Phase_ID) {<NEW_LINE>exists = true;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Phase exist<NEW_LINE>if (exists)<NEW_LINE>log.info("Phase already exists here, ignored - " + fromPhase);<NEW_LINE>else {<NEW_LINE>final MProjectPhase toPhase = new MProjectPhase(getCtx(), 0, get_TrxName());<NEW_LINE>PO.copyValues(fromPhase, toPhase, getAD_Client_ID(), getAD_Org_ID());<NEW_LINE>toPhase.setC_Project_ID(getC_Project_ID());<NEW_LINE>toPhase.setC_Order_ID(0);<NEW_LINE>toPhase.setIsComplete(false);<NEW_LINE>if (toPhase.save()) {<NEW_LINE>count++;<NEW_LINE>taskCount += toPhase.copyTasksFrom(fromPhase);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (fromPhases.length != count)<NEW_LINE>log.warn("Count difference - Project=" + fromPhases.length + " <> Saved=" + count);<NEW_LINE>return count + taskCount;<NEW_LINE>}
MProjectPhase[] myPhases = getPhases();
1,433,812
protected ExpandItem createSnippetDrawer(ExpandBar expandBar, SnippetCategoryElement category, List<SnippetData> snippets) {<NEW_LINE>Composite composite = new Composite(expandBar, SWT.NONE);<NEW_LINE>composite.setForeground(UIUtils.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BORDER));<NEW_LINE>composite.setLayout(GridLayoutFactory.fillDefaults().spacing(0, 0).create());<NEW_LINE>ExpandItem expandItem = new ExpandItem(expandBar, SWT.NONE);<NEW_LINE>int size = 0;<NEW_LINE>if (snippets != null) {<NEW_LINE>size = snippets.size();<NEW_LINE>}<NEW_LINE>expandItem.setText(MessageFormat.format(Messages.SnippetsView_Snippet_drawer_title, category.getDisplayName(), String.valueOf(size)));<NEW_LINE>expandItem.setControl(composite);<NEW_LINE>expandItem.setImage(category != null && category.getIconURL() != null ? getImage(category<MASK><NEW_LINE>expandItem.setData(category != null ? category.getDisplayName() : null);<NEW_LINE>expandItem.setHeight(composite.computeSize(SWT.DEFAULT, SWT.DEFAULT).y);<NEW_LINE>expandItems.put(category != null ? category.getDisplayName() : null, expandItem);<NEW_LINE>return expandItem;<NEW_LINE>}
.getIconURL()) : genericSnippetImage);
471,587
public Continuation<ContainerResponse> apply(ContainerResponse responseContext) {<NEW_LINE>final ArrayList<Iterable<RankedProvider<ContainerResponseFilter>>> rankedProviders <MASK><NEW_LINE>rankedProviders.add(filters);<NEW_LINE>rankedProviders.add(responseContext.getRequestContext().getResponseFilters());<NEW_LINE>Iterable<ContainerResponseFilter> sortedResponseFilters = Providers.mergeAndSortRankedProviders(new RankedComparator<ContainerResponseFilter>(RankedComparator.Order.DESCENDING), rankedProviders);<NEW_LINE>final ContainerRequest request = responseContext.getRequestContext();<NEW_LINE>processingContext.monitoringEventBuilder().setContainerResponseFilters(sortedResponseFilters);<NEW_LINE>processingContext.triggerEvent(RequestEvent.Type.RESP_FILTERS_START);<NEW_LINE>final long timestamp = tracingLogger.timestamp(ServerTraceEvent.RESPONSE_FILTER_SUMMARY);<NEW_LINE>int processedCount = 0;<NEW_LINE>try {<NEW_LINE>for (ContainerResponseFilter filter : sortedResponseFilters) {<NEW_LINE>final long filterTimestamp = tracingLogger.timestamp(ServerTraceEvent.RESPONSE_FILTER);<NEW_LINE>try {<NEW_LINE>filter.filter(request, responseContext);<NEW_LINE>} catch (Exception ex) {<NEW_LINE>throw new MappableException(ex);<NEW_LINE>} finally {<NEW_LINE>processedCount++;<NEW_LINE>tracingLogger.logDuration(ServerTraceEvent.RESPONSE_FILTER, filterTimestamp, filter);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>processingContext.triggerEvent(RequestEvent.Type.RESP_FILTERS_FINISHED);<NEW_LINE>tracingLogger.logDuration(ServerTraceEvent.RESPONSE_FILTER_SUMMARY, timestamp, processedCount);<NEW_LINE>}<NEW_LINE>return Continuation.of(responseContext, getDefaultNext());<NEW_LINE>}
= new ArrayList<>(2);
1,814,060
public static Builder newBuilder(GeneratorSettings copy) {<NEW_LINE>Builder builder = new Builder();<NEW_LINE>builder.generatorName = copy.getGeneratorName();<NEW_LINE>builder.apiPackage = copy.getApiPackage();<NEW_LINE>builder.modelPackage = copy.getModelPackage();<NEW_LINE>builder.invokerPackage = copy.getInvokerPackage();<NEW_LINE>builder.packageName = copy.getPackageName();<NEW_LINE>builder.apiNameSuffix = copy.getApiNameSuffix();<NEW_LINE>builder.modelNamePrefix = copy.getModelNamePrefix();<NEW_LINE>builder.modelNameSuffix = copy.getModelNameSuffix();<NEW_LINE>builder.groupId = copy.getGroupId();<NEW_LINE>builder.artifactId = copy.getArtifactId();<NEW_LINE>builder.artifactVersion = copy.getArtifactVersion();<NEW_LINE>builder.library = copy.getLibrary();<NEW_LINE>if (copy.getInstantiationTypes() != null) {<NEW_LINE>builder.instantiationTypes.putAll(copy.getInstantiationTypes());<NEW_LINE>}<NEW_LINE>if (copy.getTypeMappings() != null) {<NEW_LINE>builder.typeMappings.putAll(copy.getTypeMappings());<NEW_LINE>}<NEW_LINE>if (copy.getAdditionalProperties() != null) {<NEW_LINE>builder.additionalProperties.putAll(copy.getAdditionalProperties());<NEW_LINE>}<NEW_LINE>if (copy.getImportMappings() != null) {<NEW_LINE>builder.importMappings.putAll(copy.getImportMappings());<NEW_LINE>}<NEW_LINE>if (copy.getLanguageSpecificPrimitives() != null) {<NEW_LINE>builder.languageSpecificPrimitives.addAll(copy.getLanguageSpecificPrimitives());<NEW_LINE>}<NEW_LINE>if (copy.getReservedWordMappings() != null) {<NEW_LINE>builder.reservedWordMappings.putAll(copy.getReservedWordMappings());<NEW_LINE>}<NEW_LINE>if (copy.getServerVariables() != null) {<NEW_LINE>builder.serverVariables.putAll(copy.getServerVariables());<NEW_LINE>}<NEW_LINE>builder.gitHost = copy.getGitHost();<NEW_LINE>builder.gitUserId = copy.getGitUserId();<NEW_LINE>builder.gitRepoId = copy.getGitRepoId();<NEW_LINE>builder.releaseNote = copy.getReleaseNote();<NEW_LINE>builder<MASK><NEW_LINE>return builder;<NEW_LINE>}
.httpUserAgent = copy.getHttpUserAgent();
933,806
protected void readNodeChildren(org.w3c.dom.Node node, java.util.Map namespacePrefixes) {<NEW_LINE>org.w3c.dom.NodeList children = node.getChildNodes();<NEW_LINE>for (int i = 0, size = children.getLength(); i < size; ++i) {<NEW_LINE>org.w3c.dom.Node childNode = children.item(i);<NEW_LINE>String childNodeName = (childNode.getLocalName() == null ? childNode.getNodeName().intern() : childNode.<MASK><NEW_LINE>String childNodeValue = "";<NEW_LINE>if (childNode.getFirstChild() != null) {<NEW_LINE>childNodeValue = childNode.getFirstChild().getNodeValue();<NEW_LINE>}<NEW_LINE>if (childNodeName == "schema-source") {<NEW_LINE>SchemaSource aSchemaSource = newSchemaSource();<NEW_LINE>aSchemaSource.readNode(childNode, namespacePrefixes);<NEW_LINE>_SchemaSource.add(aSchemaSource);<NEW_LINE>} else {<NEW_LINE>// Found extra unrecognized childNode<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
getLocalName().intern());
116,299
protected JComponent createSouthPanel() {<NEW_LINE>final JPanel buttonPanel = new JPanel(new GridBagLayout());<NEW_LINE>GridBagConstraints gbc = new GridBagConstraints();<NEW_LINE>gbc.insets.right = 5;<NEW_LINE>gbc.fill = GridBagConstraints.BOTH;<NEW_LINE>gbc.gridx = 0;<NEW_LINE>gbc.gridy = 0;<NEW_LINE>buttonPanel.add(mySkipButton, gbc);<NEW_LINE>gbc.gridx++;<NEW_LINE>buttonPanel.add(myBackButton, gbc);<NEW_LINE>gbc.gridx++;<NEW_LINE>gbc.weightx = 1;<NEW_LINE>buttonPanel.add(Box.createHorizontalGlue(), gbc);<NEW_LINE>gbc.gridx++;<NEW_LINE>gbc.weightx = 0;<NEW_LINE>buttonPanel.add(myNextButton, gbc);<NEW_LINE>buttonPanel.setBorder(BorderFactory.createEmptyBorder(8, 0, 0, 0));<NEW_LINE>myButtonWrapper.add(buttonPanel, BUTTONS);<NEW_LINE>myButtonWrapper.add<MASK><NEW_LINE>myButtonWrapperLayout.show(myButtonWrapper, BUTTONS);<NEW_LINE>return myButtonWrapper;<NEW_LINE>}
(new JLabel(), NOBUTTONS);
1,247,564
public void restartOpt(SourceRequest request, String operator) {<NEW_LINE>StreamSourceEntity existEntity = sourceMapper.selectByIdForUpdate(request.getId());<NEW_LINE>SourceStatus curState = SourceStatus.forCode(existEntity.getStatus());<NEW_LINE>SourceStatus nextState = SourceStatus.TO_BE_ISSUED_ACTIVE;<NEW_LINE>if (!SourceStatus.isAllowedTransition(curState, nextState)) {<NEW_LINE>throw new BusinessException(String.format("Source=%s is not allowed to restart", existEntity));<NEW_LINE>}<NEW_LINE>StreamSourceEntity curEntity = CommonBeanUtils.copyProperties(request, StreamSourceEntity::new);<NEW_LINE>curEntity.setPreviousStatus(curState.getCode());<NEW_LINE>curEntity.setStatus(nextState.getCode());<NEW_LINE>int rowCount = sourceMapper.updateByPrimaryKeySelective(curEntity);<NEW_LINE>if (rowCount != InlongConstants.AFFECTED_ONE_ROW) {<NEW_LINE>LOGGER.error("source has already updated with groupId={}, streamId={}, name={}, curVersion={}", curEntity.getInlongGroupId(), curEntity.getInlongStreamId(), curEntity.getSourceName(), curEntity.getVersion());<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
throw new BusinessException(ErrorCodeEnum.CONFIG_EXPIRED);
1,458,374
public static String formatNotUniqueProperties(String id, Node node, Map<String, Set<String>> uniqueConstraints, Set<String> indexedProperties, boolean jsonStyle) {<NEW_LINE>Map<String, Object> properties = new LinkedHashMap<>();<NEW_LINE>List<String> keys = Iterables.asList(node.getPropertyKeys());<NEW_LINE>Collections.sort(keys);<NEW_LINE>Map<String, Object> nodeIdProperties = getNodeIdProperties(node, uniqueConstraints);<NEW_LINE>for (String prop : keys) {<NEW_LINE>if (!nodeIdProperties.containsKey(prop) && indexedProperties.contains(prop))<NEW_LINE>properties.put(prop, node.getProperty(prop));<NEW_LINE>}<NEW_LINE>for (String prop : keys) {<NEW_LINE>if (!nodeIdProperties.containsKey(prop) && !indexedProperties.contains(prop))<NEW_LINE>properties.put(prop, node.getProperty(prop));<NEW_LINE>}<NEW_LINE>StringBuilder result = new StringBuilder(100);<NEW_LINE>for (String key : properties.keySet()) {<NEW_LINE>result.append(", ");<NEW_LINE>result.append(formatPropertyName(id, key, properties.<MASK><NEW_LINE>}<NEW_LINE>return formatToString(result);<NEW_LINE>}
get(key), jsonStyle));
574,530
final DeleteRecommenderResult executeDeleteRecommender(DeleteRecommenderRequest deleteRecommenderRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteRecommenderRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteRecommenderRequest> request = null;<NEW_LINE>Response<DeleteRecommenderResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteRecommenderRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteRecommenderRequest));<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, "DeleteRecommender");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteRecommenderResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteRecommenderResultJsonUnmarshaller());<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, "Personalize");
1,097,461
public void build() {<NEW_LINE>// add a comment to the debug log.<NEW_LINE>// /////////////////////////////////<NEW_LINE>// Comment group<NEW_LINE>// /////////////////////////////////<NEW_LINE>StringParameterImpl commentBox = new StringParameterImpl("AutoSpeedv2.comment", "ConfigTransferAutoSpeed.add.comment.to.log");<NEW_LINE>add(commentBox);<NEW_LINE>ActionParameterImpl commentButton = new ActionParameterImpl(null, "ConfigTransferAutoSpeed.log.button");<NEW_LINE>add(commentButton);<NEW_LINE>commentButton.addListener(param -> {<NEW_LINE>// Add a file to the log.<NEW_LINE>AEDiagnosticsLogger dLog = AEDiagnostics.getLogger("AutoSpeed");<NEW_LINE>String comment = commentBox.getValue();<NEW_LINE>if (comment != null) {<NEW_LINE>if (comment.length() > 0) {<NEW_LINE>dLog.log("user-comment:" + comment);<NEW_LINE>commentBox.resetToDefault();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>add("TASV2.pgComment", new ParameterGroupImpl("ConfigTransferAutoSpeed.add.comment.to.log.group", commentBox, commentButton).setNumberOfColumns2(2));<NEW_LINE>// /////////////////////////<NEW_LINE>// Upload Capacity used settings.<NEW_LINE>// /////////////////////////<NEW_LINE>// Label column<NEW_LINE>InfoParameterImpl ucuLabel = new InfoParameterImpl(null, "ConfigTransferAutoSpeed.mode", MessageText.getString("ConfigTransferAutoSpeed.capacity.used"));<NEW_LINE>add(ucuLabel);<NEW_LINE>// add a drop down.<NEW_LINE>String[] downloadModeNames = { " 80%", " 70%", " 60%", " 50%" };<NEW_LINE>int[] downloadModeValues = { 80, 70, 60, 50 };<NEW_LINE>IntListParameterImpl ucuDL = new IntListParameterImpl(SpeedLimitMonitor.USED_UPLOAD_CAPACITY_DOWNLOAD_MODE, "ConfigTransferAutoSpeed.while.downloading", downloadModeValues, downloadModeNames);<NEW_LINE>add(ucuDL);<NEW_LINE>add("TASV2.pgUpCap", new ParameterGroupImpl<MASK><NEW_LINE>// ////////////////////////<NEW_LINE>// DHT Ping Group<NEW_LINE>// ////////////////////////<NEW_LINE>// how much data to accumulate before making an adjustment.<NEW_LINE>IntParameterImpl adjustmentInterval = new IntParameterImpl(SpeedManagerAlgorithmProviderV2.SETTING_INTERVALS_BETWEEN_ADJUST, "ConfigTransferAutoSpeed.adjustment.interval");<NEW_LINE>add(adjustmentInterval);<NEW_LINE>// how much data to accumulate before making an adjustment.<NEW_LINE>BooleanParameterImpl skipAfterAdjustment = new BooleanParameterImpl(SpeedManagerAlgorithmProviderV2.SETTING_WAIT_AFTER_ADJUST, "ConfigTransferAutoSpeed.skip.after.adjust");<NEW_LINE>add(skipAfterAdjustment);<NEW_LINE>add("TASV2.pgUpFreq", new ParameterGroupImpl("ConfigTransferAutoSpeed.data.update.frequency", adjustmentInterval, skipAfterAdjustment));<NEW_LINE>}
("ConfigTransferAutoSpeed.upload.capacity.usage", ucuDL, ucuLabel));
450,598
public static CharSequence userInfo(CharSequence userInfo, boolean encode) throws IllegalArgumentException {<NEW_LINE>final int length = userInfo.length();<NEW_LINE>final StringBuilder stb = new StringBuilder(length);<NEW_LINE>for (int i = 0; i < length; i++) {<NEW_LINE>final char <MASK><NEW_LINE>if (c == '{') {<NEW_LINE>i = processTemplVarname(userInfo, i, stb);<NEW_LINE>} else if (c == '%') {<NEW_LINE>processPercent(i, encode, userInfo, stb);<NEW_LINE>} else if (Reference.isUnreserved(c) || Reference.isSubDelimiter(c)) {<NEW_LINE>stb.append(c);<NEW_LINE>} else if (c == '}') {<NEW_LINE>throw new IllegalArgumentException("'}' is only allowed " + "as end of a variable name in \"" + userInfo + "\"");<NEW_LINE>} else if (c == ':') {<NEW_LINE>stb.append(c);<NEW_LINE>} else {<NEW_LINE>toHexOrReject(c, stb, encode);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return stb;<NEW_LINE>}
c = userInfo.charAt(i);
928,029
public static SargableConditionInference infer(SubqueryWrapperLabel wrapperLabel, List<RexNode> predicates, List<RelDataTypeField> fields, ExtractorContext context) {<NEW_LINE>final RelOptCluster cluster = wrapperLabel.getRel().getCluster();<NEW_LINE>final RelDataType rowType = RelUtils.buildRowType(fields, cluster);<NEW_LINE>final DecorrelationShuttle decorrelationShuttle = new DecorrelationShuttle(wrapperLabel.getRel().getRowType());<NEW_LINE>// Meaningless for subquery inference, use field count of row type of subquery wrapper<NEW_LINE>final int leftCount = wrapperLabel.getRel().getRowType().getFieldCount();<NEW_LINE>// Replace correlate id with column ref<NEW_LINE>final List<RexNode> decorrelated = predicates.stream().map(s -> s.accept(decorrelationShuttle)).collect(Collectors.toList());<NEW_LINE>final List<RexNode> equalityPreds = new ArrayList<>();<NEW_LINE>final List<RexNode> valuePreds = new ArrayList<>();<NEW_LINE><MASK><NEW_LINE>final Map<String, RexNode> inferredEqualities = inferColumnEquality(equalityPreds, (l, r) -> buildEquality(l, r, fields, cluster.getRexBuilder(), context));<NEW_LINE>// Infer<NEW_LINE>return SargableConditionInference.create(cluster, inferredEqualities, deduplicate(valuePreds, context), rowType, leftCount);<NEW_LINE>}
classify(decorrelated, equalityPreds, valuePreds);
708,843
private AttackResult processZipUpload(MultipartFile file) {<NEW_LINE>var tmpZipDirectory = Files.createTempDirectory(getWebSession().getUserName());<NEW_LINE>var uploadDirectory = new File(getWebGoatHomeDirectory(), "/PathTraversal/" + getWebSession().getUserName());<NEW_LINE>var currentImage = getProfilePictureAsBase64();<NEW_LINE>Files.createDirectories(uploadDirectory.toPath());<NEW_LINE>try {<NEW_LINE>var uploadedZipFile = tmpZipDirectory.resolve(file.getOriginalFilename());<NEW_LINE>FileCopyUtils.copy(file.getBytes(<MASK><NEW_LINE>ZipFile zip = new ZipFile(uploadedZipFile.toFile());<NEW_LINE>Enumeration<? extends ZipEntry> entries = zip.entries();<NEW_LINE>while (entries.hasMoreElements()) {<NEW_LINE>ZipEntry e = entries.nextElement();<NEW_LINE>File f = new File(tmpZipDirectory.toFile(), e.getName());<NEW_LINE>InputStream is = zip.getInputStream(e);<NEW_LINE>Files.copy(is, f.toPath(), StandardCopyOption.REPLACE_EXISTING);<NEW_LINE>}<NEW_LINE>return isSolved(currentImage, getProfilePictureAsBase64());<NEW_LINE>} catch (IOException e) {<NEW_LINE>return failed(this).output(e.getMessage()).build();<NEW_LINE>}<NEW_LINE>}
), uploadedZipFile.toFile());
900,168
private void initializeMulticastSocket() {<NEW_LINE>try {<NEW_LINE>int port = getOrDefault(MulticastProperties.PORT, DEFAULT_MULTICAST_PORT);<NEW_LINE>PortValueValidator validator = new PortValueValidator();<NEW_LINE>validator.validate(port);<NEW_LINE>String group = getOrDefault(MulticastProperties.GROUP, DEFAULT_MULTICAST_GROUP);<NEW_LINE>boolean safeSerialization = getOrDefault(MulticastProperties.SAFE_SERIALIZATION, DEFAULT_SAFE_SERIALIZATION);<NEW_LINE>if (!safeSerialization) {<NEW_LINE>String prop = MulticastProperties.SAFE_SERIALIZATION.key();<NEW_LINE>logger.warning("The " + getClass().getSimpleName() + " Hazelcast member discovery strategy is configured without the " + prop + " parameter enabled." + " Set the " + prop + " property to 'true' in the strategy configuration to protect the cluster" + " against untrusted deserialization attacks.");<NEW_LINE>}<NEW_LINE>MulticastDiscoverySerializationHelper serializationHelper = new MulticastDiscoverySerializationHelper(safeSerialization);<NEW_LINE>multicastSocket = new MulticastSocket(null);<NEW_LINE>multicastSocket.bind(new InetSocketAddress(port));<NEW_LINE>if (discoveryNode != null) {<NEW_LINE>// See MulticastService.createMulticastService(...)<NEW_LINE>InetAddress inetAddress = discoveryNode.getPrivateAddress().getInetAddress();<NEW_LINE>if (!inetAddress.isLoopbackAddress()) {<NEW_LINE>multicastSocket.setInterface(inetAddress);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>multicastSocket.setReuseAddress(true);<NEW_LINE>multicastSocket.setTimeToLive(SOCKET_TIME_TO_LIVE);<NEW_LINE>multicastSocket.setReceiveBufferSize(DATA_OUTPUT_BUFFER_SIZE);<NEW_LINE>multicastSocket.setSendBufferSize(DATA_OUTPUT_BUFFER_SIZE);<NEW_LINE>multicastSocket.setSoTimeout(SOCKET_TIMEOUT);<NEW_LINE>multicastSocket.joinGroup<MASK><NEW_LINE>multicastDiscoverySender = new MulticastDiscoverySender(discoveryNode, multicastSocket, logger, group, port, serializationHelper);<NEW_LINE>multicastDiscoveryReceiver = new MulticastDiscoveryReceiver(multicastSocket, logger, serializationHelper);<NEW_LINE>if (discoveryNode == null) {<NEW_LINE>isClient = true;<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.finest(e.getMessage());<NEW_LINE>rethrow(e);<NEW_LINE>}<NEW_LINE>}
(InetAddress.getByName(group));
1,378,743
private void updateHelpImage() {<NEW_LINE>if (Build.VERSION.SDK_INT >= 18) {<NEW_LINE>OsmandSettings settings = getSettings();<NEW_LINE>int count = settings.DISPLAYED_MARKERS_WIDGETS_COUNT.get();<NEW_LINE>LinkedList<Drawable> imgList = new LinkedList<>();<NEW_LINE><MASK><NEW_LINE>if (settings.SHOW_LINES_TO_FIRST_MARKERS.get()) {<NEW_LINE>imgList.add(getGuideLineOneImg());<NEW_LINE>if (count == 2) {<NEW_LINE>imgList.add(getGuideLineTwoImg());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (settings.SHOW_ARROWS_TO_FIRST_MARKERS.get()) {<NEW_LINE>imgList.add(getArrowOneImg());<NEW_LINE>if (count == 2) {<NEW_LINE>imgList.add(getArrowTwoImg());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (settings.MARKERS_DISTANCE_INDICATION_ENABLED.get()) {<NEW_LINE>if (settings.MAP_MARKERS_MODE.get().isWidgets()) {<NEW_LINE>imgList.add(getWidget1Img());<NEW_LINE>if (count == 2) {<NEW_LINE>imgList.add(getWidget2Img());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>imgList.add(getTopBar1Img());<NEW_LINE>if (count == 2) {<NEW_LINE>imgList.add(getTopBar2Img());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>((ImageView) mainView.findViewById(R.id.action_bar_image)).setImageDrawable(new LayerDrawable(imgList.toArray(new Drawable[0])));<NEW_LINE>} else {<NEW_LINE>mainView.findViewById(R.id.action_bar_image_container).setVisibility(View.GONE);<NEW_LINE>}<NEW_LINE>}
imgList.add(getDeviceImg());
774,736
private PriamInstance claimToken(PriamInstance originalInstance) {<NEW_LINE>String hostIP = config.usePrivateIP() ? myInstanceInfo.getPrivateIP() : myInstanceInfo.getHostIP();<NEW_LINE>if (originalInstance.getInstanceId().equals(myInstanceInfo.getInstanceId()) && originalInstance.getHostName().equals(myInstanceInfo.getHostname()) && originalInstance.getHostIP().equals(hostIP) && originalInstance.getRac().equals(myInstanceInfo.getRac())) {<NEW_LINE>return originalInstance;<NEW_LINE>}<NEW_LINE>PriamInstance newInstance = new PriamInstance();<NEW_LINE>newInstance.<MASK><NEW_LINE>newInstance.setId(originalInstance.getId());<NEW_LINE>newInstance.setInstanceId(myInstanceInfo.getInstanceId());<NEW_LINE>newInstance.setHost(myInstanceInfo.getHostname());<NEW_LINE>newInstance.setHostIP(hostIP);<NEW_LINE>newInstance.setRac(myInstanceInfo.getRac());<NEW_LINE>newInstance.setVolumes(originalInstance.getVolumes());<NEW_LINE>newInstance.setToken(originalInstance.getToken());<NEW_LINE>newInstance.setDC(originalInstance.getDC());<NEW_LINE>try {<NEW_LINE>factory.update(originalInstance, newInstance);<NEW_LINE>} catch (Exception ex) {<NEW_LINE>long sleepTime = randomizer.nextInt(MAX_VALUE_IN_MILISECS);<NEW_LINE>String token = newInstance.getToken();<NEW_LINE>logger.warn("Failed updating token: {}; sleeping {} millis", token, sleepTime);<NEW_LINE>sleeper.sleepQuietly(sleepTime);<NEW_LINE>throw ex;<NEW_LINE>}<NEW_LINE>return newInstance;<NEW_LINE>}
setApp(config.getAppName());
464,826
protected RowData convertToRow(Result result, GenericRowData resultRow, GenericRowData[] familyRows) {<NEW_LINE>for (int i = 0; i < fieldLength; i++) {<NEW_LINE>if (rowkeyIndex == i) {<NEW_LINE>assert keyDecoder != null;<NEW_LINE>Object rowkey = keyDecoder.decode(result.getRow());<NEW_LINE>resultRow.setField(rowkeyIndex, rowkey);<NEW_LINE>} else {<NEW_LINE>int f = (rowkeyIndex != -1 && i > <MASK><NEW_LINE>// get family key<NEW_LINE>byte[] familyKey = families[f];<NEW_LINE>GenericRowData familyRow = familyRows[f];<NEW_LINE>for (int q = 0; q < this.qualifiers[f].length; q++) {<NEW_LINE>// get quantifier key<NEW_LINE>byte[] qualifier = qualifiers[f][q];<NEW_LINE>// read value<NEW_LINE>byte[] value = result.getValue(familyKey, qualifier);<NEW_LINE>familyRow.setField(q, qualifierDecoders[f][q].decode(value));<NEW_LINE>}<NEW_LINE>resultRow.setField(i, familyRow);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return resultRow;<NEW_LINE>}
rowkeyIndex) ? i - 1 : i;
1,444,709
public byte[] doInTransform(Instrumentor instrumentor, ClassLoader loader, String className, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) throws InstrumentException {<NEW_LINE>if (className.equals(CLASS_STATEMENT)) {<NEW_LINE>if (instrumentor.exist(loader, CLASS_STATEMENT_WRAPPER, protectionDomain)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>InstrumentClass target = instrumentor.getInstrumentClass(loader, className, classfileBuffer);<NEW_LINE>target.addField(DatabaseInfoAccessor.class);<NEW_LINE>final Class<? extends Interceptor> executeQueryInterceptor = StatementExecuteQueryInterceptor.class;<NEW_LINE>InstrumentUtils.findMethod(target, "executeQuery", "java.lang.String").addScopedInterceptor(executeQueryInterceptor, ORACLE_SCOPE);<NEW_LINE>final Class<? <MASK><NEW_LINE>InstrumentUtils.findMethod(target, "executeUpdate", "java.lang.String").addScopedInterceptor(executeUpdateInterceptor, ORACLE_SCOPE);<NEW_LINE>InstrumentUtils.findMethod(target, "executeUpdate", "java.lang.String", "int").addScopedInterceptor(executeUpdateInterceptor, ORACLE_SCOPE);<NEW_LINE>InstrumentUtils.findMethod(target, "execute", "java.lang.String").addScopedInterceptor(executeUpdateInterceptor, ORACLE_SCOPE);<NEW_LINE>InstrumentUtils.findMethod(target, "execute", "java.lang.String", "int").addScopedInterceptor(executeUpdateInterceptor, ORACLE_SCOPE);<NEW_LINE>return target.toBytecode();<NEW_LINE>}
extends Interceptor> executeUpdateInterceptor = StatementExecuteUpdateInterceptor.class;
1,377,450
public void processStream(InputStream input) throws IOException {<NEW_LINE>BufferedReader in = new BufferedReader(new InputStreamReader(input));<NEW_LINE>String line = "";<NEW_LINE>int lineno = 0;<NEW_LINE>boolean hasStarted = false;<NEW_LINE>Matcher matcher = ANNOTATE_PATTERN.matcher(line);<NEW_LINE>while ((line = in.readLine()) != null) {<NEW_LINE>// Skip header<NEW_LINE>if (!hasStarted && (line.length() == 0 || !Character.isDigit(line.charAt(0)))) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>hasStarted = true;<NEW_LINE>// Start parsing<NEW_LINE>++lineno;<NEW_LINE>matcher.reset(line);<NEW_LINE>if (matcher.find()) {<NEW_LINE>String <MASK><NEW_LINE>String author = matcher.group(2).trim();<NEW_LINE>annotation.addLine(rev, author, true);<NEW_LINE>} else {<NEW_LINE>LOGGER.log(Level.SEVERE, "Error: did not find annotation in line {0}: [{1}]", new Object[] { String.valueOf(lineno), line });<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
rev = matcher.group(1);
1,659,539
// ==================================================================================================================<NEW_LINE>private static VariantContext annotateWithImpreciseEvidenceLinks(final VariantContext variant, final PairedStrandedIntervalTree<EvidenceTargetLink> evidenceTargetLinks, final SAMSequenceDictionary referenceSequenceDictionary, final ReadMetadata metadata, final int defaultUncertainty) {<NEW_LINE>if (variant.getStructuralVariantType() == StructuralVariantType.DEL) {<NEW_LINE>SVContext svc = SVContext.of(variant);<NEW_LINE>final int padding = (metadata == null) ? defaultUncertainty : (metadata.getMaxMedianFragmentSize() / 2);<NEW_LINE>PairedStrandedIntervals svcIntervals = svc.getPairedStrandedIntervals(metadata, referenceSequenceDictionary, padding);<NEW_LINE>final Iterator<Tuple2<PairedStrandedIntervals, EvidenceTargetLink>> <MASK><NEW_LINE>int readPairs = 0;<NEW_LINE>int splitReads = 0;<NEW_LINE>while (overlappers.hasNext()) {<NEW_LINE>final Tuple2<PairedStrandedIntervals, EvidenceTargetLink> next = overlappers.next();<NEW_LINE>readPairs += next._2.getReadPairs();<NEW_LINE>splitReads += next._2.getSplitReads();<NEW_LINE>overlappers.remove();<NEW_LINE>}<NEW_LINE>final VariantContextBuilder variantContextBuilder = new VariantContextBuilder(variant);<NEW_LINE>if (readPairs > 0) {<NEW_LINE>variantContextBuilder.attribute(GATKSVVCFConstants.READ_PAIR_SUPPORT, readPairs);<NEW_LINE>}<NEW_LINE>if (splitReads > 0) {<NEW_LINE>variantContextBuilder.attribute(GATKSVVCFConstants.SPLIT_READ_SUPPORT, splitReads);<NEW_LINE>}<NEW_LINE>return variantContextBuilder.make();<NEW_LINE>} else {<NEW_LINE>return variant;<NEW_LINE>}<NEW_LINE>}
overlappers = evidenceTargetLinks.overlappers(svcIntervals);
646,133
private void renderRestOfShapes() {<NEW_LINE>ArrayList<DiagramShape> shapes = diagram.getAllDiagramShapes();<NEW_LINE>ArrayList<DiagramShape> <MASK><NEW_LINE>shapes.sort(new ShapeAreaComparator());<NEW_LINE>for (DiagramShape shape : shapes) {<NEW_LINE>if (shape.getType() == DiagramShape.TYPE_POINT_MARKER) {<NEW_LINE>pointMarkers.add(shape);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (shape.getType() == DiagramShape.TYPE_STORAGE) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (shape.getType() == DiagramShape.TYPE_CUSTOM) {<NEW_LINE>// renderCustomShape(shape, g2);<NEW_LINE>// continue;<NEW_LINE>throw new RuntimeException("Not yet implemented");<NEW_LINE>}<NEW_LINE>if (shape.getPoints().isEmpty())<NEW_LINE>continue;<NEW_LINE>GeneralPath path = shape.makeIntoRenderPath(diagram, options);<NEW_LINE>SVGCommands commands = new SVGCommands(path);<NEW_LINE>renderPath(shape, commands);<NEW_LINE>}<NEW_LINE>renderPointMarkers(pointMarkers);<NEW_LINE>}
pointMarkers = new ArrayList<>();
69,648
public static void main(String[] args) {<NEW_LINE>final String queue_name = "testQueue" + new Date().getTime();<NEW_LINE>AmazonSQS sqs = AmazonSQSClientBuilder.defaultClient();<NEW_LINE>// first, create a queue (unless it exists already)<NEW_LINE>try {<NEW_LINE>CreateQueueResult cq_result = sqs.createQueue(queue_name);<NEW_LINE>} catch (AmazonSQSException e) {<NEW_LINE>if (!e.getErrorCode().equals("QueueAlreadyExists")) {<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final String queue_url = sqs.<MASK><NEW_LINE>// Send some messages to the queue<NEW_LINE>for (int i = 0; i < 20; i++) {<NEW_LINE>sqs.sendMessage(queue_url, "This is message " + i);<NEW_LINE>}<NEW_LINE>// change visibility timeout (single)<NEW_LINE>// 1 hour<NEW_LINE>changeMessageVisibilitySingle(queue_url, 60 * 60);<NEW_LINE>// change visibility timeout (multiple)<NEW_LINE>// 30 minutes<NEW_LINE>changeMessageVisibilityMultiple(queue_url, 30 * 60);<NEW_LINE>}
getQueueUrl(queue_name).getQueueUrl();
1,331,934
private TIntLongHashMap readPoiNameIndex(Collator instance, String query, SearchRequest<Amenity> req) throws IOException {<NEW_LINE>TIntLongHashMap offsets = new TIntLongHashMap();<NEW_LINE>List<TIntArrayList> listOffsets = null;<NEW_LINE>List<TIntLongHashMap> listOfSepOffsets = new ArrayList<TIntLongHashMap>();<NEW_LINE>int offset = 0;<NEW_LINE>while (true) {<NEW_LINE>int t = codedIS.readTag();<NEW_LINE>int tag = WireFormat.getTagFieldNumber(t);<NEW_LINE>switch(tag) {<NEW_LINE>case 0:<NEW_LINE>return offsets;<NEW_LINE>case OsmandOdb.OsmAndPoiNameIndex.TABLE_FIELD_NUMBER:<NEW_LINE>{<NEW_LINE>int length = readInt();<NEW_LINE>int oldLimit = codedIS.pushLimit(length);<NEW_LINE>offset = codedIS.getTotalBytesRead();<NEW_LINE>List<String> queries = Algorithms.splitByWordsLowercase(query);<NEW_LINE>TIntArrayList charsList = new TIntArrayList(queries.size());<NEW_LINE>listOffsets = new ArrayList<TIntArrayList>(queries.size());<NEW_LINE>while (listOffsets.size() < queries.size()) {<NEW_LINE>charsList.add(0);<NEW_LINE>listOffsets.add(new TIntArrayList());<NEW_LINE>}<NEW_LINE>map.readIndexedStringTable(instance, queries, "", listOffsets, charsList);<NEW_LINE>codedIS.popLimit(oldLimit);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case OsmandOdb.OsmAndPoiNameIndex.DATA_FIELD_NUMBER:<NEW_LINE>{<NEW_LINE>if (listOffsets != null) {<NEW_LINE>for (TIntArrayList dataOffsets : listOffsets) {<NEW_LINE>TIntLongHashMap offsetMap = new TIntLongHashMap();<NEW_LINE>listOfSepOffsets.add(offsetMap);<NEW_LINE>// 1104125<NEW_LINE>dataOffsets.sort();<NEW_LINE>for (int i = 0; i < dataOffsets.size(); i++) {<NEW_LINE>codedIS.seek(dataOffsets.get(i) + offset);<NEW_LINE>int len = codedIS.readRawVarint32();<NEW_LINE>int oldLim = codedIS.pushLimit(len);<NEW_LINE>readPoiNameIndexData(offsetMap, req);<NEW_LINE>codedIS.popLimit(oldLim);<NEW_LINE>if (req.isCancelled()) {<NEW_LINE>codedIS.skipRawBytes(codedIS.getBytesUntilLimit());<NEW_LINE>return offsets;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (listOfSepOffsets.size() > 0) {<NEW_LINE>offsets.putAll(listOfSepOffsets.get(0));<NEW_LINE>for (int j = 1; j < listOfSepOffsets.size(); j++) {<NEW_LINE>TIntLongHashMap mp = listOfSepOffsets.get(j);<NEW_LINE>// offsets.retainAll(mp); -- calculate intresection of mp & offsets<NEW_LINE>for (int chKey : offsets.keys()) {<NEW_LINE>if (!mp.containsKey(chKey)) {<NEW_LINE>offsets.remove(chKey);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>codedIS.<MASK><NEW_LINE>return offsets;<NEW_LINE>}<NEW_LINE>default:<NEW_LINE>skipUnknownField(t);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
skipRawBytes(codedIS.getBytesUntilLimit());
956,702
public static Point2D showText(PdfContentByte cb, BaseFont baseFont, float fontSize, String text) {<NEW_LINE>GlyphVector glyphVector = computeGlyphVector(baseFont, fontSize, text);<NEW_LINE>if (!hasAdjustments(glyphVector)) {<NEW_LINE>cb.showText(glyphVector);<NEW_LINE>Point2D p = glyphVector.getGlyphPosition(glyphVector.getNumGlyphs());<NEW_LINE>float dx = (float) p.getX();<NEW_LINE>float dy = (float) p.getY();<NEW_LINE>cb.moveTextBasic(dx, -dy);<NEW_LINE>return new Point2D.Double(-dx, dy);<NEW_LINE>}<NEW_LINE>float lastX = 0f;<NEW_LINE>float lastY = 0f;<NEW_LINE>for (int i = 0; i < glyphVector.getNumGlyphs(); i++) {<NEW_LINE>Point2D p = glyphVector.getGlyphPosition(i);<NEW_LINE>float dx = (float) p.getX() - lastX;<NEW_LINE>float dy = (float) p.getY() - lastY;<NEW_LINE>cb.moveTextBasic(dx, -dy);<NEW_LINE>cb.showText(glyphVector, i, i + 1);<NEW_LINE>lastX = (float) p.getX();<NEW_LINE>lastY = (float) p.getY();<NEW_LINE>}<NEW_LINE>Point2D p = glyphVector.<MASK><NEW_LINE>float dx = (float) p.getX() - lastX;<NEW_LINE>float dy = (float) p.getY() - lastY;<NEW_LINE>cb.moveTextBasic(dx, -dy);<NEW_LINE>return new Point2D.Double(-p.getX(), p.getY());<NEW_LINE>}
getGlyphPosition(glyphVector.getNumGlyphs());
1,144,037
public static Map<String, Map<String, List<Pair<Integer, List<Object>>>>> buildResultForShardingTable(String schemaName, String logicalTableName, List<List<Object>> values, List<ColumnMeta> skMetas, Mapping skMapping, Mapping pkMapping, ExecutionContext ec, boolean isGetShardResultForReplicationTable) {<NEW_LINE>// targetDb: { targetTb: [{ rowIndex, [pk1, pk2] }] }<NEW_LINE>final Map<String, Map<String, List<org.apache.calcite.util.Pair<Integer, List<Object>>>>> result = new HashMap<>();<NEW_LINE>// Foreach row to be updated or deleted<NEW_LINE>final List<String> skNames = skMetas.stream().map(ColumnMeta::getName).collect(Collectors.toList());<NEW_LINE>for (int i = 0; i < values.size(); i++) {<NEW_LINE>List<Object> row = values.get(i);<NEW_LINE>// Shard<NEW_LINE>List<Object> skValues = Mappings.permute(row, skMapping).stream().map(value -> {<NEW_LINE>if (value instanceof ZeroDate || value instanceof ZeroTime || value instanceof ZeroTimestamp) {<NEW_LINE>// For date like "0000-00-00" partition result is different for ZeroDate and String.<NEW_LINE>// INSERT and SELECT use String data type, so UPDATE/DELETE here should keep same.<NEW_LINE>return value.toString();<NEW_LINE>}<NEW_LINE>return value;<NEW_LINE>}).collect(Collectors.toList());<NEW_LINE>Pair<String, String> dbAndTable = BuildPlanUtils.shardSingleRow(skValues, skMetas, skNames, logicalTableName, schemaName, ec, isGetShardResultForReplicationTable, ec.getSchemaManager(<MASK><NEW_LINE>// Add primary keys to the map<NEW_LINE>List<Object> primaryKeyValues = Mappings.permute(row, pkMapping);<NEW_LINE>result.computeIfAbsent(dbAndTable.getKey(), b -> new HashMap<>()).computeIfAbsent(dbAndTable.getValue(), b -> new ArrayList<>()).add(org.apache.calcite.util.Pair.of(i, primaryKeyValues));<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
schemaName).getTable(logicalTableName));
802,318
public void add(long member) {<NEW_LINE>assert member >= 0;<NEW_LINE>int prefix = (int) (member >>> Integer.SIZE);<NEW_LINE>if (prefix == lastPrefix) {<NEW_LINE>Storage32 newStorage = lastStorage<MASK><NEW_LINE>if (newStorage != lastStorage) {<NEW_LINE>// storage was upgraded<NEW_LINE>lastStorage = newStorage;<NEW_LINE>storages.set(prefix, newStorage);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>lastPrefix = prefix;<NEW_LINE>Storage32 storage = storages.get(prefix);<NEW_LINE>if (storage == null) {<NEW_LINE>Storage32 createdStorage = new ArrayStorage32((int) member);<NEW_LINE>lastStorage = createdStorage;<NEW_LINE>storages.set(prefix, createdStorage);<NEW_LINE>} else {<NEW_LINE>Storage32 newStorage = storage.add((int) member);<NEW_LINE>if (newStorage == storage) {<NEW_LINE>lastStorage = storage;<NEW_LINE>} else {<NEW_LINE>// storage was upgraded<NEW_LINE>lastStorage = newStorage;<NEW_LINE>storages.set(prefix, newStorage);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.add((int) member);
115,160
public Action onFragment(final DirectBuffer buffer, final int offset, final int length, final Header header) {<NEW_LINE>Action action = Action.CONTINUE;<NEW_LINE>final byte flags = header.flags();<NEW_LINE>if ((flags & UNFRAGMENTED) == UNFRAGMENTED) {<NEW_LINE>action = onMessage(buffer, offset, header);<NEW_LINE>} else {<NEW_LINE>if ((flags & BEGIN_FRAG_FLAG) == BEGIN_FRAG_FLAG) {<NEW_LINE>builder.reset().append(buffer, offset, length);<NEW_LINE>} else {<NEW_LINE>final <MASK><NEW_LINE>if (limit > 0) {<NEW_LINE>builder.append(buffer, offset, length);<NEW_LINE>if ((flags & END_FRAG_FLAG) == END_FRAG_FLAG) {<NEW_LINE>action = onMessage(builder.buffer(), 0, header);<NEW_LINE>if (Action.ABORT == action) {<NEW_LINE>builder.limit(limit);<NEW_LINE>} else {<NEW_LINE>builder.reset();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return action;<NEW_LINE>}
int limit = builder.limit();
1,127,016
public com.amazonaws.services.fsx.model.StorageVirtualMachineNotFoundException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.fsx.model.StorageVirtualMachineNotFoundException storageVirtualMachineNotFoundException = new com.amazonaws.services.fsx.model.StorageVirtualMachineNotFoundException(null);<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return storageVirtualMachineNotFoundException;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
596,372
public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {<NEW_LINE>String requestUri = request.getRequestURI();<NEW_LINE>int pos = requestUri.lastIndexOf('.');<NEW_LINE>if (pos > -1) {<NEW_LINE>// interception for favicon.ico<NEW_LINE>if (requestUri.indexOf("favicon.ico") > -1) {<NEW_LINE>requestUri = "/images/logo-x32.png";<NEW_LINE>}<NEW_LINE>InputStream is = this.getClass().getResourceAsStream("/res" + requestUri);<NEW_LINE>if (is == null) {<NEW_LINE>response.setStatus(HttpServletResponse.SC_NOT_FOUND);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String ext = <MASK><NEW_LINE>String mimeType = mimeMap.get(ext);<NEW_LINE>if (mimeType == null) {<NEW_LINE>mimeType = "application/octet-stream";<NEW_LINE>}<NEW_LINE>response.setHeader("Content-Type", mimeType);<NEW_LINE>ServletOutputStream sos = response.getOutputStream();<NEW_LINE>BufferedInputStream bis = new BufferedInputStream(is);<NEW_LINE>int len = 0;<NEW_LINE>byte[] b = new byte[4096];<NEW_LINE>while ((len = bis.read(b)) > 0) {<NEW_LINE>sos.write(b, 0, len);<NEW_LINE>}<NEW_LINE>sos.flush();<NEW_LINE>baseRequest.setHandled(true);<NEW_LINE>}<NEW_LINE>}
requestUri.substring(pos + 1);
1,623,820
public void updateFileListModel(File currentlySelectedDirectory, boolean keepSelectionsAndReferences) {<NEW_LINE>// make sure this happens on the event dispatch thread, since it can be called from, for example, a background thread that is writing the files<NEW_LINE>SwingUtilities.invokeLater(() -> {<NEW_LINE>try {<NEW_LINE>getFrmMoviescraper().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));<NEW_LINE>File<MASK><NEW_LINE>List<File> selectValuesListBeforeUpdate = getFileList().getSelectedValuesList();<NEW_LINE>// We don't want to fire the listeners events when reselecting the items because this<NEW_LINE>// will cause us additional IO that is not needed as the program rereads the nfo.<NEW_LINE>// To avoid this, we can save out the old listener, remove it, select the items and then add it back<NEW_LINE>ListSelectionListener[] fileListSelectionListener = null;<NEW_LINE>if (keepSelectionsAndReferences) {<NEW_LINE>fileListSelectionListener = getFileList().getListSelectionListeners();<NEW_LINE>getFileList().removeListSelectionListener(getFileList().getListSelectionListeners()[0]);<NEW_LINE>}<NEW_LINE>listModelFiles.removeAllElements();<NEW_LINE>for (File file : filesToList) {<NEW_LINE>listModelFiles.addElement(file);<NEW_LINE>}<NEW_LINE>if (!keepSelectionsAndReferences) {<NEW_LINE>removeOldScrapedMovieReferences();<NEW_LINE>removeOldSelectedFileReferences();<NEW_LINE>}<NEW_LINE>// select the old values we had before we updated the list<NEW_LINE>for (File currentValueToSelect : selectValuesListBeforeUpdate) {<NEW_LINE>getFileList().setSelectedValue(currentValueToSelect, false);<NEW_LINE>}<NEW_LINE>if (keepSelectionsAndReferences && fileListSelectionListener != null) {<NEW_LINE>getFileList().addListSelectionListener(fileListSelectionListener[0]);<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>getFrmMoviescraper().setCursor(Cursor.getDefaultCursor());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
[] filesToList = showFileListSorted(currentlySelectedDirectory);
136,434
/*<NEW_LINE>* Ensures that this.macInstance is initialized<NEW_LINE>* In-case of credential change, optimistically will try to refresh the macInstance<NEW_LINE>*<NEW_LINE>* Implementation is non-blocking, the one which acquire the lock will try to refresh<NEW_LINE>* with new credentials<NEW_LINE>*<NEW_LINE>* NOTE: Calling it CTOR ensured that default is initialized.<NEW_LINE>*/<NEW_LINE>private void reInitializeIfPossible() {<NEW_LINE>// Java == operator is reference equals not content<NEW_LINE>// leveraging reference comparison avoid hash computation<NEW_LINE>if (this.currentCredentialKey != this.credential.getKey()) {<NEW_LINE>// Try to acquire the lock, the one who got lock will try to refresh the macInstance<NEW_LINE>boolean lockAcquired = this.macInstanceLock.tryLock();<NEW_LINE>if (lockAcquired) {<NEW_LINE>try {<NEW_LINE>if (this.currentCredentialKey != this.credential.getKey()) {<NEW_LINE>byte[] masterKeyBytes = this.credential.getKey().getBytes(StandardCharsets.UTF_8);<NEW_LINE>byte[] masterKeyDecodedBytes = Utils.Base64Decoder.decode(masterKeyBytes);<NEW_LINE>SecretKey signingKey = new SecretKeySpec(masterKeyDecodedBytes, "HMACSHA256");<NEW_LINE>try {<NEW_LINE>Mac <MASK><NEW_LINE>macInstance.init(signingKey);<NEW_LINE>this.currentCredentialKey = this.credential.getKey();<NEW_LINE>this.macPool = new MacPool(macInstance);<NEW_LINE>} catch (NoSuchAlgorithmException | InvalidKeyException e) {<NEW_LINE>throw new IllegalStateException(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>this.macInstanceLock.unlock();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
macInstance = Mac.getInstance("HMACSHA256");
175,524
Node processFormalParameterList(FormalParameterListTree tree) {<NEW_LINE>Node params = newNode(Token.PARAM_LIST);<NEW_LINE>params.setTrailingComma(tree.hasTrailingComma);<NEW_LINE>if (!checkParameters(tree)) {<NEW_LINE>return params;<NEW_LINE>}<NEW_LINE>ImmutableList<MASK><NEW_LINE>List<SourcePosition> zones = getEndOfArgCommentZones(parameters, tree.commaPositions, tree.location.end);<NEW_LINE>int argCount = 0;<NEW_LINE>for (ParseTree param : tree.parameters) {<NEW_LINE>final Node paramNode;<NEW_LINE>switch(param.type) {<NEW_LINE>case DEFAULT_PARAMETER:<NEW_LINE>// processDefaultParameter() knows how to find and apply inline JSDoc to the right node<NEW_LINE>paramNode = processDefaultParameter(param.asDefaultParameter());<NEW_LINE>break;<NEW_LINE>case ITER_REST:<NEW_LINE>maybeWarnForFeature(param, Feature.REST_PARAMETERS);<NEW_LINE>paramNode = transformNodeWithInlineComments(param);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>paramNode = transformNodeWithInlineComments(param);<NEW_LINE>// Reusing the logic to attach trailing comments used from call-site argsList<NEW_LINE>attachPossibleTrailingCommentsForArg(paramNode, zones.get(argCount));<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>// Children must be simple names, default parameters, rest<NEW_LINE>// parameters, or destructuring patterns.<NEW_LINE>checkState(paramNode.isName() || paramNode.isRest() || paramNode.isArrayPattern() || paramNode.isObjectPattern() || paramNode.isDefaultValue());<NEW_LINE>params.addChildToBack(paramNode);<NEW_LINE>argCount++;<NEW_LINE>}<NEW_LINE>return params;<NEW_LINE>}
<ParseTree> parameters = tree.parameters;
1,013,820
public List<File> doCheck() throws SystemCheckException {<NEW_LINE>File walFolderFile = SystemFileFactory.INSTANCE.getFile(walFolder);<NEW_LINE>logger.info("Checking folder: {}", walFolderFile.getAbsolutePath());<NEW_LINE>if (!walFolderFile.exists() || !walFolderFile.isDirectory()) {<NEW_LINE>throw new SystemCheckException(walFolder);<NEW_LINE>}<NEW_LINE>File[] storageWalFolders = walFolderFile.listFiles();<NEW_LINE>if (storageWalFolders == null || storageWalFolders.length == 0) {<NEW_LINE>logger.info("No sub-directories under the given directory, check ends");<NEW_LINE>return Collections.emptyList();<NEW_LINE>}<NEW_LINE>List<File> <MASK><NEW_LINE>for (int dirIndex = 0; dirIndex < storageWalFolders.length; dirIndex++) {<NEW_LINE>File storageWalFolder = storageWalFolders[dirIndex];<NEW_LINE>logger.info("Checking the No.{} directory {}", dirIndex, storageWalFolder.getName());<NEW_LINE>File walFile = SystemFileFactory.INSTANCE.getFile(storageWalFolder, WAL_FILE_NAME);<NEW_LINE>if (!checkFile(walFile)) {<NEW_LINE>failedFiles.add(walFile);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return failedFiles;<NEW_LINE>}
failedFiles = new ArrayList<>();
1,040,863
public static DeleteCompliancePacksResponse unmarshall(DeleteCompliancePacksResponse deleteCompliancePacksResponse, UnmarshallerContext _ctx) {<NEW_LINE>deleteCompliancePacksResponse.setRequestId(_ctx.stringValue("DeleteCompliancePacksResponse.RequestId"));<NEW_LINE>OperateCompliancePacksResult operateCompliancePacksResult = new OperateCompliancePacksResult();<NEW_LINE>List<OperateCompliancePacksItem> operateCompliancePacks = new ArrayList<OperateCompliancePacksItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DeleteCompliancePacksResponse.OperateCompliancePacksResult.OperateCompliancePacks.Length"); i++) {<NEW_LINE>OperateCompliancePacksItem operateCompliancePacksItem = new OperateCompliancePacksItem();<NEW_LINE>operateCompliancePacksItem.setCompliancePackId(_ctx.stringValue<MASK><NEW_LINE>operateCompliancePacksItem.setErrorCode(_ctx.stringValue("DeleteCompliancePacksResponse.OperateCompliancePacksResult.OperateCompliancePacks[" + i + "].ErrorCode"));<NEW_LINE>operateCompliancePacksItem.setSuccess(_ctx.booleanValue("DeleteCompliancePacksResponse.OperateCompliancePacksResult.OperateCompliancePacks[" + i + "].Success"));<NEW_LINE>operateCompliancePacks.add(operateCompliancePacksItem);<NEW_LINE>}<NEW_LINE>operateCompliancePacksResult.setOperateCompliancePacks(operateCompliancePacks);<NEW_LINE>deleteCompliancePacksResponse.setOperateCompliancePacksResult(operateCompliancePacksResult);<NEW_LINE>return deleteCompliancePacksResponse;<NEW_LINE>}
("DeleteCompliancePacksResponse.OperateCompliancePacksResult.OperateCompliancePacks[" + i + "].CompliancePackId"));
254,336
public SConcreteRevision convertToSObject(ConcreteRevision input) {<NEW_LINE>if (input == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>SConcreteRevision result = new SConcreteRevision();<NEW_LINE>result.setOid(input.getOid());<NEW_LINE>result.setUuid(input.getUuid());<NEW_LINE>result.setRid(input.getRid());<NEW_LINE>result.setId(input.getId());<NEW_LINE>result.setChecksum(input.getChecksum());<NEW_LINE>result.setSize(input.getSize());<NEW_LINE>result.setDate(input.getDate());<NEW_LINE>result.setLastError(input.getLastError());<NEW_LINE>result.setClear(input.isClear());<NEW_LINE>result.setOidCounters(input.getOidCounters());<NEW_LINE>result.setMultiplierToMm(input.getMultiplierToMm());<NEW_LINE>Project projectVal = input.getProject();<NEW_LINE>result.setProjectId(projectVal == null ? -1 : projectVal.getOid());<NEW_LINE>List<Long> listrevisions = new ArrayList<Long>();<NEW_LINE>for (Revision v : input.getRevisions()) {<NEW_LINE>listrevisions.add(v.getOid());<NEW_LINE>}<NEW_LINE>result.setRevisions(listrevisions);<NEW_LINE>RevisionSummary summaryVal = input.getSummary();<NEW_LINE>result.setSummaryId(summaryVal == null ? -1 : summaryVal.getOid());<NEW_LINE>User userVal = input.getUser();<NEW_LINE>result.setUserId(userVal == null ? -1 : userVal.getOid());<NEW_LINE><MASK><NEW_LINE>result.setIfcHeaderId(ifcHeaderVal == null ? -1 : ifcHeaderVal.getOid());<NEW_LINE>Bounds boundsVal = input.getBounds();<NEW_LINE>result.setBounds(convertToSObject(boundsVal));<NEW_LINE>Bounds boundsUntransformedVal = input.getBoundsUntransformed();<NEW_LINE>result.setBoundsUntransformed(convertToSObject(boundsUntransformedVal));<NEW_LINE>DensityCollection densityCollectionVal = input.getDensityCollection();<NEW_LINE>result.setDensityCollectionId(densityCollectionVal == null ? -1 : densityCollectionVal.getOid());<NEW_LINE>return result;<NEW_LINE>}
IfcHeader ifcHeaderVal = input.getIfcHeader();
1,792,584
public static ListAlarmContactGroupsResponse unmarshall(ListAlarmContactGroupsResponse listAlarmContactGroupsResponse, UnmarshallerContext _ctx) {<NEW_LINE>listAlarmContactGroupsResponse.setRequestId(_ctx.stringValue("ListAlarmContactGroupsResponse.RequestId"));<NEW_LINE>listAlarmContactGroupsResponse.setHttpCode(_ctx.stringValue("ListAlarmContactGroupsResponse.HttpCode"));<NEW_LINE>listAlarmContactGroupsResponse.setTotalCount(_ctx.integerValue("ListAlarmContactGroupsResponse.TotalCount"));<NEW_LINE>listAlarmContactGroupsResponse.setMessage(_ctx.stringValue("ListAlarmContactGroupsResponse.Message"));<NEW_LINE>listAlarmContactGroupsResponse.setPageSize<MASK><NEW_LINE>listAlarmContactGroupsResponse.setPageNumber(_ctx.integerValue("ListAlarmContactGroupsResponse.PageNumber"));<NEW_LINE>listAlarmContactGroupsResponse.setErrorCode(_ctx.stringValue("ListAlarmContactGroupsResponse.ErrorCode"));<NEW_LINE>listAlarmContactGroupsResponse.setSuccess(_ctx.booleanValue("ListAlarmContactGroupsResponse.Success"));<NEW_LINE>List<AlarmContactGroupModel> data = new ArrayList<AlarmContactGroupModel>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListAlarmContactGroupsResponse.Data.Length"); i++) {<NEW_LINE>AlarmContactGroupModel alarmContactGroupModel = new AlarmContactGroupModel();<NEW_LINE>alarmContactGroupModel.setContactGroupName(_ctx.stringValue("ListAlarmContactGroupsResponse.Data[" + i + "].ContactGroupName"));<NEW_LINE>alarmContactGroupModel.setContactGroupId(_ctx.stringValue("ListAlarmContactGroupsResponse.Data[" + i + "].ContactGroupId"));<NEW_LINE>data.add(alarmContactGroupModel);<NEW_LINE>}<NEW_LINE>listAlarmContactGroupsResponse.setData(data);<NEW_LINE>return listAlarmContactGroupsResponse;<NEW_LINE>}
(_ctx.integerValue("ListAlarmContactGroupsResponse.PageSize"));
865,036
public void marshall(CreateEntityRequest createEntityRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (createEntityRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(createEntityRequest.getComponents(), COMPONENTS_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(createEntityRequest.getEntityId(), ENTITYID_BINDING);<NEW_LINE>protocolMarshaller.marshall(createEntityRequest.getEntityName(), ENTITYNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(createEntityRequest.getParentEntityId(), PARENTENTITYID_BINDING);<NEW_LINE>protocolMarshaller.marshall(createEntityRequest.getTags(), TAGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(createEntityRequest.getWorkspaceId(), WORKSPACEID_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
createEntityRequest.getDescription(), DESCRIPTION_BINDING);
1,317,821
public static void main(String[] args) throws Exception {<NEW_LINE>TopologyBuilder builder = new TopologyBuilder();<NEW_LINE>builder.setSpout("word0", new TestWordSpout(), 2);<NEW_LINE>builder.setSpout("word1", new TestWordSpout(), 2);<NEW_LINE>builder.setSpout("word2", new TestWordSpout(), 2);<NEW_LINE>builder.setBolt("exclaim1", new ExclamationBolt(), 2).shuffleGrouping("word0").shuffleGrouping("word1").shuffleGrouping("word2");<NEW_LINE>Config conf = new Config();<NEW_LINE>conf.setDebug(true);<NEW_LINE>conf.setMaxSpoutPending(10);<NEW_LINE>conf.put(Config.TOPOLOGY_WORKER_CHILDOPTS, "-XX:+HeapDumpOnOutOfMemoryError");<NEW_LINE>// component resource configuration<NEW_LINE>conf.setComponentRam(<MASK><NEW_LINE>conf.setComponentRam("word1", ExampleResources.getComponentRam());<NEW_LINE>conf.setComponentRam("word2", ExampleResources.getComponentRam());<NEW_LINE>conf.setComponentRam("exclaim1", ExampleResources.getComponentRam());<NEW_LINE>// container resource configuration<NEW_LINE>conf.setContainerDiskRequested(ByteAmount.fromGigabytes(3));<NEW_LINE>conf.setContainerRamRequested(ByteAmount.fromGigabytes(5));<NEW_LINE>conf.setContainerCpuRequested(4);<NEW_LINE>if (args != null && args.length > 0) {<NEW_LINE>conf.setNumStmgrs(3);<NEW_LINE>HeronSubmitter.submitTopology(args[0], conf, builder.createTopology());<NEW_LINE>} else {<NEW_LINE>Simulator simulator = new Simulator();<NEW_LINE>simulator.submitTopology("test", conf, builder.createTopology());<NEW_LINE>Utils.sleep(10000);<NEW_LINE>simulator.killTopology("test");<NEW_LINE>simulator.shutdown();<NEW_LINE>}<NEW_LINE>}
"word0", ExampleResources.getComponentRam());
208,127
public static void createGlobalSimpleType(final Datatype d, final SchemaModel sm, final SchemaComponent sc, final SchemaGenerator.UniqueId id, SchemaGenerator.PrimitiveCart pc) {<NEW_LINE>if (d != null) {<NEW_LINE>NamedComponentReference<GlobalSimpleType> ref = null;<NEW_LINE>if (isPrimitiveType(d)) {<NEW_LINE>ref = SchemaGeneratorUtil.createPrimitiveType(d, sc, pc);<NEW_LINE>} else {<NEW_LINE>GlobalSimpleType gst = SchemaGeneratorUtil.createGlobalSimpleType(sm);<NEW_LINE>String typeName = d.getName();<NEW_LINE>StringBuilder buf = new StringBuilder();<NEW_LINE>buf.append("New" + typeName.substring(0, 1).toUpperCase() + typeName.substring(1) + "Type" + String.valueOf<MASK><NEW_LINE>String gstName = findUniqueGlobalName(GlobalSimpleType.class, buf.toString(), sm);<NEW_LINE>gst.setName(gstName);<NEW_LINE>sm.getSchema().addSimpleType(gst);<NEW_LINE>if (d instanceof CustomDatatype)<NEW_LINE>SchemaGeneratorUtil.populateSimpleType(((CustomDatatype) d).getBase(), sm, gst, pc);<NEW_LINE>else<NEW_LINE>SchemaGeneratorUtil.populateSimpleType(d, sm, gst, pc);<NEW_LINE>ref = sc.createReferenceTo(gst, GlobalSimpleType.class);<NEW_LINE>}<NEW_LINE>SchemaGeneratorUtil.setSimpleType(sc, ref);<NEW_LINE>}<NEW_LINE>}
(id.nextId()));
113,301
final CreateLoadBalancerPolicyResult executeCreateLoadBalancerPolicy(CreateLoadBalancerPolicyRequest createLoadBalancerPolicyRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createLoadBalancerPolicyRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateLoadBalancerPolicyRequest> request = null;<NEW_LINE>Response<CreateLoadBalancerPolicyResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateLoadBalancerPolicyRequestMarshaller().marshall(super.beforeMarshalling(createLoadBalancerPolicyRequest));<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, "Elastic Load Balancing");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateLoadBalancerPolicy");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<CreateLoadBalancerPolicyResult> responseHandler = new StaxResponseHandler<CreateLoadBalancerPolicyResult>(new CreateLoadBalancerPolicyResultStaxUnmarshaller());<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);
441,826
public void draw() throws Exception {<NEW_LINE>node("DeployAppDeciderNode");<NEW_LINE>node("DeployAppCreateComponentNode");<NEW_LINE>node("DeployAppCreateResourceAddonNode");<NEW_LINE>node("DeployAppCreateCustomAddonNode");<NEW_LINE>node("DeployAppWaitComponentNode");<NEW_LINE>node("DeployAppWaitAddonNode");<NEW_LINE>node("DeployAppWaitCustomAddonNode");<NEW_LINE>node("DeployAppTraitNode");<NEW_LINE>edge("DeployAppDeciderNode", "DeployAppCreateComponentNode", String.format("#DeployAppDeciderNode['output']['%s'] == '%s' || " + "#DeployAppDeciderNode['output']['%s'] == '%s' || " + "#DeployAppDeciderNode['output']['%s'] == '%s' || " + "#DeployAppDeciderNode['output']['%s'] == '%s' || " + "#DeployAppDeciderNode['output']['%s'] == '%s'", AppFlowParamKey.COMPONENT_TYPE, ComponentTypeEnum.K8S_MICROSERVICE, AppFlowParamKey.COMPONENT_TYPE, ComponentTypeEnum.INTERNAL_ADDON, AppFlowParamKey.COMPONENT_TYPE, ComponentTypeEnum.ABM_CHART, AppFlowParamKey.COMPONENT_TYPE, ComponentTypeEnum.HELM, AppFlowParamKey.COMPONENT_TYPE, ComponentTypeEnum.K8S_JOB));<NEW_LINE>edge("DeployAppDeciderNode", "DeployAppCreateResourceAddonNode", String.format("#DeployAppDeciderNode['output']['%s'] == '%s'", AppFlowParamKey.COMPONENT_TYPE, ComponentTypeEnum.RESOURCE_ADDON));<NEW_LINE>edge("DeployAppDeciderNode", "DeployAppTraitNode", String.format("#DeployAppDeciderNode['output']['%s'] == '%s'", AppFlowParamKey.COMPONENT_TYPE, ComponentTypeEnum.TRAIT_ADDON));<NEW_LINE>edge("DeployAppDeciderNode", "DeployAppCreateCustomAddonNode", String.format("#DeployAppDeciderNode['output']['%s'] == '%s'", AppFlowParamKey<MASK><NEW_LINE>edge("DeployAppCreateComponentNode", "DeployAppWaitComponentNode");<NEW_LINE>edge("DeployAppCreateResourceAddonNode", "DeployAppWaitAddonNode");<NEW_LINE>edge("DeployAppCreateCustomAddonNode", "DeployAppWaitCustomAddonNode");<NEW_LINE>}
.COMPONENT_TYPE, ComponentTypeEnum.CUSTOM_ADDON));
1,278,589
protected void serializeToByteBuffer(ByteBuffer buffer) {<NEW_LINE>buffer.put(rollback ? (byte) 1 : 0);<NEW_LINE>if (atomicOperationMetadataMap.size() > 0) {<NEW_LINE>for (final Map.Entry<String, OAtomicOperationMetadata<?>> entry : atomicOperationMetadataMap.entrySet()) {<NEW_LINE>if (entry.getKey().equals(ORecordOperationMetadata.RID_METADATA_KEY)) {<NEW_LINE>buffer.put((byte) 1);<NEW_LINE>final ORecordOperationMetadata recordOperationMetadata = (ORecordOperationMetadata) entry.getValue();<NEW_LINE>final Set<ORID> rids = recordOperationMetadata.getValue();<NEW_LINE>buffer.putInt(rids.size());<NEW_LINE>for (final ORID rid : rids) {<NEW_LINE>buffer.putLong(rid.getClusterPosition());<NEW_LINE>buffer.putInt(rid.getClusterId());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>buffer.put((byte) 0);<NEW_LINE>}<NEW_LINE>}
IllegalStateException("Invalid metadata key " + ORecordOperationMetadata.RID_METADATA_KEY);
1,016,335
private CanonicalSubscription canonicalizeR4(IBaseResource theSubscription) {<NEW_LINE>org.hl7.fhir.r4.model.Subscription subscription = (org.hl7.fhir.r4.model.Subscription) theSubscription;<NEW_LINE>CanonicalSubscription retVal = new CanonicalSubscription();<NEW_LINE>retVal.setStatus(subscription.getStatus());<NEW_LINE>retVal.setChannelType(getChannelType(theSubscription));<NEW_LINE>retVal.setCriteriaString(subscription.getCriteria());<NEW_LINE>retVal.setEndpointUrl(subscription.<MASK><NEW_LINE>retVal.setHeaders(subscription.getChannel().getHeader());<NEW_LINE>retVal.setChannelExtensions(extractExtension(subscription));<NEW_LINE>retVal.setIdElement(subscription.getIdElement());<NEW_LINE>retVal.setPayloadString(subscription.getChannel().getPayload());<NEW_LINE>retVal.setPayloadSearchCriteria(getExtensionString(subscription, HapiExtensions.EXT_SUBSCRIPTION_PAYLOAD_SEARCH_CRITERIA));<NEW_LINE>retVal.setTags(extractTags(subscription));<NEW_LINE>setPartitionIdOnReturnValue(theSubscription, retVal);<NEW_LINE>retVal.setCrossPartitionEnabled(SubscriptionUtil.isCrossPartition(theSubscription));<NEW_LINE>if (retVal.getChannelType() == CanonicalSubscriptionChannelType.EMAIL) {<NEW_LINE>String from;<NEW_LINE>String subjectTemplate;<NEW_LINE>try {<NEW_LINE>from = subscription.getChannel().getExtensionString(HapiExtensions.EXT_SUBSCRIPTION_EMAIL_FROM);<NEW_LINE>subjectTemplate = subscription.getChannel().getExtensionString(HapiExtensions.EXT_SUBSCRIPTION_SUBJECT_TEMPLATE);<NEW_LINE>} catch (FHIRException theE) {<NEW_LINE>throw new ConfigurationException(Msg.code(561) + "Failed to extract subscription extension(s): " + theE.getMessage(), theE);<NEW_LINE>}<NEW_LINE>retVal.getEmailDetails().setFrom(from);<NEW_LINE>retVal.getEmailDetails().setSubjectTemplate(subjectTemplate);<NEW_LINE>}<NEW_LINE>if (retVal.getChannelType() == CanonicalSubscriptionChannelType.RESTHOOK) {<NEW_LINE>String stripVersionIds;<NEW_LINE>String deliverLatestVersion;<NEW_LINE>try {<NEW_LINE>stripVersionIds = subscription.getChannel().getExtensionString(HapiExtensions.EXT_SUBSCRIPTION_RESTHOOK_STRIP_VERSION_IDS);<NEW_LINE>deliverLatestVersion = subscription.getChannel().getExtensionString(HapiExtensions.EXT_SUBSCRIPTION_RESTHOOK_DELIVER_LATEST_VERSION);<NEW_LINE>} catch (FHIRException theE) {<NEW_LINE>throw new ConfigurationException(Msg.code(562) + "Failed to extract subscription extension(s): " + theE.getMessage(), theE);<NEW_LINE>}<NEW_LINE>retVal.getRestHookDetails().setStripVersionId(Boolean.parseBoolean(stripVersionIds));<NEW_LINE>retVal.getRestHookDetails().setDeliverLatestVersion(Boolean.parseBoolean(deliverLatestVersion));<NEW_LINE>}<NEW_LINE>List<Extension> topicExts = subscription.getExtensionsByUrl("http://hl7.org/fhir/subscription/topics");<NEW_LINE>if (topicExts.size() > 0) {<NEW_LINE>IBaseReference ref = (IBaseReference) topicExts.get(0).getValueAsPrimitive();<NEW_LINE>if (!"EventDefinition".equals(ref.getReferenceElement().getResourceType())) {<NEW_LINE>throw new PreconditionFailedException(Msg.code(563) + "Topic reference must be an EventDefinition");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Extension extension = subscription.getExtensionByUrl(EX_SEND_DELETE_MESSAGES);<NEW_LINE>if (extension != null && extension.hasValue() && extension.getValue() instanceof BooleanType) {<NEW_LINE>retVal.setSendDeleteMessages(((BooleanType) extension.getValue()).booleanValue());<NEW_LINE>}<NEW_LINE>return retVal;<NEW_LINE>}
getChannel().getEndpoint());
846,994
private static void testStringMethods() {<NEW_LINE>String string1 = "string1";<NEW_LINE>String whitespaceString = string1 + " ";<NEW_LINE>assertTrue(whitespaceString.trim().equals(string1));<NEW_LINE>whitespaceString = " " + string1 + " ";<NEW_LINE>assertTrue(whitespaceString.trim().equals(string1));<NEW_LINE>// substring (start)<NEW_LINE>assertTrue(string1.substring(0).equals("string1"));<NEW_LINE>assertTrue(string1.substring(1).equals("tring1"));<NEW_LINE>assertTrue(string1.substring(<MASK><NEW_LINE>assertTrue(string1.substring(3).equals("ing1"));<NEW_LINE>assertTrue(string1.substring(4).equals("ng1"));<NEW_LINE>assertTrue(string1.substring(5).equals("g1"));<NEW_LINE>assertTrue(string1.substring(6).equals("1"));<NEW_LINE>assertTrue(string1.substring(7).equals(""));<NEW_LINE>// substring (start, end)<NEW_LINE>assertTrue(string1.substring(0, 2).equals("st"));<NEW_LINE>assertTrue(string1.substring(1, 5).equals("trin"));<NEW_LINE>}
2).equals("ring1"));
1,480,441
public boolean toolBarItemActivated(ToolBarItem item, long activationType, Object datasource) {<NEW_LINE>boolean isTableSelected = false;<NEW_LINE>if (tv instanceof TableViewImpl) {<NEW_LINE>isTableSelected = ((TableViewImpl) tv).isTableSelected();<NEW_LINE>}<NEW_LINE>if (!isTableSelected) {<NEW_LINE>UISWTViewCore active_view = getActiveView();<NEW_LINE>if (active_view != null) {<NEW_LINE>UIPluginViewToolBarListener l = active_view.getToolBarListener();<NEW_LINE>if (l != null && l.toolBarItemActivated(item, activationType, datasource)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>String itemKey = item.getID();<NEW_LINE>if (activationType == UIToolBarActivationListener.ACTIVATIONTYPE_HELD) {<NEW_LINE>if (itemKey.equals("up")) {<NEW_LINE>moveSelectedTorrentsTop();<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (itemKey.equals("down")) {<NEW_LINE>moveSelectedTorrentsEnd();<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (activationType != UIToolBarActivationListener.ACTIVATIONTYPE_NORMAL) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (itemKey.equals("top")) {<NEW_LINE>moveSelectedTorrentsTop();<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (itemKey.equals("bottom")) {<NEW_LINE>moveSelectedTorrentsEnd();<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (itemKey.equals("up")) {<NEW_LINE>moveSelectedTorrentsUp();<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (itemKey.equals("down")) {<NEW_LINE>moveSelectedTorrentsDown();<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (itemKey.equals("run")) {<NEW_LINE>TorrentUtil.runDataSources(tv.getSelectedDataSources().toArray());<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (itemKey.equals("start")) {<NEW_LINE>TorrentUtil.queueDataSources(tv.getSelectedDataSources(<MASK><NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (itemKey.equals("stop")) {<NEW_LINE>TorrentUtil.stopDataSources(tv.getSelectedDataSources().toArray());<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (itemKey.equals("startstop")) {<NEW_LINE>TorrentUtil.stopOrStartDataSources(tv.getSelectedDataSources().toArray(), false);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (itemKey.equals("remove")) {<NEW_LINE>TorrentUtil.removeDataSources(tv.getSelectedDataSources().toArray());<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
).toArray(), false);
947,730
static Shape indexToView(TextLayout textLayout, Rectangle2D textLayoutBounds, int index, Position.Bias bias, int maxIndex, Shape alloc) {<NEW_LINE>if (textLayout == null) {<NEW_LINE>// Leave given bounds<NEW_LINE>return alloc;<NEW_LINE>}<NEW_LINE>assert // NOI18N<NEW_LINE>(maxIndex <= textLayout.getCharacterCount()) : // NOI18N<NEW_LINE>"textLayout.getCharacterCount()=" + textLayout.getCharacterCount() + " < maxIndex=" + maxIndex;<NEW_LINE>// If offset is >getEndOffset() use view-end-offset - otherwise it would throw exception from textLayout.getCaretInfo()<NEW_LINE>int charIndex = <MASK><NEW_LINE>// When e.g. creating fold-preview the offset can be < startOffset<NEW_LINE>charIndex = Math.max(charIndex, 0);<NEW_LINE>TextHitInfo startHit;<NEW_LINE>TextHitInfo endHit;<NEW_LINE>if (bias == Position.Bias.Forward) {<NEW_LINE>startHit = TextHitInfo.leading(charIndex);<NEW_LINE>} else {<NEW_LINE>// backward bias<NEW_LINE>startHit = TextHitInfo.trailing(charIndex - 1);<NEW_LINE>}<NEW_LINE>endHit = (charIndex < maxIndex) ? TextHitInfo.trailing(charIndex) : startHit;<NEW_LINE>if (textLayoutBounds == null) {<NEW_LINE>textLayoutBounds = ViewUtils.shapeAsRect(alloc);<NEW_LINE>}<NEW_LINE>return TextLayoutUtils.getRealAlloc(textLayout, textLayoutBounds, startHit, endHit);<NEW_LINE>}
Math.min(index, maxIndex);
9,072
private void listProfiles(String[] args) throws CmdException {<NEW_LINE>if (args.length > 2)<NEW_LINE>throw new CmdSyntaxError();<NEW_LINE>ArrayList<Path> files = WURST.getHax().listProfiles();<NEW_LINE>int page = parsePage(args);<NEW_LINE>int pages = (int) Math.ceil(files.size() / 8.0);<NEW_LINE>pages = Math.max(pages, 1);<NEW_LINE>if (page > pages || page < 1)<NEW_LINE>throw new CmdSyntaxError("Invalid page: " + page);<NEW_LINE>String total = "Total: " + files.size() + " profile";<NEW_LINE>total += files.size() != 1 ? "s" : "";<NEW_LINE>ChatUtils.message(total);<NEW_LINE>int start <MASK><NEW_LINE>int end = Math.min(page * 8, files.size());<NEW_LINE>ChatUtils.message("Enabled hacks profile list (page " + page + "/" + pages + ")");<NEW_LINE>for (int i = start; i < end; i++) ChatUtils.message(files.get(i).getFileName().toString());<NEW_LINE>}
= (page - 1) * 8;
541,818
public void create(IProject project, CommandLine commandLine) {<NEW_LINE>String[] args = commandLine.getValues(Options.ARGS_OPTION);<NEW_LINE>DefaultParser parser = new DefaultParser();<NEW_LINE>org.apache.commons.cli.Options options = new org.apache.commons.cli.Options();<NEW_LINE>options.addOption(Option.builder().hasArg().required().longOpt("interpreter").build());<NEW_LINE>org.apache.commons.cli.CommandLine cli = null;<NEW_LINE>try {<NEW_LINE>cli = parser.parse(options, args);<NEW_LINE>} catch (ParseException pe) {<NEW_LINE>throw new RuntimeException(pe);<NEW_LINE>}<NEW_LINE>// remove the python nature added by ProjectManagement since pydev will<NEW_LINE>// skip all the other setup if the nature is already present.<NEW_LINE>try {<NEW_LINE>IProjectDescription desc = project.getDescription();<NEW_LINE>String[] natureIds = desc.getNatureIds();<NEW_LINE>ArrayList<String> modified = new ArrayList<String>();<NEW_LINE>CollectionUtils.addAll(modified, natureIds);<NEW_LINE>modified.remove(PythonNature.PYTHON_NATURE_ID);<NEW_LINE>desc.setNatureIds(modified.toArray(new String[modified.size()]));<NEW_LINE>project.setDescription(desc, new NullProgressMonitor());<NEW_LINE>String pythonPath = project.getFullPath().toString();<NEW_LINE>String interpreter = cli.getOptionValue("interpreter");<NEW_LINE>IInterpreterManager manager = InterpreterManagersAPI.getPythonInterpreterManager();<NEW_LINE>IInterpreterInfo info = manager.getInterpreterInfo(interpreter, null);<NEW_LINE>if (info == null) {<NEW_LINE>throw new RuntimeException("Python interpreter not found: " + interpreter);<NEW_LINE>}<NEW_LINE>// construct version from the interpreter chosen.<NEW_LINE>String version = "python " + IGrammarVersionProvider.grammarVersionToRep.<MASK><NEW_LINE>// see src.org.python.pydev.plugin.PyStructureConfigHelpers<NEW_LINE>PythonNature.addNature(project, null, version, pythonPath, null, interpreter, null);<NEW_LINE>} catch (CoreException ce) {<NEW_LINE>throw new RuntimeException(ce);<NEW_LINE>} catch (MisconfigurationException me) {<NEW_LINE>throw new RuntimeException(me);<NEW_LINE>}<NEW_LINE>}
get(info.getGrammarVersion());
504,713
final SetTopicAttributesResult executeSetTopicAttributes(SetTopicAttributesRequest setTopicAttributesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(setTopicAttributesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<SetTopicAttributesRequest> request = null;<NEW_LINE>Response<SetTopicAttributesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new SetTopicAttributesRequestMarshaller().marshall(super.beforeMarshalling(setTopicAttributesRequest));<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, "SNS");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "SetTopicAttributes");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<SetTopicAttributesResult> responseHandler = new StaxResponseHandler<SetTopicAttributesResult>(new SetTopicAttributesResultStaxUnmarshaller());<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);
436,290
public void run(final Server server, final CommandSource sender, final String commandLabel, final String[] args) throws Exception {<NEW_LINE>if (args.length < 2) {<NEW_LINE>throw new NotEnoughArgumentsException();<NEW_LINE>}<NEW_LINE>String message = getFinalArg(args, 1);<NEW_LINE>final boolean canWildcard = <MASK><NEW_LINE>if (sender.isPlayer()) {<NEW_LINE>final User user = ess.getUser(sender.getPlayer());<NEW_LINE>if (user.isMuted()) {<NEW_LINE>final String dateDiff = user.getMuteTimeout() > 0 ? DateUtil.formatDateDiff(user.getMuteTimeout()) : null;<NEW_LINE>if (dateDiff == null) {<NEW_LINE>throw new Exception(user.hasMuteReason() ? tl("voiceSilencedReason", user.getMuteReason()) : tl("voiceSilenced"));<NEW_LINE>}<NEW_LINE>throw new Exception(user.hasMuteReason() ? tl("voiceSilencedReasonTime", dateDiff, user.getMuteReason()) : tl("voiceSilencedTime", dateDiff));<NEW_LINE>}<NEW_LINE>message = FormatUtil.formatMessage(user, "essentials.msg", message);<NEW_LINE>} else {<NEW_LINE>message = FormatUtil.replaceFormat(message);<NEW_LINE>}<NEW_LINE>// Sending messages to console<NEW_LINE>if (args[0].equalsIgnoreCase(Console.NAME) || args[0].equalsIgnoreCase(Console.DISPLAY_NAME)) {<NEW_LINE>final IMessageRecipient messageSender = sender.isPlayer() ? ess.getUser(sender.getPlayer()) : Console.getInstance();<NEW_LINE>messageSender.sendMessage(Console.getInstance(), message);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>loopOnlinePlayers(server, sender, false, canWildcard, args[0], new String[] { message });<NEW_LINE>}
sender.isAuthorized("essentials.msg.multiple", ess);
665,026
protected void performDefaults() {<NEW_LINE>fMagicConnectorPolarity1Button.setSelection(getPreferenceStore().getDefaultBoolean(MAGIC_CONNECTOR_POLARITY));<NEW_LINE>fMagicConnectorPolarity2Button.setSelection(!getPreferenceStore().getDefaultBoolean(MAGIC_CONNECTOR_POLARITY));<NEW_LINE>fDoAntiAliasButton.setSelection(getPreferenceStore().getDefaultBoolean(ANTI_ALIAS));<NEW_LINE>fUseOrthogonalAnchorButton.setSelection(getPreferenceStore().getDefaultBoolean(USE_ORTHOGONAL_ANCHOR));<NEW_LINE>fUseLineCurvesButton.setSelection(getPreferenceStore().getDefaultBoolean(USE_LINE_CURVES));<NEW_LINE>fUseLineJumpsButton.setSelection(getPreferenceStore<MASK><NEW_LINE>fConnectionLabelStrategyCombo.select(getPreferenceStore().getDefaultInt(CONNECTION_LABEL_STRATEGY));<NEW_LINE>fShowReconnectionWarningButton.setSelection(getPreferenceStore().getDefaultBoolean(SHOW_WARNING_ON_RECONNECT));<NEW_LINE>super.performDefaults();<NEW_LINE>}
().getDefaultBoolean(USE_LINE_JUMPS));
36,184
protected void createChannels(ActiveConfiguration newConfig) {<NEW_LINE>Map<Object, Object> chanProps;<NEW_LINE>Map<String, Object> udpOptions = GenericEndpointImpl.getUdpOptions();<NEW_LINE>// Endpoint<NEW_LINE>// define is a simple replace of the old value known to the endpointMgr<NEW_LINE>EndPointInfo ep = endpointMgr.getEndPoint(getEndpointName());<NEW_LINE>ep = endpointMgr.defineEndPoint(getEndpointName(), newConfig.configHost, newConfig.configPort);<NEW_LINE>// UDP Channel<NEW_LINE>ChannelData udpChannel = getChannel(getName());<NEW_LINE>if (udpChannel == null) {<NEW_LINE>String typeName = (<MASK><NEW_LINE>chanProps = new HashMap<Object, Object>(udpOptions);<NEW_LINE>chanProps.put("endPointName", getEndpointName());<NEW_LINE>chanProps.put("hostname", ep.getHost());<NEW_LINE>chanProps.put("port", String.valueOf(ep.getPort()));<NEW_LINE>udpChannel = addChannel(getName(), typeName, chanProps, newConfig);<NEW_LINE>}<NEW_LINE>// SIP Channel<NEW_LINE>ChannelData sipChannel = getChannel(sipChannelName);<NEW_LINE>if (sipChannel == null) {<NEW_LINE>chanProps = new HashMap<Object, Object>();<NEW_LINE>chanProps.put("endPointName", newConfig.endpointOptions.get(ID));<NEW_LINE>chanProps.put("channelChainProtocolType", "udp");<NEW_LINE>sipChannel = addChannel(sipChannelName, SipInboundChannel.SipInboundChannelName, chanProps, newConfig);<NEW_LINE>}<NEW_LINE>ChainData cd = getCfw().getChain(getChainName());<NEW_LINE>if (null == cd) {<NEW_LINE>final String[] chanList;<NEW_LINE>chanList = new String[] { getName(), sipChannelName };<NEW_LINE>addChain(chanList, cd, newConfig);<NEW_LINE>}<NEW_LINE>}
String) udpOptions.get("type");
1,499,010
protected Expression transformPropertyExpression(PropertyExpression pe) {<NEW_LINE>boolean itlp = isTopLevelProperty;<NEW_LINE>boolean ipe = inPropertyExpression;<NEW_LINE>Expression objectExpression = pe.getObjectExpression();<NEW_LINE>inPropertyExpression = true;<NEW_LINE>isTopLevelProperty = objectExpression<MASK><NEW_LINE>objectExpression = transform(objectExpression);<NEW_LINE>// we handle the property part as if it were not part of the property<NEW_LINE>inPropertyExpression = false;<NEW_LINE>Expression property = transform(pe.getProperty());<NEW_LINE>isTopLevelProperty = itlp;<NEW_LINE>inPropertyExpression = ipe;<NEW_LINE>boolean spreadSafe = pe.isSpreadSafe();<NEW_LINE>PropertyExpression old = pe;<NEW_LINE>pe = new PropertyExpression(objectExpression, property, pe.isSafe());<NEW_LINE>pe.setSpreadSafe(spreadSafe);<NEW_LINE>pe.setSourcePosition(old);<NEW_LINE>String className = lookupClassName(pe);<NEW_LINE>if (className != null) {<NEW_LINE>ClassNode type = ClassHelper.make(className);<NEW_LINE>if (resolve(type)) {<NEW_LINE>Expression ret = new ClassExpression(type);<NEW_LINE>ret.setSourcePosition(pe);<NEW_LINE>return ret;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (objectExpression instanceof ClassExpression && pe.getPropertyAsString() != null) {<NEW_LINE>// possibly an inner class<NEW_LINE>ClassExpression ce = (ClassExpression) objectExpression;<NEW_LINE>ClassNode type = new ConstructedNestedClass(ce.getType(), pe.getPropertyAsString());<NEW_LINE>if (resolve(type, false, false, false)) {<NEW_LINE>Expression ret = new ClassExpression(type);<NEW_LINE>ret.setSourcePosition(ce);<NEW_LINE>return ret;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Expression ret = pe;<NEW_LINE>checkThisAndSuperAsPropertyAccess(pe);<NEW_LINE>if (isTopLevelProperty) {<NEW_LINE>ret = correctClassClassChain(pe);<NEW_LINE>}<NEW_LINE>return ret;<NEW_LINE>}
.getClass() != PropertyExpression.class;
1,088,214
public EntityClassifier<EntityViewInfo> createNightViewClassifier() {<NEW_LINE>EntityClassifier<MASK><NEW_LINE>result.replaceRule("highway", "path", createWayInfo(1f / 100000, 1f / 3500, 38, UColor.YELLOW.darker(), 1));<NEW_LINE>result.replaceRule("highway", "track", createWayInfo(1f / 60000, 1f / 3500, 37, UColor.YELLOW.darker(), 1));<NEW_LINE>result.replaceRule("place", "city", createPoiInfo(1e-9f, 1f / 3500000, 30, UColor.WHITE, null, false));<NEW_LINE>result.replaceRule("place", "town", createPoiInfo(1e-9f, 1f / 350000, 29, UColor.WHITE, null, false));<NEW_LINE>result.replaceRule("place", "village", createPoiInfo(1e-9f, 1f / 100000, 29, UColor.GRAY, null, false));<NEW_LINE>result.replaceRule("place", null, createPoiInfo(1e-9f, 1f / 35000, 28, UColor.GRAY, null, false));<NEW_LINE>result.replaceRule("marker", "yes", createPoiInfo(1e-9f, 1e-9f, 0, UColor.YELLOW, new PinIcon(12, UColor.YELLOW, UColor.YELLOW), false));<NEW_LINE>result.replaceRule("track_type", null, createTrackInfo(UColor.WHITE));<NEW_LINE>return result;<NEW_LINE>}
<EntityViewInfo> result = createDefaultClassifier();
658,030
public void glVertexAttribPointer(int indx, int size, int type, boolean normalized, int stride, Buffer buffer) {<NEW_LINE>if (buffer instanceof ByteBuffer) {<NEW_LINE>if (type == GL_BYTE)<NEW_LINE>GLES20.glVertexAttribPointer(indx, size, type, normalized, stride, (ByteBuffer) buffer);<NEW_LINE>else if (type == GL_UNSIGNED_BYTE)<NEW_LINE>GLES20.glVertexAttribPointer(indx, size, type, normalized, stride, (ByteBuffer) buffer);<NEW_LINE>else if (type == GL_SHORT)<NEW_LINE>GLES20.glVertexAttribPointer(indx, size, type, normalized, stride, ((ByteBuffer) buffer).asShortBuffer());<NEW_LINE>else if (type == GL_UNSIGNED_SHORT)<NEW_LINE>GLES20.glVertexAttribPointer(indx, size, type, normalized, stride, ((ByteBuffer) buffer).asShortBuffer());<NEW_LINE>else if (type == GL_FLOAT)<NEW_LINE>GLES20.glVertexAttribPointer(indx, size, type, normalized, stride, ((ByteBuffer) buffer).asFloatBuffer());<NEW_LINE>else<NEW_LINE>throw new GdxRuntimeException("Can't use " + buffer.getClass().getName() + " with type " + type + " with this method. Use ByteBuffer and one of GL_BYTE, GL_UNSIGNED_BYTE, GL_SHORT, GL_UNSIGNED_SHORT or GL_FLOAT for type.");<NEW_LINE>} else if (buffer instanceof FloatBuffer) {<NEW_LINE>if (type == GL_FLOAT)<NEW_LINE>GLES20.glVertexAttribPointer(indx, size, type, normalized, stride, (FloatBuffer) buffer);<NEW_LINE>else<NEW_LINE>throw new GdxRuntimeException("Can't use " + buffer.getClass().getName() + " with type " + type + " with this method.");<NEW_LINE>} else<NEW_LINE>throw new GdxRuntimeException("Can't use " + buffer.getClass(<MASK><NEW_LINE>}
).getName() + " with this method. Use ByteBuffer instead.");
278,296
private static boolean parseLayoutDirection(String name, ResTable_config out) {<NEW_LINE>if (Objects.equals(name, kWildcardName)) {<NEW_LINE>if (out != null) {<NEW_LINE>out.screenLayout = (out.screenLayout & ~ResTable_config.MASK_LAYOUTDIR) | ResTable_config.LAYOUTDIR_ANY;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} else if (Objects.equals(name, "ldltr")) {<NEW_LINE>if (out != null) {<NEW_LINE>out.screenLayout = (out.screenLayout & ~ResTable_config.MASK_LAYOUTDIR) | ResTable_config.LAYOUTDIR_LTR;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} else if (Objects.equals(name, "ldrtl")) {<NEW_LINE>if (out != null) {<NEW_LINE>out.screenLayout = (out.screenLayout & ~<MASK><NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
ResTable_config.MASK_LAYOUTDIR) | ResTable_config.LAYOUTDIR_RTL;
870,538
/*<NEW_LINE>* (non-Javadoc)<NEW_LINE>*<NEW_LINE>* @see javax.jms.JMSContext#createDurableConsumer(javax.jms.Topic, java.lang.String, java.lang.String, boolean)<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public JMSConsumer createDurableConsumer(Topic topic, String name, String messageSelector, boolean noLocal) throws InvalidDestinationRuntimeException, InvalidSelectorRuntimeException, IllegalStateRuntimeException, JMSRuntimeException {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.entry(this, tc, "createDurableConsumer", new Object[] { topic, name, messageSelector, noLocal });<NEW_LINE>JMSConsumer jmsConsumer = null;<NEW_LINE>try {<NEW_LINE>MessageConsumer messageConsumer = jmsSession.createDurableConsumer(topic, name, messageSelector, noLocal);<NEW_LINE>jmsConsumer = new JmsJMSConsumerImpl(messageConsumer);<NEW_LINE>autoStartConsumer();<NEW_LINE>} catch (InvalidDestinationException ide) {<NEW_LINE>throw (InvalidDestinationRuntimeException) JmsErrorUtils.getJMS2Exception(ide, InvalidDestinationRuntimeException.class);<NEW_LINE>} catch (InvalidSelectorException ise) {<NEW_LINE>throw (InvalidSelectorRuntimeException) JmsErrorUtils.getJMS2Exception(ise, InvalidSelectorRuntimeException.class);<NEW_LINE>} catch (IllegalStateException istatee) {<NEW_LINE>throw (IllegalStateRuntimeException) JmsErrorUtils.getJMS2Exception(istatee, IllegalStateRuntimeException.class);<NEW_LINE>} catch (JMSException jmse) {<NEW_LINE>throw (JMSRuntimeException) JmsErrorUtils.<MASK><NEW_LINE>} finally {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.exit(this, tc, "createDurableConsumer", new Object[] { jmsConsumer });<NEW_LINE>}<NEW_LINE>return jmsConsumer;<NEW_LINE>}
getJMS2Exception(jmse, JMSRuntimeException.class);
829,728
private void handle(final GetDownloadBitsFromKVMHostProgressMsg msg) {<NEW_LINE>HypervisorFactory f = getHypervisorFactoryByHostUuid(msg.getHostUuid());<NEW_LINE>HypervisorBackend <MASK><NEW_LINE>bkd.handle(msg, new ReturnValueCompletion<GetDownloadBitsFromKVMHostProgressReply>(msg) {<NEW_LINE><NEW_LINE>public void success(GetDownloadBitsFromKVMHostProgressReply returnValue) {<NEW_LINE>logger.info(String.format("successfully get downloaded bits progress from primary storage %s", msg.getPrimaryStorageUuid()));<NEW_LINE>bus.reply(msg, returnValue);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void fail(ErrorCode errorCode) {<NEW_LINE>logger.error(String.format("failed to get downloaded bits progress from primary storage %s", msg.getPrimaryStorageUuid()));<NEW_LINE>GetDownloadBitsFromKVMHostProgressReply reply = new GetDownloadBitsFromKVMHostProgressReply();<NEW_LINE>reply.setError(errorCode);<NEW_LINE>bus.reply(msg, reply);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
bkd = f.getHypervisorBackend(self);
432,008
private static int putMediaInfo(final serverObjects prop, final String[] wordArray, int c, final Map<AnchorURL, String> media, final String type, boolean dark, final String agentName) {<NEW_LINE>int i = 0;<NEW_LINE>for (final Map.Entry<AnchorURL, String> entry : media.entrySet()) {<NEW_LINE>// the name attribute<NEW_LINE>final String name = entry.getKey().getNameProperty();<NEW_LINE>// the rel-attribute<NEW_LINE>final String rel = entry.getKey().getRelProperty();<NEW_LINE>// the text between the <a></a> tag<NEW_LINE>final String text = entry.getKey().getTextProperty();<NEW_LINE>final String urlStr = entry.getKey().toNormalform(true);<NEW_LINE>prop.put("viewMode_links_" + c + "_nr", c);<NEW_LINE>prop.put("viewMode_links_" + c + "_dark", ((dark) ? 1 : 0));<NEW_LINE>prop.putHTML("viewMode_links_" + c + "_type", type);<NEW_LINE>prop.put(<MASK><NEW_LINE>prop.put("viewMode_links_" + c + "_link", markup(wordArray, urlStr));<NEW_LINE>prop.put("viewMode_links_" + c + "_url", urlStr);<NEW_LINE>prop.put("viewMode_links_" + c + "_encodedUrl", UTF8.encodeUrl(urlStr));<NEW_LINE>if (agentName != null) {<NEW_LINE>prop.put("viewMode_links_" + c + "_agent", true);<NEW_LINE>prop.put("viewMode_links_" + c + "_agent_name", UTF8.encodeUrl(agentName));<NEW_LINE>} else {<NEW_LINE>prop.put("viewMode_links_" + c + "_agent", false);<NEW_LINE>}<NEW_LINE>prop.put("viewMode_links_" + c + "_rel", rel);<NEW_LINE>prop.put("viewMode_links_" + c + "_name", name);<NEW_LINE>dark = !dark;<NEW_LINE>c++;<NEW_LINE>i++;<NEW_LINE>}<NEW_LINE>return i;<NEW_LINE>}
"viewMode_links_" + c + "_text", text);
428,097
private void loadNode224() throws IOException, SAXException {<NEW_LINE>PropertyTypeNode node = new PropertyTypeNode(this.context, Identifiers.ConditionType_ConditionRefresh2_InputArguments, new QualifiedName(0, "InputArguments"), new LocalizedText("en", "InputArguments"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), new DataValue(Variant.NULL_VALUE), Identifiers.Argument, 1, new UInteger[] { org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UInteger.valueOf(0) }, UByte.valueOf(1), UByte.valueOf(1), 0.0, false);<NEW_LINE>node.addReference(new Reference(Identifiers.ConditionType_ConditionRefresh2_InputArguments, Identifiers.HasTypeDefinition, Identifiers.PropertyType.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ConditionType_ConditionRefresh2_InputArguments, Identifiers.HasModellingRule, Identifiers.ModellingRule_Mandatory.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ConditionType_ConditionRefresh2_InputArguments, Identifiers.HasProperty, Identifiers.ConditionType_ConditionRefresh2.expanded(), false));<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>sb.append("<ListOfExtensionObject xmlns=\"http://opcfoundation.org/UA/2008/02/Types.xsd\"><ExtensionObject><TypeId><Identifier>i=297</Identifier> </TypeId><Body><Argument><Name>SubscriptionId</Name><DataType><Identifier>i=288</Identifier> </DataType><ValueRank>-1</ValueRank><ArrayDimensions/><Description><Locale> </Locale><Text>The identifier for the suscription to refresh.</Text> </Description> </Argument> </Body> </ExtensionObject><ExtensionObject><TypeId><Identifier>i=297</Identifier> </TypeId><Body><Argument><Name>MonitoredItemId</Name><DataType><Identifier>i=288</Identifier> </DataType><ValueRank>-1</ValueRank><ArrayDimensions/><Description><Locale> </Locale><Text>The identifier for the monitored item to refresh.</Text> </Description> </Argument> </Body> </ExtensionObject> </ListOfExtensionObject>");<NEW_LINE>String xml = sb.toString();<NEW_LINE>OpcUaXmlStreamDecoder decoder = new OpcUaXmlStreamDecoder(context.getServer().getSerializationContext()).setInput(new StringReader(xml));<NEW_LINE>Object o = decoder.readVariantValue();<NEW_LINE>DataValue value = new DataValue(new Variant(o));<NEW_LINE>node.setValue(value);<NEW_LINE><MASK><NEW_LINE>}
this.nodeManager.addNode(node);
1,192,363
public void testLocalMethodwithRemoteExAndSub() throws Exception {<NEW_LINE>SLRemoteExLocal remoteExLocal = lookupSLRemoteExBeanLocal();<NEW_LINE>// verify method with throws exception may be called without an exception<NEW_LINE>remoteExLocal.testMethodwithRemoteExAndSub("none");<NEW_LINE>try {<NEW_LINE>remoteExLocal.testMethodwithRemoteExAndSub("RemoteException");<NEW_LINE>fail("Expected RemoteException was not thrown");<NEW_LINE>} catch (EJBException ex) {<NEW_LINE><MASK><NEW_LINE>assertTrue("Exception is not RemoteException : " + rootex.getClass().getName(), rootex.getClass() == RemoteException.class);<NEW_LINE>assertEquals("Wrong Exception message received", "RemoteException", rootex.getMessage());<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>remoteExLocal.testMethodwithRemoteExAndSub("SLRemoteException");<NEW_LINE>fail("Expected SLRemoteException was not thrown");<NEW_LINE>} catch (EJBException ex) {<NEW_LINE>Throwable rootex = ex.getCause();<NEW_LINE>assertTrue("Exception is not SLRemoteException : " + rootex.getClass().getName(), rootex.getClass() == SLRemoteException.class);<NEW_LINE>assertEquals("Wrong Exception message received", "SLRemoteException", rootex.getMessage());<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>remoteExLocal.testMethodwithRemoteExAndSub("RuntimeException");<NEW_LINE>fail("Expected RuntimeException was not thrown");<NEW_LINE>} catch (EJBException ex) {<NEW_LINE>// (UnknownLocalException ex) {<NEW_LINE>Throwable rootex = ex.getCause();<NEW_LINE>assertTrue("Exception is not RuntimeException : " + rootex.getClass().getName(), rootex.getClass() == RuntimeException.class);<NEW_LINE>assertEquals("Wrong Exception message received", "RuntimeException", rootex.getMessage());<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>remoteExLocal.testMethodwithRemoteExAndSub("IllegalStateException");<NEW_LINE>fail("Expected IllegalStateException was not thrown");<NEW_LINE>} catch (EJBException ex) {<NEW_LINE>// (UnknownLocalException ex) {<NEW_LINE>Throwable rootex = ex.getCause();<NEW_LINE>assertTrue("Exception is not IllegalStateException : " + rootex.getClass().getName(), rootex.getClass() == IllegalStateException.class);<NEW_LINE>assertEquals("Wrong Exception message received", "IllegalStateException", rootex.getMessage());<NEW_LINE>}<NEW_LINE>}
Throwable rootex = ex.getCause();
160,556
private void addRow(List<String> row, boolean escapeText) {<NEW_LINE>StringBuilder builder = new StringBuilder();<NEW_LINE>// NON-NLS<NEW_LINE>builder.append("\t<tr>\n");<NEW_LINE>for (String cell : row) {<NEW_LINE>String cellText = escapeText ? EscapeUtil.escapeHtml(cell) : cell;<NEW_LINE>// NON-NLS<NEW_LINE>builder.append("\t\t<td>").append(cellText).append("</td>\n");<NEW_LINE>}<NEW_LINE>// NON-NLS<NEW_LINE>builder.append("\t</tr>\n");<NEW_LINE>rowCount++;<NEW_LINE>try {<NEW_LINE>out.write(builder.toString());<NEW_LINE>} catch (IOException ex) {<NEW_LINE>// NON-NLS<NEW_LINE>logger.log(<MASK><NEW_LINE>} catch (NullPointerException ex) {<NEW_LINE>// NON-NLS<NEW_LINE>logger.log(Level.SEVERE, "Output writer is null. Page was not initialized before writing.", ex);<NEW_LINE>}<NEW_LINE>}
Level.SEVERE, "Failed to write row to out.", ex);
1,291,373
public static List<Integer> nextPermutation(List<Integer> perm) {<NEW_LINE>// Find the first entry from the right that is smaller than the entry<NEW_LINE>// immediately after it.<NEW_LINE>int inversionPoint = perm.size() - 2;<NEW_LINE>while (inversionPoint >= 0 && perm.get(inversionPoint) >= perm.get(inversionPoint + 1)) {<NEW_LINE>--inversionPoint;<NEW_LINE>}<NEW_LINE>if (inversionPoint == -1) {<NEW_LINE>// perm is the last permutation.<NEW_LINE>return Collections.emptyList();<NEW_LINE>}<NEW_LINE>// Swap the smallest entry after index inversionPoint that is greater than<NEW_LINE>// perm.get(inversionPoint). Since entries in perm are decreasing after<NEW_LINE>// inversionPoint, if we search in reverse order, the first entry that is<NEW_LINE>// greater than perm.get(inversionPoint) is the entry to swap with.<NEW_LINE>for (int i = perm.size() - 1; i > inversionPoint; --i) {<NEW_LINE>if (perm.get(i) > perm.get(inversionPoint)) {<NEW_LINE>Collections.<MASK><NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Entries in perm must appear in decreasing order after inversionPoint, so<NEW_LINE>// we simply reverse these entries to get the smallest dictionary order.<NEW_LINE>Collections.reverse(perm.subList(inversionPoint + 1, perm.size()));<NEW_LINE>return perm;<NEW_LINE>}
swap(perm, inversionPoint, i);
1,743,831
public int doStartTag() throws JspException {<NEW_LINE>if (log.isLoggable(Level.FINE)) {<NEW_LINE>log.fine("JSF 1.2 Spec : Create a new instance of the ActionListener");<NEW_LINE>}<NEW_LINE>ActionListener actionListener <MASK><NEW_LINE>UIComponentClassicTagBase tag = UIComponentClassicTagBase.getParentUIComponentClassicTagBase(pageContext);<NEW_LINE>if (tag == null) {<NEW_LINE>throw new JspException("Could not find a " + "parent UIComponentClassicTagBase ... is this " + "tag in a child of a UIComponentClassicTagBase?");<NEW_LINE>}<NEW_LINE>if (tag.getCreated()) {<NEW_LINE>UIComponent component = tag.getComponentInstance();<NEW_LINE>if (component == null) {<NEW_LINE>throw new JspException(" Could not locate a UIComponent " + "for a UIComponentClassicTagBase w/ a " + "JSP id of " + tag.getJspId());<NEW_LINE>}<NEW_LINE>if (!(component instanceof ActionSource)) {<NEW_LINE>throw new JspException("Component w/ id of " + component.getId() + " is associated w/ a tag w/ JSP id of " + tag.getJspId() + ". This component is of type " + component.getClass() + ", which is not an " + ActionSource.class);<NEW_LINE>}<NEW_LINE>if (log.isLoggable(Level.FINE)) {<NEW_LINE>log.fine(" ... register it with the UIComponent " + "instance associated with our most immediately " + "surrounding UIComponentTagBase");<NEW_LINE>}<NEW_LINE>((ActionSource) component).addActionListener(actionListener);<NEW_LINE>}<NEW_LINE>return SKIP_BODY;<NEW_LINE>}
= new SetPropertyActionListener(target, value);
1,419,252
ActionResult<Wo> execute(HttpServletRequest request, HttpServletResponse response, EffectivePerson effectivePerson, String code) throws Exception {<NEW_LINE>ActionResult<Wo> result = new ActionResult<>();<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>String url = "https://oapi.dingtalk.com/user/getuserinfo?access_token=" + Config.dingding().corpAccessToken() + "&code=" + code;<NEW_LINE>String value = this.get(url);<NEW_LINE>Resp resp = gson.fromJson(value, Resp.class);<NEW_LINE>if (resp.getErrcode() > 0) {<NEW_LINE>throw new ExceptionDingding(resp.getErrcode(), resp.getErrmsg());<NEW_LINE>}<NEW_LINE>String userId = resp.getUserid();<NEW_LINE>url = "https://oapi.dingtalk.com/user/get?access_token=" + Config.dingding().corpAccessToken() + "&userid=" + userId;<NEW_LINE>value = this.get(url);<NEW_LINE>resp = gson.fromJson(value, Resp.class);<NEW_LINE>if (resp.getErrcode() > 0) {<NEW_LINE>throw new ExceptionDingding(resp.getErrcode(), resp.getErrmsg());<NEW_LINE>}<NEW_LINE>String mobile = resp.getMobile();<NEW_LINE>Business business = new Business(emc);<NEW_LINE>String personId = business.person().getWithCredential(mobile);<NEW_LINE>if (StringUtils.isEmpty(personId)) {<NEW_LINE>throw new ExceptionPersonNotExist(userId);<NEW_LINE>}<NEW_LINE>Person person = emc.<MASK><NEW_LINE>Wo wo = Wo.copier.copy(person);<NEW_LINE>List<String> roles = business.organization().role().listWithPerson(person.getDistinguishedName());<NEW_LINE>wo.setRoleList(roles);<NEW_LINE>EffectivePerson effective = new EffectivePerson(wo.getDistinguishedName(), TokenType.user, Config.token().getCipher());<NEW_LINE>wo.setToken(effective.getToken());<NEW_LINE>HttpToken httpToken = new HttpToken();<NEW_LINE>httpToken.setToken(request, response, effective);<NEW_LINE>result.setData(wo);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
find(personId, Person.class);
274,532
private Application updateApplicationWithJobStatusCV(Application app, JobStatusCV jobStatus) {<NEW_LINE>// infer the final flink job state<NEW_LINE>Enumeration.Value state = jobStatus.jobState();<NEW_LINE>Enumeration.Value preState = toK8sFlinkJobState(FlinkAppState.of(app.getState()));<NEW_LINE>state = FlinkJobStatusWatcher.inferFlinkJobStateFromPersist(state, preState);<NEW_LINE>app.setState(fromK8sFlinkJobState(state).getValue());<NEW_LINE>// update relevant fields of Application from JobStatusCV<NEW_LINE>app.setJobId(jobStatus.jobId());<NEW_LINE>app.<MASK><NEW_LINE>if (FlinkJobState.isEndState(state)) {<NEW_LINE>app.setOptionState(OptionState.NONE.getValue());<NEW_LINE>}<NEW_LINE>// corrective start-time / end-time / duration<NEW_LINE>long preStartTime = app.getStartTime() != null ? app.getStartTime().getTime() : 0;<NEW_LINE>long startTime = Math.max(jobStatus.jobStartTime(), preStartTime);<NEW_LINE>long preEndTime = app.getEndTime() != null ? app.getEndTime().getTime() : 0;<NEW_LINE>long endTime = Math.max(jobStatus.jobEndTime(), preEndTime);<NEW_LINE>long duration = jobStatus.duration();<NEW_LINE>if (FlinkJobState.isEndState(state)) {<NEW_LINE>if (endTime < startTime) {<NEW_LINE>endTime = System.currentTimeMillis();<NEW_LINE>}<NEW_LINE>if (duration <= 0) {<NEW_LINE>duration = endTime - startTime;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>app.setStartTime(new Date(startTime > 0 ? startTime : 0));<NEW_LINE>app.setEndTime(endTime > 0 && endTime >= startTime ? new Date(endTime) : null);<NEW_LINE>app.setDuration(duration > 0 ? duration : 0);<NEW_LINE>return app;<NEW_LINE>}
setTotalTask(jobStatus.taskTotal());
640,990
private static Vector combineServerIntLongRowSplits(List<ServerRow> rowSplits, MatrixMeta matrixMeta, int rowIndex) {<NEW_LINE>int colNum = <MASK><NEW_LINE>int elemNum = 0;<NEW_LINE>int size = rowSplits.size();<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>elemNum += rowSplits.get(i).size();<NEW_LINE>}<NEW_LINE>IntLongVector row;<NEW_LINE>if (elemNum >= (int) (storageConvFactor * colNum)) {<NEW_LINE>row = VFactory.denseLongVector(colNum);<NEW_LINE>} else {<NEW_LINE>row = VFactory.sparseLongVector(colNum, elemNum);<NEW_LINE>}<NEW_LINE>row.setMatrixId(matrixMeta.getId());<NEW_LINE>row.setRowId(rowIndex);<NEW_LINE>Collections.sort(rowSplits, serverRowComp);<NEW_LINE>int clock = Integer.MAX_VALUE;<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>if (rowSplits.get(i) == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (rowSplits.get(i).getClock() < clock) {<NEW_LINE>clock = rowSplits.get(i).getClock();<NEW_LINE>}<NEW_LINE>((ServerIntLongRow) rowSplits.get(i)).mergeTo(row);<NEW_LINE>}<NEW_LINE>row.setClock(clock);<NEW_LINE>return row;<NEW_LINE>}
(int) matrixMeta.getColNum();
1,818,508
public static WorkflowStepResult parseResponse(String externalData) {<NEW_LINE>try (StringReader reader = new StringReader(externalData)) {<NEW_LINE>JsonObject response = Json.createReader(reader).readObject();<NEW_LINE>String status = null;<NEW_LINE>// Lower case is documented, upper case is deprecated<NEW_LINE>if (response.containsKey("status")) {<NEW_LINE>status = response.getString("status");<NEW_LINE>} else if (response.containsKey("Status")) {<NEW_LINE>status = response.getString("Status");<NEW_LINE>}<NEW_LINE>String reason = null;<NEW_LINE>String message = null;<NEW_LINE>if (response.containsKey("reason")) {<NEW_LINE>reason = response.getString("reason");<NEW_LINE>} else if (response.containsKey("Reason")) {<NEW_LINE>reason = response.getString("Reason");<NEW_LINE>}<NEW_LINE>if (response.containsKey("message")) {<NEW_LINE>message = response.getString("message");<NEW_LINE>} else if (response.containsKey("Message")) {<NEW_LINE>message = response.getString("Message");<NEW_LINE>}<NEW_LINE>switch(status) {<NEW_LINE>case "success":<NEW_LINE>case "Success":<NEW_LINE>logger.log(Level.FINE, "AuthExt Worfklow Step Succeeded: " + reason);<NEW_LINE>return new Success(reason, message);<NEW_LINE>case "failure":<NEW_LINE>case "Failure":<NEW_LINE>logger.log(Level.WARNING, "Remote system indicates workflow failed: {0}", reason);<NEW_LINE><MASK><NEW_LINE>default:<NEW_LINE>logger.log(Level.WARNING, "Remote system returned a response with no \"status\" key or bad status value: {0}", escapeHtml4(externalData));<NEW_LINE>return new Failure("Workflow failure: Response from remote server doesn't have valid \"status\":" + escapeHtml4(externalData), null);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.log(Level.WARNING, "Remote system returned a bad response: {0}", externalData);<NEW_LINE>}<NEW_LINE>// In general, the remote workflow service creating the response is trusted, but, if it's causing an error, escape the result to avoid issues in the UI<NEW_LINE>return new Failure("Workflow failure: Response from remote server could not be parsed:" + escapeHtml4(externalData), null);<NEW_LINE>}
return new Failure(reason, message);
1,693,865
private BsonDocument generateTimer(Timer timer) {<NEW_LINE>var document = new BsonDocument();<NEW_LINE>final var snapshot = timer.getSnapshot();<NEW_LINE>document.append("count", new BsonInt64(timer.getCount()));<NEW_LINE>document.append("max", new BsonDouble(snapshot.getMax() * durationFactor));<NEW_LINE>document.append("mean", new BsonDouble(snapshot.getMean() * durationFactor));<NEW_LINE>document.append("min", new BsonDouble(snapshot.getMin() * durationFactor));<NEW_LINE>document.append("p50", new BsonDouble(snapshot.getMedian() * durationFactor));<NEW_LINE>document.append("p75", new BsonDouble(snapshot.get75thPercentile() * durationFactor));<NEW_LINE>document.append("p95", new BsonDouble(snapshot.get95thPercentile() * durationFactor));<NEW_LINE>document.append("p98", new BsonDouble(snapshot.get98thPercentile() * durationFactor));<NEW_LINE>document.append("p99", new BsonDouble(snapshot.get99thPercentile() * durationFactor));<NEW_LINE>document.append("p999", new BsonDouble(snapshot.get999thPercentile() * durationFactor));<NEW_LINE>if (showSamples) {<NEW_LINE>document.append("values", new BsonArray(Arrays.stream(snapshot.getValues()).mapToDouble(x -> x * durationFactor).mapToObj(BsonDouble::new).collect(Collectors.toList())));<NEW_LINE>}<NEW_LINE>document.append("stddev", new BsonDouble(snapshot.getStdDev() * durationFactor));<NEW_LINE>document.append("m15_rate", new BsonDouble(timer<MASK><NEW_LINE>document.append("m1_rate", new BsonDouble(timer.getOneMinuteRate() * rateFactor));<NEW_LINE>document.append("m5_rate", new BsonDouble(timer.getFiveMinuteRate() * rateFactor));<NEW_LINE>document.append("mean_rate", new BsonDouble(timer.getMeanRate() * rateFactor));<NEW_LINE>document.append("duration_units", new BsonString(durationUnit.name().toLowerCase(Locale.US)));<NEW_LINE>document.append("rate_units", new BsonString("calls/" + singularRateUnitString));<NEW_LINE>return document;<NEW_LINE>}
.getFifteenMinuteRate() * rateFactor));
371,028
public static Supplier<BinaryData> createBinaryDataSupplier(CorePerfStressOptions options) {<NEW_LINE>switch(options.getBinaryDataSource()) {<NEW_LINE>case BYTES:<NEW_LINE>byte[] bytes = new byte[(int) options.getSize()];<NEW_LINE>new <MASK><NEW_LINE>return () -> BinaryData.fromBytes(bytes);<NEW_LINE>case FILE:<NEW_LINE>try {<NEW_LINE>Path tempFile = Files.createTempFile("binarydataforperftest", null);<NEW_LINE>tempFile.toFile().deleteOnExit();<NEW_LINE>String tempFilePath = tempFile.toString();<NEW_LINE>TestDataCreationHelper.writeToFile(tempFilePath, options.getSize(), 8192);<NEW_LINE>return () -> BinaryData.fromFile(tempFile);<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>case STREAM:<NEW_LINE>RepeatingInputStream inputStream = (RepeatingInputStream) TestDataCreationHelper.createRandomInputStream(options.getSize());<NEW_LINE>inputStream.mark(Long.MAX_VALUE);<NEW_LINE>return () -> {<NEW_LINE>inputStream.reset();<NEW_LINE>return BinaryData.fromStream(inputStream);<NEW_LINE>};<NEW_LINE>default:<NEW_LINE>throw new IllegalArgumentException("Unknown binary data source " + options.getBinaryDataSource());<NEW_LINE>}<NEW_LINE>}
Random().nextBytes(bytes);
106,730
SchemaGrant createDatabaseSchema(final App app, final AbstractSchemaNode schemaNode) throws FrameworkException {<NEW_LINE>final PropertyMap getOrCreateProperties = new PropertyMap();<NEW_LINE>final PropertyMap updateProperties = new PropertyMap();<NEW_LINE>final List<Principal> principals = app.nodeQuery(Principal.class).andName(principalName).getAsList();<NEW_LINE>if (principals.isEmpty()) {<NEW_LINE>// log error<NEW_LINE>logger.warn("No node of type Principal found for schema grant '{}', ignoring.", principalName);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (principals.size() > 1) {<NEW_LINE>// log error<NEW_LINE>logger.warn("Found {} candidates for type Principal in schema grant {}, ignoring.", principals.size(), principalName);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>getOrCreateProperties.put(SchemaGrant.principal, principals.get(0));<NEW_LINE>getOrCreateProperties.put(SchemaGrant.schemaNode, (SchemaNode) schemaNode);<NEW_LINE>SchemaGrant grant = app.nodeQuery(SchemaGrant.class).and(getOrCreateProperties).getFirst();<NEW_LINE>if (grant == null) {<NEW_LINE>grant = app.create(SchemaGrant.class, getOrCreateProperties);<NEW_LINE>}<NEW_LINE>updateProperties.put(SchemaGrant.allowRead, getAllowRead());<NEW_LINE>updateProperties.put(SchemaGrant.allowWrite, getAllowWrite());<NEW_LINE>updateProperties.put(SchemaGrant.allowDelete, getAllowDelete());<NEW_LINE>updateProperties.put(<MASK><NEW_LINE>grant.setProperties(SecurityContext.getSuperUserInstance(), updateProperties);<NEW_LINE>this.schemaGrant = grant;<NEW_LINE>return grant;<NEW_LINE>}
SchemaGrant.allowAccessControl, getAllowAccessControl());
1,322,529
public void visitElement(@NotNull PsiElement element) {<NEW_LINE>if (hasFragments.get()) {<NEW_LINE>// done<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (element instanceof GraphQLDefinition) {<NEW_LINE>if (element instanceof GraphQLFragmentDefinition) {<NEW_LINE>hasFragments.set(true);<NEW_LINE>}<NEW_LINE>// no need to visit deeper than definitions since fragments are top level<NEW_LINE>return;<NEW_LINE>} else if (element instanceof PsiLanguageInjectionHost && graphQLInjectionSearchHelper != null) {<NEW_LINE>if (graphQLInjectionSearchHelper.isGraphQLLanguageInjectionTarget(element)) {<NEW_LINE>final PsiFileFactory psiFileFactory = PsiFileFactory.<MASK><NEW_LINE>final String graphqlBuffer = StringUtils.strip(element.getText(), "` \t\n");<NEW_LINE>final PsiFile graphqlInjectedPsiFile = psiFileFactory.createFileFromText("", GraphQLFileType.INSTANCE, graphqlBuffer, 0, false, false);<NEW_LINE>graphqlInjectedPsiFile.accept(identifierVisitor.get());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>super.visitElement(element);<NEW_LINE>}
getInstance(element.getProject());
584,213
public CalculateRouteCarModeOptions unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>AwsJsonReader reader = context.getReader();<NEW_LINE>if (!reader.isContainer()) {<NEW_LINE>reader.skipValue();<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>CalculateRouteCarModeOptions calculateRouteCarModeOptions = new CalculateRouteCarModeOptions();<NEW_LINE>reader.beginObject();<NEW_LINE>while (reader.hasNext()) {<NEW_LINE>String name = reader.nextName();<NEW_LINE>if (name.equals("AvoidFerries")) {<NEW_LINE>calculateRouteCarModeOptions.setAvoidFerries(BooleanJsonUnmarshaller.getInstance<MASK><NEW_LINE>} else if (name.equals("AvoidTolls")) {<NEW_LINE>calculateRouteCarModeOptions.setAvoidTolls(BooleanJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else {<NEW_LINE>reader.skipValue();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>reader.endObject();<NEW_LINE>return calculateRouteCarModeOptions;<NEW_LINE>}
().unmarshall(context));