idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
278,749
public void actionPerformed(ActionEvent e) {<NEW_LINE>X509Metadata metadata = new X509Metadata("whocares", "whocares");<NEW_LINE>File certificatesConfigFile = new File(folder, X509Utils.CA_CONFIG);<NEW_LINE>FileBasedConfig config = new FileBasedConfig(certificatesConfigFile, FS.detect());<NEW_LINE>NewCertificateConfig certificateConfig = null;<NEW_LINE>if (certificatesConfigFile.exists()) {<NEW_LINE>try {<NEW_LINE>config.load();<NEW_LINE>} catch (Exception x) {<NEW_LINE>Utils.showException(GitblitAuthority.this, x);<NEW_LINE>}<NEW_LINE>certificateConfig = NewCertificateConfig.KEY.parse(config);<NEW_LINE>certificateConfig.update(metadata);<NEW_LINE>}<NEW_LINE>InputVerifier verifier = new InputVerifier() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean verify(JComponent comp) {<NEW_LINE>boolean returnValue;<NEW_LINE>JTextField textField = (JTextField) comp;<NEW_LINE>try {<NEW_LINE>Integer.parseInt(textField.getText());<NEW_LINE>returnValue = true;<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>returnValue = false;<NEW_LINE>}<NEW_LINE>return returnValue;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>JTextField siteNameTF = new JTextField(20);<NEW_LINE>siteNameTF.setText(gitblitSettings.getString(Keys.web.siteName, "Gitblit"));<NEW_LINE>JPanel siteNamePanel = Utils.newFieldPanel(Translation.get("gb.siteName"), siteNameTF, Translation.get("gb.siteNameDescription"));<NEW_LINE>JTextField validityTF = new JTextField(4);<NEW_LINE>validityTF.setInputVerifier(verifier);<NEW_LINE>validityTF.setVerifyInputWhenFocusTarget(true);<NEW_LINE>validityTF.setText("" + certificateConfig.duration);<NEW_LINE>JPanel validityPanel = Utils.newFieldPanel(Translation.get("gb.validity"), validityTF, Translation.get("gb.duration.days").replace("{0}", "").trim());<NEW_LINE>JPanel p1 = new JPanel(new GridLayout(0, 1, 5, 2));<NEW_LINE>p1.add(siteNamePanel);<NEW_LINE>p1.add(validityPanel);<NEW_LINE>DefaultOidsPanel oids = new DefaultOidsPanel(metadata);<NEW_LINE>JPanel panel = new JPanel(new BorderLayout());<NEW_LINE>panel.add(p1, BorderLayout.NORTH);<NEW_LINE>panel.add(oids, BorderLayout.CENTER);<NEW_LINE>int result = JOptionPane.showConfirmDialog(GitblitAuthority.this, panel, Translation.get("gb.newCertificateDefaults"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, new ImageIcon(getClass().getResource("/settings_32x32.png")));<NEW_LINE>if (result == JOptionPane.OK_OPTION) {<NEW_LINE>try {<NEW_LINE>oids.update(metadata);<NEW_LINE>certificateConfig.duration = Integer.parseInt(validityTF.getText());<NEW_LINE><MASK><NEW_LINE>config.save();<NEW_LINE>Map<String, String> updates = new HashMap<String, String>();<NEW_LINE>updates.put(Keys.web.siteName, siteNameTF.getText());<NEW_LINE>gitblitSettings.saveSettings(updates);<NEW_LINE>} catch (Exception e1) {<NEW_LINE>Utils.showException(GitblitAuthority.this, e1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
certificateConfig.store(config, metadata);
596,782
public Void execute(CommandContext commandContext) {<NEW_LINE>if (appDefinitionId == null) {<NEW_LINE>throw new FlowableIllegalArgumentException("appDefinitionId is null");<NEW_LINE>}<NEW_LINE>if (variables == null) {<NEW_LINE>throw new FlowableIllegalArgumentException("variables is null");<NEW_LINE>}<NEW_LINE>if (variables.isEmpty()) {<NEW_LINE>throw new FlowableIllegalArgumentException("variables is empty");<NEW_LINE>}<NEW_LINE>VariableTypes variableTypes = CommandContextUtil.getAppEngineConfiguration().getVariableTypes();<NEW_LINE>VariableService variableService = CommandContextUtil.getVariableService(commandContext);<NEW_LINE>for (String variableName : variables.keySet()) {<NEW_LINE>Object variableValue = variables.get(variableName);<NEW_LINE>VariableType type = variableTypes.findVariableType(variableValue);<NEW_LINE>VariableInstanceEntity variableInstance = <MASK><NEW_LINE>variableInstance.setScopeId(appDefinitionId);<NEW_LINE>variableInstance.setScopeType(ScopeTypes.APP);<NEW_LINE>variableInstance.setValue(variableValue);<NEW_LINE>variableService.updateVariableInstance(variableInstance);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
variableService.createVariableInstance(variableName, type);
1,315,763
public void testMSExcel() throws IOException {<NEW_LINE>File demoDocument = null;<NEW_LINE>MSExcel msExcel = null;<NEW_LINE>try {<NEW_LINE>msExcel = new MSExcel();<NEW_LINE>System.out.println(<MASK><NEW_LINE>msExcel.setVisible(true);<NEW_LINE>Helper.sleep(5);<NEW_LINE>demoDocument = Helper.createNotExistingFile("jnatest", ".xls");<NEW_LINE>Helper.extractClasspathFileToReal("/com/sun/jna/platform/win32/COM/util/office/resources/jnatest.xls", demoDocument);<NEW_LINE>msExcel.openExcelBook(demoDocument.getAbsolutePath());<NEW_LINE>msExcel.insertValue("A1", "Hello from JNA!");<NEW_LINE>// wait 10sec. before closing<NEW_LINE>Helper.sleep(10);<NEW_LINE>// close and save the active sheet<NEW_LINE>msExcel.closeActiveWorkbook(true);<NEW_LINE>msExcel.newExcelBook();<NEW_LINE>msExcel.insertValue("A1", "Hello from JNA!");<NEW_LINE>// close and save the active sheet<NEW_LINE>msExcel.closeActiveWorkbook(true);<NEW_LINE>} finally {<NEW_LINE>if (msExcel != null) {<NEW_LINE>msExcel.quit();<NEW_LINE>}<NEW_LINE>if (demoDocument != null && demoDocument.exists()) {<NEW_LINE>demoDocument.delete();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
"MSExcel version: " + msExcel.getVersion());
109,900
public void init(Context context) {<NEW_LINE>setOrientation(VERTICAL);<NEW_LINE>setDividerDrawable(context.getResources().getDrawable(R.drawable.spacer_keyline));<NEW_LINE>setShowDividers(SHOW_DIVIDER_MIDDLE);<NEW_LINE>setClipChildren(false);<NEW_LINE>setClipToPadding(false);<NEW_LINE>LayoutInflater.from(context).inflate(R.layout.widget_image_search, this);<NEW_LINE>mPreview = (ImageView) ViewUtils.$$(this, R.id.preview);<NEW_LINE>mSelectImage = ViewUtils.$$(this, R.id.select_image);<NEW_LINE>mSearchUSS = (CheckBox) ViewUtils.$$(this, R.id.search_uss);<NEW_LINE>mSearchOSC = (CheckBox) ViewUtils.$$(this, R.id.search_osc);<NEW_LINE>mSearchSE = (CheckBox) ViewUtils.$$(<MASK><NEW_LINE>mSelectImage.setOnClickListener(this);<NEW_LINE>}
this, R.id.search_se);
1,194,573
public // d681743<NEW_LINE>// d681743<NEW_LINE>void // d681743<NEW_LINE>mergeSaved(InjectionBinding<EJB> injectionBinding) throws InjectionException {<NEW_LINE>EJBInjectionBinding ejbBinding = (EJBInjectionBinding) injectionBinding;<NEW_LINE>mergeSavedValue(getInjectionClassType(), ejbBinding.getInjectionClassType(), "bean-interface");<NEW_LINE>mergeSavedValue(<MASK><NEW_LINE>mergeSavedValue(ivLookup, ejbBinding.ivLookup, "lookup");<NEW_LINE>mergeSavedValue(ivBindingName, ejbBinding.ivBindingName, "binding-name");<NEW_LINE>// ejb-ref-type (Session or Entity) and home/local-home can only be<NEW_LINE>// specified in XML, so we can only detect mismatches if both bindings<NEW_LINE>// are specified in XML. We don't want errors to be non-deterministic,<NEW_LINE>// but we don't know if we'll see, across multiple components, whether<NEW_LINE>// the "saved" binding will annotation or XML, which has an effect on<NEW_LINE>// subsequent bindings, so we skip validation altogether.<NEW_LINE>}
ivBeanName, ejbBinding.ivBeanName, "ejb-link");
1,463,265
protected ImmutableSet<Either<SymbolInformation, DocumentSymbol>> compute() {<NEW_LINE>status.setValue<MASK><NEW_LINE>try {<NEW_LINE>SymbolsProvider sp = currentSymbolsProvider.getValue();<NEW_LINE>if (sp != null) {<NEW_LINE>String currentProviderName = sp.getName();<NEW_LINE>debug("Fetching " + currentProviderName);<NEW_LINE>String query = searchBox.getValue();<NEW_LINE>debug("Fetching symbols... from symbol provider, for '" + query + "'");<NEW_LINE>Collection<Either<SymbolInformation, DocumentSymbol>> fetched = sp.fetchFor(query);<NEW_LINE>if (keyBindings == null) {<NEW_LINE>status.setValue(HighlightedText.plain(currentProviderName));<NEW_LINE>} else {<NEW_LINE>status.setValue(HighlightedText.create().appendHighlight("Showing ").appendHighlight(currentProviderName).appendPlain(". Press [" + keyBindings + "] for ").appendPlain(nextSymbolsProvider().getName()));<NEW_LINE>}<NEW_LINE>return ImmutableSet.copyOf(fetched);<NEW_LINE>} else {<NEW_LINE>status.setValue(HighlightedText.plain("No symbol provider"));<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>GotoSymbolPlugin.getInstance().getLog().log(ExceptionUtil.status(e));<NEW_LINE>status.setValue(HighlightedText.plain(ExceptionUtil.getMessage(e)));<NEW_LINE>}<NEW_LINE>return ImmutableSet.of();<NEW_LINE>}
(HighlightedText.plain("Fetching symbols..."));
65,350
public Set<Template> parse(InputStreamReader reader) throws ParsingException {<NEW_LINE>JsonReader jr = new JsonReader(reader);<NEW_LINE>try {<NEW_LINE>if (jr.hasNext()) {<NEW_LINE>JsonToken token = jr.peek();<NEW_LINE>Set<Template> templates = new HashSet<>();<NEW_LINE>if (JsonToken.BEGIN_ARRAY.equals(token)) {<NEW_LINE>List<RuleTemplateDTO> templateDtos = gson.fromJson(jr, new TypeToken<List<RuleTemplateDTO>>() {<NEW_LINE>}.getType());<NEW_LINE>for (RuleTemplateDTO templateDto : templateDtos) {<NEW_LINE>templates.add(RuleTemplateDTOMapper.map(templateDto));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>RuleTemplateDTO template = gson.fromJson(jr, RuleTemplateDTO.class);<NEW_LINE>templates.add(RuleTemplateDTOMapper.map(template));<NEW_LINE>}<NEW_LINE>return templates;<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new ParsingException(new ParsingNestedException(ParsingNestedException<MASK><NEW_LINE>} finally {<NEW_LINE>try {<NEW_LINE>jr.close();<NEW_LINE>} catch (IOException e) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return Collections.emptySet();<NEW_LINE>}
.TEMPLATE, null, e));
1,097,476
final void startReceiver(CoreSubscriber<? super Object> s) {<NEW_LINE>if (once == 0 && ONCE.compareAndSet(this, 0, 1)) {<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug(format<MASK><NEW_LINE>}<NEW_LINE>if (inboundDone && getPending() == 0) {<NEW_LINE>if (inboundError != null) {<NEW_LINE>Operators.error(s, inboundError);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Operators.complete(s);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>receiver = s;<NEW_LINE>s.onSubscribe(this);<NEW_LINE>} else {<NEW_LINE>if (inboundDone && getPending() == 0) {<NEW_LINE>if (inboundError != null) {<NEW_LINE>Operators.error(s, inboundError);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Operators.complete(s);<NEW_LINE>} else {<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug(format(channel, "{}: Only one connection receive subscriber allowed."), this);<NEW_LINE>}<NEW_LINE>Operators.error(s, new IllegalStateException("Only one connection receive subscriber allowed."));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
(channel, "{}: subscribing inbound receiver"), this);
1,559,324
public static List<Interval> toIntervals(final RangeSet<Long> rangeSet) {<NEW_LINE>final List<Interval> retVal = new ArrayList<>();<NEW_LINE>for (Range<Long> range : rangeSet.asRanges()) {<NEW_LINE>final long start;<NEW_LINE>final long end;<NEW_LINE>if (range.hasLowerBound()) {<NEW_LINE>final long millis = range.lowerEndpoint();<NEW_LINE>start = millis + (range.lowerBoundType() == BoundType.OPEN ? 1 : 0);<NEW_LINE>} else {<NEW_LINE>start = Filtration<MASK><NEW_LINE>}<NEW_LINE>if (range.hasUpperBound()) {<NEW_LINE>final long millis = range.upperEndpoint();<NEW_LINE>end = millis + (range.upperBoundType() == BoundType.OPEN ? 0 : 1);<NEW_LINE>} else {<NEW_LINE>end = Filtration.eternity().getEndMillis();<NEW_LINE>}<NEW_LINE>retVal.add(Intervals.utc(start, end));<NEW_LINE>}<NEW_LINE>return retVal;<NEW_LINE>}
.eternity().getStartMillis();
559,829
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {<NEW_LINE>if (((bitField0_ & 0x00000001) == 0x00000001)) {<NEW_LINE>com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_);<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000002) == 0x00000002)) {<NEW_LINE>output.<MASK><NEW_LINE>}<NEW_LINE>for (int i = 0; i < rules_.size(); i++) {<NEW_LINE>output.writeMessage(3, rules_.get(i));<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000004) == 0x00000004)) {<NEW_LINE>com.google.protobuf.GeneratedMessageV3.writeString(output, 4, failurePolicy_);<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000010) == 0x00000010)) {<NEW_LINE>output.writeMessage(5, getNamespaceSelector());<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000040) == 0x00000040)) {<NEW_LINE>com.google.protobuf.GeneratedMessageV3.writeString(output, 6, sideEffects_);<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000080) == 0x00000080)) {<NEW_LINE>output.writeInt32(7, timeoutSeconds_);<NEW_LINE>}<NEW_LINE>for (int i = 0; i < admissionReviewVersions_.size(); i++) {<NEW_LINE>com.google.protobuf.GeneratedMessageV3.writeString(output, 8, admissionReviewVersions_.getRaw(i));<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000008) == 0x00000008)) {<NEW_LINE>com.google.protobuf.GeneratedMessageV3.writeString(output, 9, matchPolicy_);<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000100) == 0x00000100)) {<NEW_LINE>com.google.protobuf.GeneratedMessageV3.writeString(output, 10, reinvocationPolicy_);<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000020) == 0x00000020)) {<NEW_LINE>output.writeMessage(11, getObjectSelector());<NEW_LINE>}<NEW_LINE>unknownFields.writeTo(output);<NEW_LINE>}
writeMessage(2, getClientConfig());
1,670,279
public okhttp3.Call readNamespacedDeploymentScaleCall(String name, String namespace, String pretty, final ApiCallback _callback) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/apis/apps/v1/namespaces/{namespace}/deployments/{name}/scale".replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString())).replaceAll("\\{" + "namespace" + "\\}", localVarApiClient.escapeString(namespace.toString()));<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();<NEW_LINE>if (pretty != null) {<NEW_LINE>localVarQueryParams.addAll(localVarApiClient.parameterToPair("pretty", pretty));<NEW_LINE>}<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, String> localVarCookieParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts <MASK><NEW_LINE>final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>if (localVarAccept != null) {<NEW_LINE>localVarHeaderParams.put("Accept", localVarAccept);<NEW_LINE>}<NEW_LINE>final String[] localVarContentTypes = {};<NEW_LINE>final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>String[] localVarAuthNames = new String[] { "BearerToken" };<NEW_LINE>return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);<NEW_LINE>}
= { "application/json", "application/yaml", "application/vnd.kubernetes.protobuf" };
1,402,778
final CacheCluster executeRebootCacheCluster(RebootCacheClusterRequest rebootCacheClusterRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(rebootCacheClusterRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<RebootCacheClusterRequest> request = null;<NEW_LINE>Response<CacheCluster> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new RebootCacheClusterRequestMarshaller().marshall(super.beforeMarshalling(rebootCacheClusterRequest));<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, "ElastiCache");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<CacheCluster> responseHandler = new StaxResponseHandler<CacheCluster>(new CacheClusterStaxUnmarshaller());<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, "RebootCacheCluster");
279,011
private QueryBuilder withinQuery(String fieldName, Object[] valArray) {<NEW_LINE>GeoDistanceQueryBuilder filter = QueryBuilders.geoDistanceQuery(fieldName);<NEW_LINE>Assert.noNullElements(valArray, "Geo distance filter takes 2 not null elements array as parameter.");<NEW_LINE>Assert.isTrue(<MASK><NEW_LINE>Assert.isTrue(valArray[0] instanceof GeoPoint || valArray[0] instanceof String || valArray[0] instanceof Point, "First element of a geo distance filter must be a GeoPoint, a Point or a text");<NEW_LINE>Assert.isTrue(valArray[1] instanceof String || valArray[1] instanceof Distance, "Second element of a geo distance filter must be a text or a Distance");<NEW_LINE>StringBuilder dist = new StringBuilder();<NEW_LINE>if (valArray[1] instanceof Distance) {<NEW_LINE>extractDistanceString((Distance) valArray[1], dist);<NEW_LINE>} else {<NEW_LINE>dist.append((String) valArray[1]);<NEW_LINE>}<NEW_LINE>if (valArray[0] instanceof GeoPoint) {<NEW_LINE>GeoPoint loc = (GeoPoint) valArray[0];<NEW_LINE>filter.point(loc.getLat(), loc.getLon()).distance(dist.toString()).geoDistance(GeoDistance.PLANE);<NEW_LINE>} else if (valArray[0] instanceof Point) {<NEW_LINE>GeoPoint loc = GeoPoint.fromPoint((Point) valArray[0]);<NEW_LINE>filter.point(loc.getLat(), loc.getLon()).distance(dist.toString()).geoDistance(GeoDistance.PLANE);<NEW_LINE>} else {<NEW_LINE>String loc = (String) valArray[0];<NEW_LINE>if (loc.contains(",")) {<NEW_LINE>String[] c = loc.split(",");<NEW_LINE>filter.point(Double.parseDouble(c[0]), Double.parseDouble(c[1])).distance(dist.toString()).geoDistance(GeoDistance.PLANE);<NEW_LINE>} else {<NEW_LINE>filter.geohash(loc).distance(dist.toString()).geoDistance(GeoDistance.PLANE);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return filter;<NEW_LINE>}
valArray.length == 2, "Geo distance filter takes a 2-elements array as parameter.");
84,653
public void receiveTouches(String eventName, WritableArray touches, WritableArray changedIndices) {<NEW_LINE>Assertions.assertCondition(touches.size() > 0);<NEW_LINE>int reactTag = touches.getMap(0).getInt(TARGET_KEY);<NEW_LINE>@UIManagerType<NEW_LINE>int uiManagerType = ViewUtil.getUIManagerType(reactTag);<NEW_LINE>if (uiManagerType == UIManagerType.FABRIC && mFabricEventEmitter != null) {<NEW_LINE>mFabricEventEmitter.receiveTouches(eventName, touches, changedIndices);<NEW_LINE>} else if (uiManagerType == UIManagerType.DEFAULT && getEventEmitter(reactTag) != null) {<NEW_LINE>mRCTEventEmitter.<MASK><NEW_LINE>} else {<NEW_LINE>ReactSoftExceptionLogger.logSoftException(TAG, new ReactNoCrashSoftException("Cannot find EventEmitter for receivedTouches: ReactTag[" + reactTag + "] UIManagerType[" + uiManagerType + "] EventName[" + eventName + "]"));<NEW_LINE>}<NEW_LINE>}
receiveTouches(eventName, touches, changedIndices);
436,287
public boolean hashCodesEqual(@Nonnull final ASTNode n1, @Nonnull final LighterASTNode n2) {<NEW_LINE>if (n1 instanceof LeafElement && n2 instanceof Token) {<NEW_LINE>boolean isForeign1 = n1 instanceof ForeignLeafPsiElement;<NEW_LINE>boolean isForeign2 <MASK><NEW_LINE>if (isForeign1 != isForeign2)<NEW_LINE>return false;<NEW_LINE>if (isForeign1) {<NEW_LINE>return StringUtil.equals(n1.getText(), ((ForeignLeafType) n2.getTokenType()).getValue());<NEW_LINE>}<NEW_LINE>return ((LeafElement) n1).textMatches(((Token) n2).getText());<NEW_LINE>}<NEW_LINE>if (n1 instanceof PsiErrorElement && n2.getTokenType() == TokenType.ERROR_ELEMENT) {<NEW_LINE>final PsiErrorElement e1 = (PsiErrorElement) n1;<NEW_LINE>if (!Objects.equals(e1.getErrorDescriptionValue(), getErrorMessage(n2)))<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return ((TreeElement) n1).hc() == ((Node) n2).hc();<NEW_LINE>}
= n2.getTokenType() instanceof ForeignLeafType;
1,236,366
public static void unzipFile(File zipFile, File targetDirectory) throws IOException {<NEW_LINE>checkNotNull(zipFile);<NEW_LINE>checkNotNull(targetDirectory);<NEW_LINE>checkArgument(targetDirectory.isDirectory(), "%s is not a valid directory", targetDirectory.getAbsolutePath());<NEW_LINE>final ZipFile zipFileObj = new ZipFile(zipFile);<NEW_LINE>try {<NEW_LINE>for (ZipEntry entry : entries(zipFileObj)) {<NEW_LINE>checkName(entry.getName());<NEW_LINE>File targetFile = new File(targetDirectory, entry.getName());<NEW_LINE>if (entry.isDirectory()) {<NEW_LINE>if (!targetFile.isDirectory() && !targetFile.mkdirs()) {<NEW_LINE>throw new IOException("Failed to create directory: " + targetFile.getAbsolutePath());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>if (!parentFile.isDirectory()) {<NEW_LINE>if (!parentFile.mkdirs()) {<NEW_LINE>throw new IOException("Failed to create directory: " + parentFile.getAbsolutePath());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Write the file to the destination.<NEW_LINE>asByteSource(zipFileObj, entry).copyTo(Files.asByteSink(targetFile));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>zipFileObj.close();<NEW_LINE>}<NEW_LINE>}
File parentFile = targetFile.getParentFile();
1,011,481
public static LatLon decodeMapsMeLatLonToInt(String s) {<NEW_LINE>// 44TvlEGXf-<NEW_LINE>int lat = 0, lon = 0;<NEW_LINE>int shift = kMaxCoordBits - 3;<NEW_LINE>for (int i = 0; i < s.length(); ++i, shift -= 3) {<NEW_LINE>int a = net.osmand.osm.io.Base64.indexOf(s.charAt(i));<NEW_LINE>if (a < 0)<NEW_LINE>return null;<NEW_LINE>int lat1 = (((a >> 5) & 1) << 2 | ((a >> 3) & 1) << 1 | ((a >> 1) & 1));<NEW_LINE>int lon1 = (((a >> 4) & 1) << 2 | ((a >> 2) & 1) << 1 | (a & 1));<NEW_LINE>lat |= lat1 << shift;<NEW_LINE>lon |= lon1 << shift;<NEW_LINE>}<NEW_LINE>double middleOfSquare = 1 << (3 * (kMaxPointBytes - s.length()) - 1);<NEW_LINE>lat += middleOfSquare;<NEW_LINE>lon += middleOfSquare;<NEW_LINE>double dlat = ((double) lat) / ((1 << kMaxCoordBits) - 1) * 180 - 90;<NEW_LINE>double dlon = ((double) lon) / ((1 << kMaxCoordBits) - <MASK><NEW_LINE>return new LatLon(dlat, dlon);<NEW_LINE>}
1 + 1) * 360.0 - 180;
1,211,955
public void draw(final BoundingBox boundingBox, final byte zoomLevel, final Canvas canvas, final Point topLeftPoint) {<NEW_LINE>if (coordinates == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// prepare accuracy circle<NEW_LINE>final float accuracy = coordinates.getAccuracy();<NEW_LINE>if (accuracyCircle == null) {<NEW_LINE>accuracyCircle = AndroidGraphicFactory.INSTANCE.createPaint();<NEW_LINE>accuracyCircle.setStyle(Style.STROKE);<NEW_LINE>accuracyCircle.setStrokeWidth(1.0f);<NEW_LINE>accuracyCircle.setColor(MapLineUtils.getAccuracyCircleColor());<NEW_LINE>accuracyCircleFill = AndroidGraphicFactory.INSTANCE.createPaint();<NEW_LINE>accuracyCircleFill.setStyle(Style.FILL);<NEW_LINE>accuracyCircleFill.setColor(MapLineUtils.getAccuracyCircleFillColor());<NEW_LINE>}<NEW_LINE>if (accuracy >= 0) {<NEW_LINE>final Circle circle = new Circle(location, accuracy, accuracyCircleFill, accuracyCircle);<NEW_LINE>circle.setDisplayModel(this.getDisplayModel());<NEW_LINE>circle.draw(boundingBox, zoomLevel, canvas, topLeftPoint);<NEW_LINE>}<NEW_LINE>// prepare heading indicator<NEW_LINE>final long mapSize = MercatorProjection.getMapSize(zoomLevel, this.displayModel.getTileSize());<NEW_LINE>final double pixelX = MercatorProjection.longitudeToPixelX(this.location.longitude, mapSize);<NEW_LINE>final double pixelY = MercatorProjection.latitudeToPixelY(this.location.latitude, mapSize);<NEW_LINE>final int centerX = (int) (pixelX - topLeftPoint.x);<NEW_LINE>final int centerY = (int) (pixelY - topLeftPoint.y);<NEW_LINE>if (arrow == null) {<NEW_LINE>arrowNative = BitmapFactory.decodeResource(CgeoApplication.getInstance().getResources(), R.drawable.my_location_chevron);<NEW_LINE>rotateArrow();<NEW_LINE>}<NEW_LINE>final int left = centerX - widthArrowHalf;<NEW_LINE>final int top = centerY - heightArrowHalf;<NEW_LINE>final int right = left + this.arrow.getWidth();<NEW_LINE>final int bottom = top + this.arrow.getHeight();<NEW_LINE>final Rectangle bitmapRectangle = new Rectangle(left, top, right, bottom);<NEW_LINE>final Rectangle canvasRectangle = new Rectangle(0, 0, canvas.getWidth(<MASK><NEW_LINE>if (!canvasRectangle.intersects(bitmapRectangle)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>canvas.drawBitmap(arrow, left, top);<NEW_LINE>}
), canvas.getHeight());
1,184,463
final GetMemberResult executeGetMember(GetMemberRequest getMemberRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getMemberRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetMemberRequest> request = null;<NEW_LINE>Response<GetMemberResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetMemberRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getMemberRequest));<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, "Inspector2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetMember");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetMemberResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetMemberResultJsonUnmarshaller());<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);
334,570
public Parameterable createParameterable(String paramString) throws ServletParseException {<NEW_LINE>if (c_logger.isTraceEntryExitEnabled()) {<NEW_LINE>Object[] params = { paramString };<NEW_LINE>c_logger.traceEntry(this, "createParameterable", params);<NEW_LINE>}<NEW_LINE>if (paramString == null) {<NEW_LINE>throw new IllegalArgumentException("null parameterable string");<NEW_LINE>}<NEW_LINE>// try to create the header as an address header. if it doesn't parse<NEW_LINE>// as an address, try as a generic parameters header.<NEW_LINE>ParametersHeaderImpl parametersHeader = new GenericNameAddressHeaderImpl("IBM-GenericAddressHeader");<NEW_LINE>try {<NEW_LINE>parametersHeader.setValue(paramString);<NEW_LINE>parametersHeader.parse();<NEW_LINE>} catch (SipParseException dontPrintMe) {<NEW_LINE>parametersHeader = new GenericParametersHeaderImpl("IBM-GenericParametersHeader");<NEW_LINE>try {<NEW_LINE>parametersHeader.setValue(paramString);<NEW_LINE>parametersHeader.parse();<NEW_LINE>} catch (SipParseException e) {<NEW_LINE>// not a parameters header. give up.<NEW_LINE>throw new <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>// wrap the parameters header with a new parameterable<NEW_LINE>ParameterableImpl parameterable = new ParameterableImpl(parametersHeader);<NEW_LINE>if (c_logger.isTraceDebugEnabled()) {<NEW_LINE>c_logger.traceDebug(this, "createParameterable", "parameterable created [" + parameterable + ']');<NEW_LINE>}<NEW_LINE>return parameterable;<NEW_LINE>}
ServletParseException("bad parameterable syntax [" + paramString + ']');
1,829,920
void handleHandshake(TransportChannel channel, long requestId, StreamInput stream) throws IOException {<NEW_LINE>// Must read the handshake request to exhaust the stream<NEW_LINE>HandshakeRequest handshakeRequest = new HandshakeRequest(stream);<NEW_LINE>final int nextByte = stream.read();<NEW_LINE>if (nextByte != -1) {<NEW_LINE>throw new IllegalStateException("Handshake request not fully read for requestId [" + requestId + "], action [" + TransportHandshaker.HANDSHAKE_ACTION_NAME + "], available [" + stream.available() + "]; resetting");<NEW_LINE>}<NEW_LINE>// 1. if remote node is 7.x, then StreamInput version would be 6.8.0<NEW_LINE>// 2. if remote node is 6.8 then it would be 5.6.0<NEW_LINE>// 3. if remote node is OpenSearch 1.x then it would be 6.7.99<NEW_LINE>if ((this.version.onOrAfter(Version.V_1_0_0) && this.version.before(Version.V_3_0_0)) && (stream.getVersion().equals(LegacyESVersion.fromId(6080099)) || stream.getVersion().equals(Version.fromId(5060099)))) {<NEW_LINE>// send 7.10.2 in response to ensure compatibility w/ Legacy 7.10.x nodes for rolling upgrade support<NEW_LINE>channel.sendResponse(new HandshakeResponse(LegacyESVersion.V_7_10_2));<NEW_LINE>} else {<NEW_LINE>channel.sendResponse(<MASK><NEW_LINE>}<NEW_LINE>}
new HandshakeResponse(this.version));
1,311,771
public static void showInputDialog(String initialText, int maxLen) {<NEW_LINE>new Handler(Looper.getMainLooper()).post(() -> {<NEW_LINE>if (inputDialog == null) {<NEW_LINE>EditText editText = new EditText(context);<NEW_LINE>editText.setLines(3);<NEW_LINE>editText.setText(initialText);<NEW_LINE>float density = context.getResources().getDisplayMetrics().density;<NEW_LINE>LinearLayout linearLayout = new LinearLayout(context);<NEW_LINE>LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);<NEW_LINE>int margin = (int) (density * 20);<NEW_LINE>params.setMargins(margin, 0, margin, 0);<NEW_LINE><MASK><NEW_LINE>int paddingVertical = (int) (density * 16);<NEW_LINE>int paddingHorizontal = (int) (density * 8);<NEW_LINE>editText.setPadding(paddingHorizontal, paddingVertical, paddingHorizontal, paddingVertical);<NEW_LINE>AlertDialog.Builder builder = new AlertDialog.Builder(context).setTitle(R.string.enter_text).setView(linearLayout).setPositiveButton(android.R.string.ok, (dialogInterface, i) -> {<NEW_LINE>Emulator.submitInput(editText.getText().toString());<NEW_LINE>inputDialog = null;<NEW_LINE>}).setNegativeButton(android.R.string.cancel, (dialogInterface, i) -> {<NEW_LINE>Emulator.submitInput("");<NEW_LINE>inputDialog = null;<NEW_LINE>});<NEW_LINE>inputDialog = builder.create();<NEW_LINE>inputDialog.show();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
linearLayout.addView(editText, params);
894,054
private static RangeHighlighter createOrReuseLineMarker(@Nonnull LineMarkerInfo<?> info, @Nonnull MarkupModelEx markupModel, @Nullable HighlightersRecycler toReuse) {<NEW_LINE>LineMarkerInfo.LineMarkerGutterIconRenderer<?> newRenderer = (LineMarkerInfo.LineMarkerGutterIconRenderer<<MASK><NEW_LINE>RangeHighlighter highlighter = toReuse == null ? null : toReuse.pickupHighlighterFromGarbageBin(info.startOffset, info.endOffset, HighlighterLayer.ADDITIONAL_SYNTAX);<NEW_LINE>boolean newHighlighter = false;<NEW_LINE>if (highlighter == null) {<NEW_LINE>newHighlighter = true;<NEW_LINE>highlighter = markupModel.addRangeHighlighterAndChangeAttributes(info.startOffset, info.endOffset, HighlighterLayer.ADDITIONAL_SYNTAX, null, HighlighterTargetArea.LINES_IN_RANGE, false, markerEx -> {<NEW_LINE>markerEx.setGutterIconRenderer(newRenderer);<NEW_LINE>markerEx.setLineSeparatorColor(TargetAWT.to(info.separatorColor));<NEW_LINE>markerEx.setLineSeparatorPlacement(info.separatorPlacement);<NEW_LINE>markerEx.putUserData(LINE_MARKER_INFO, info);<NEW_LINE>});<NEW_LINE>MarkupEditorFilter editorFilter = info.getEditorFilter();<NEW_LINE>if (editorFilter != MarkupEditorFilter.EMPTY) {<NEW_LINE>highlighter.setEditorFilter(editorFilter);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!newHighlighter) {<NEW_LINE>highlighter.putUserData(LINE_MARKER_INFO, info);<NEW_LINE>LineMarkerInfo.LineMarkerGutterIconRenderer<?> oldRenderer = highlighter.getGutterIconRenderer() instanceof LineMarkerInfo.LineMarkerGutterIconRenderer ? (LineMarkerInfo.LineMarkerGutterIconRenderer<?>) highlighter.getGutterIconRenderer() : null;<NEW_LINE>boolean rendererChanged = newRenderer == null || !newRenderer.equals(oldRenderer);<NEW_LINE>boolean lineSeparatorColorChanged = !Comparing.equal(highlighter.getLineSeparatorColor(), info.separatorColor);<NEW_LINE>boolean lineSeparatorPlacementChanged = !Comparing.equal(highlighter.getLineSeparatorPlacement(), info.separatorPlacement);<NEW_LINE>if (rendererChanged || lineSeparatorColorChanged || lineSeparatorPlacementChanged) {<NEW_LINE>markupModel.changeAttributesInBatch((RangeHighlighterEx) highlighter, markerEx -> {<NEW_LINE>if (rendererChanged) {<NEW_LINE>markerEx.setGutterIconRenderer(newRenderer);<NEW_LINE>}<NEW_LINE>if (lineSeparatorColorChanged) {<NEW_LINE>markerEx.setLineSeparatorColor(TargetAWT.to(info.separatorColor));<NEW_LINE>}<NEW_LINE>if (lineSeparatorPlacementChanged) {<NEW_LINE>markerEx.setLineSeparatorPlacement(info.separatorPlacement);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}<NEW_LINE>info.highlighter = highlighter;<NEW_LINE>return highlighter;<NEW_LINE>}
?>) info.createGutterRenderer();
675,276
public IInvoiceGenerateResult generateInvoicesFromQueue(final Properties ctx) {<NEW_LINE>// note that we don't want to store the actual invoices in the result to omit memory-problems<NEW_LINE>final InvoiceGenerateResult result = new InvoiceGenerateResult(false);<NEW_LINE>final IWorkpackageProcessor packageProcessor = new InvoiceCandWorkpackageProcessor(result);<NEW_LINE>// We use a stateful package processor factory because we don't want to create a new instance of InvoiceCandWorkpackageProcessor for each work package<NEW_LINE>// This is because we want to preserve InvoiceGenerateResult state<NEW_LINE>final IStatefulWorkpackageProcessorFactory packageProcessorFactory = Services.get(IStatefulWorkpackageProcessorFactory.class);<NEW_LINE>packageProcessorFactory.registerWorkpackageProcessor(packageProcessor);<NEW_LINE>final IWorkPackageQueue packageQueue = Services.get(IWorkPackageQueueFactory.class).getQueueForEnqueuing(<MASK><NEW_LINE>final IQueueProcessor queueProcessor = Services.get(IQueueProcessorFactory.class).createSynchronousQueueProcessor(packageQueue);<NEW_LINE>queueProcessor.setWorkpackageProcessorFactory(packageProcessorFactory);<NEW_LINE>SynchronousProcessorPlanner.executeNow(queueProcessor);<NEW_LINE>return result;<NEW_LINE>}
ctx, packageProcessor.getClass());
1,285,534
protected void prepareBuffer() {<NEW_LINE>// bufferToSend now is the header ByteBuf, it will store serialized header, without blob content and crc<NEW_LINE>bufferToSend = PooledByteBufAllocator.DEFAULT.ioBuffer(sizeExcludingBlobAndCrcSize());<NEW_LINE>writeHeader();<NEW_LINE>int crcStart = bufferToSend.writerIndex();<NEW_LINE>bufferToSend.writeBytes(blobId.toBytes());<NEW_LINE>BlobPropertiesSerDe.serializeBlobProperties(bufferToSend, properties);<NEW_LINE>bufferToSend.writeInt(usermetadata.capacity());<NEW_LINE>bufferToSend.writeBytes(usermetadata);<NEW_LINE>bufferToSend.writeShort((short) blobType.ordinal());<NEW_LINE>short keyLength = blobEncryptionKey == null ? 0 : (short) blobEncryptionKey.remaining();<NEW_LINE>bufferToSend.writeShort(keyLength);<NEW_LINE>if (keyLength > 0) {<NEW_LINE>bufferToSend.writeBytes(blobEncryptionKey);<NEW_LINE>}<NEW_LINE>bufferToSend.writeLong(blobSize);<NEW_LINE>// Now compute crc for the put request.<NEW_LINE>crc.update(bufferToSend.nioBuffer(crcStart, bufferToSend.writerIndex() - crcStart));<NEW_LINE>for (ByteBuffer bb : blob.nioBuffers()) {<NEW_LINE>crc.update(bb);<NEW_LINE>// change it back to 0 since we are going to write it to the channel later.<NEW_LINE>bb.position(0);<NEW_LINE>}<NEW_LINE>crcByteBuf = PooledByteBufAllocator.DEFAULT.ioBuffer(CRC_SIZE_IN_BYTES);<NEW_LINE>crcByteBuf.writeLong(crc.getValue());<NEW_LINE>// Now construct the real bufferToSend, which should be a composite ByteBuf.<NEW_LINE>CompositeByteBuf compositeByteBuf = bufferToSend.alloc().compositeHeapBuffer(2 + blob.nioBufferCount());<NEW_LINE>compositeByteBuf.addComponent(true, bufferToSend);<NEW_LINE>if (blob instanceof CompositeByteBuf) {<NEW_LINE>Iterator<ByteBuf> iter = ((<MASK><NEW_LINE>while (iter.hasNext()) {<NEW_LINE>compositeByteBuf.addComponent(true, iter.next());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>compositeByteBuf.addComponent(true, blob);<NEW_LINE>}<NEW_LINE>compositeByteBuf.addComponent(true, crcByteBuf);<NEW_LINE>blob = null;<NEW_LINE>crcByteBuf = null;<NEW_LINE>bufferToSend = compositeByteBuf;<NEW_LINE>}
CompositeByteBuf) blob).iterator();
804,919
public byte readBufferByte(long index, @Shared("isBuffer") @Cached IsBufferNode isBuffer, @Shared("error") @Cached BranchProfile error, @Shared("classProfile") @Cached("createClassProfile()") ValueProfile classProfile) throws UnsupportedMessageException, InvalidBufferOffsetException {<NEW_LINE>if (!isBuffer.execute(this)) {<NEW_LINE>error.enter();<NEW_LINE>throw UnsupportedMessageException.create();<NEW_LINE>}<NEW_LINE>if (index < 0 || Integer.MAX_VALUE < index) {<NEW_LINE>error.enter();<NEW_LINE>throw InvalidBufferOffsetException.create(index, Byte.BYTES);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>final ByteBuffer buffer = (<MASK><NEW_LINE>return isPEFriendlyBuffer(buffer) ? buffer.get((int) index) : getBufferByteBoundary(buffer, (int) index);<NEW_LINE>} catch (IndexOutOfBoundsException e) {<NEW_LINE>error.enter();<NEW_LINE>throw InvalidBufferOffsetException.create(index, Byte.BYTES);<NEW_LINE>}<NEW_LINE>}
ByteBuffer) classProfile.profile(obj);
129,238
public void updateViews(AlLinkPreviewModel linkPreviewModel) {<NEW_LINE>if (linkPreviewModel != null && linkPreviewModel.hasLinkData()) {<NEW_LINE>urlLoadLayout.setVisibility(View.VISIBLE);<NEW_LINE>if (linkPreviewModel.hasImageOnly()) {<NEW_LINE>toggleImageOnlyVisibility(true);<NEW_LINE>Glide.with(context).load(linkPreviewModel.getImageLink()).into(imageOnlyView);<NEW_LINE>} else {<NEW_LINE>toggleImageOnlyVisibility(false);<NEW_LINE>titleText.setText(linkPreviewModel.getTitle());<NEW_LINE>descriptionText.setText(linkPreviewModel.getDescription());<NEW_LINE>if (!TextUtils.isEmpty(linkPreviewModel.getImageLink())) {<NEW_LINE>imageView.setVisibility(View.VISIBLE);<NEW_LINE>Glide.with(context).load(linkPreviewModel.getImageLink()).into(imageView);<NEW_LINE>} else {<NEW_LINE>imageView.setVisibility(View.GONE);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>urlLoadLayout.setVisibility(View.GONE);<NEW_LINE>}<NEW_LINE>urlLoadLayout.setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>Toast.makeText(context, context.getString(R.string.opening_link), Toast.LENGTH_SHORT).show();<NEW_LINE>AlTask.execute(<MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
new OpenLinkTask(context, message));
832,937
public Float validateAndGetRate(int dayCount, Currency currencyFrom, Currency currencyTo, LocalDate date) throws AxelorException {<NEW_LINE>try {<NEW_LINE>HTTPResponse response = null;<NEW_LINE>if (dayCount < 8) {<NEW_LINE>HTTPClient httpclient = new HTTPClient();<NEW_LINE>HTTPRequest request = new HTTPRequest();<NEW_LINE>Map<String, Object> headers = new HashMap<>();<NEW_LINE>headers.put("Accept", "application/json");<NEW_LINE>request.setHeaders(headers);<NEW_LINE>URL url = new URL(this.getUrlString(date, currencyFrom.getCode(), currencyTo.getCode()));<NEW_LINE>// URL url = new URL(String.format(WSURL,currencyFrom.getCode()));<NEW_LINE>LOG.trace("Currency conversion webservice URL: {}", new Object[] { url.toString() });<NEW_LINE>request.setUrl(url);<NEW_LINE>request.setMethod(HTTPMethod.GET);<NEW_LINE>response = httpclient.execute(request);<NEW_LINE>// JSONObject json = new JSONObject(response.getContentAsString());<NEW_LINE>LOG.trace("Webservice response code: {}, response message: {}", response.getStatusCode(), response.getStatusMessage());<NEW_LINE>if (response.getStatusCode() != 200)<NEW_LINE>return -1f;<NEW_LINE>if (response.getContentAsString().isEmpty()) {<NEW_LINE>return this.validateAndGetRate((dayCount + 1), currencyFrom, currencyTo, date.minus(Period.ofDays(1)));<NEW_LINE>} else {<NEW_LINE>return this.<MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new AxelorException(TraceBackRepository.CATEGORY_CONFIGURATION_ERROR, String.format(I18n.get(IExceptionMessage.CURRENCY_7), date.plus(Period.ofDays(1)), appBaseService.getTodayDate(Optional.ofNullable(AuthUtils.getUser()).map(User::getActiveCompany).orElse(null))));<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new AxelorException(TraceBackRepository.CATEGORY_CONFIGURATION_ERROR, I18n.get(IExceptionMessage.CURRENCY_6));<NEW_LINE>}<NEW_LINE>}
getRateFromJson(currencyFrom, currencyTo, response);
699,109
// end static class ExactBlock<NEW_LINE>public static void main(String[] args) {<NEW_LINE>TransducerGraph fa = new TransducerGraph();<NEW_LINE>fa.addArc(fa.getStartNode(), "1", "a", "");<NEW_LINE>fa.addArc(fa.getStartNode(), "2", "b", "");<NEW_LINE>fa.addArc(fa.getStartNode(), "3", "c", "");<NEW_LINE>fa.addArc("1", "4", "a", "");<NEW_LINE>fa.addArc("2", "4", "a", "");<NEW_LINE>fa.addArc("3", "5", "c", "");<NEW_LINE>fa.addArc("4", "6", "c", "");<NEW_LINE>fa.addArc("5", "6", "c", "");<NEW_LINE>fa.setEndNode("6");<NEW_LINE>System.out.println(fa);<NEW_LINE>ExactAutomatonMinimizer minimizer = new ExactAutomatonMinimizer();<NEW_LINE>System.out.println(minimizer.minimizeFA(fa));<NEW_LINE>System.out.println("Starting...");<NEW_LINE>Timing.startTime();<NEW_LINE>TransducerGraph randomFA = TransducerGraph.createRandomGraph(100, 10, 1.0, 10, new ArrayList<>());<NEW_LINE>TransducerGraph minimizedRandomFA = minimizer.minimizeFA(randomFA);<NEW_LINE><MASK><NEW_LINE>System.out.println(minimizedRandomFA);<NEW_LINE>Timing.tick("done. ( " + randomFA.getArcs().size() + " arcs to " + minimizedRandomFA.getArcs().size() + " arcs)");<NEW_LINE>}
System.out.println(randomFA);
1,774,780
public SingularGuavaTable2<A, B, C> build() {<NEW_LINE>com.google.common.collect.ImmutableTable<java.lang.Object, java.lang.Object, java.lang.Object> rawTypes = this.rawTypes == null ? com.google.common.collect.ImmutableTable.<java.lang.Object, java.lang.Object, java.lang.Object>of() : this.rawTypes.build();<NEW_LINE>com.google.common.collect.ImmutableTable<Integer, Float, String> integers = this.integers == null ? com.google.common.collect.ImmutableTable.<Integer, Float, String>of() : this.integers.build();<NEW_LINE>com.google.common.collect.ImmutableTable<A, B, C> generics = this.generics == null ? com.google.common.collect.ImmutableTable.<A, B, C>of() : this.generics.build();<NEW_LINE>com.google.common.collect.ImmutableTable<Number, Float, String> extendsGenerics = this.extendsGenerics == null ? com.google.common.collect.ImmutableTable.<Number, Float, String>of() : this.extendsGenerics.build();<NEW_LINE>return new SingularGuavaTable2<A, B, C>(<MASK><NEW_LINE>}
rawTypes, integers, generics, extendsGenerics);
1,779,042
private void onMenuItemClicked(NavMenu.Item item) {<NEW_LINE>final MwmActivity parent = ((MwmActivity) mFrame.getContext());<NEW_LINE>switch(item) {<NEW_LINE>case STOP:<NEW_LINE>mNavMenu.close(false);<NEW_LINE>Statistics.INSTANCE.trackRoutingFinish(true, RoutingController.get().getLastRouterType(), TrafficManager.INSTANCE.isEnabled());<NEW_LINE>RoutingController.get().cancel();<NEW_LINE>stop(parent);<NEW_LINE>break;<NEW_LINE>case SETTINGS:<NEW_LINE>Statistics.INSTANCE.trackEvent(Statistics.EventName.ROUTING_SETTINGS);<NEW_LINE>parent.closeMenu(() -> parent.startActivity(new Intent(<MASK><NEW_LINE>break;<NEW_LINE>case TTS_VOLUME:<NEW_LINE>TtsPlayer.setEnabled(!TtsPlayer.isEnabled());<NEW_LINE>mNavMenu.refreshTts();<NEW_LINE>break;<NEW_LINE>case TRAFFIC:<NEW_LINE>TrafficManager.INSTANCE.toggle();<NEW_LINE>parent.onTrafficLayerSelected();<NEW_LINE>mNavMenu.refreshTraffic();<NEW_LINE>// TODO: Add statistics reporting (in separate task)<NEW_LINE>break;<NEW_LINE>case TOGGLE:<NEW_LINE>mNavMenu.toggle(true);<NEW_LINE>parent.refreshFade();<NEW_LINE>}<NEW_LINE>}
parent, SettingsActivity.class)));
1,384,701
public GuestbookResponse initGuestbookResponseForFragment(DatasetVersion workingVersion, FileMetadata fileMetadata, DataverseSession session) {<NEW_LINE>Dataset dataset = workingVersion.getDataset();<NEW_LINE>GuestbookResponse guestbookResponse = new GuestbookResponse();<NEW_LINE>if (workingVersion.isDraft()) {<NEW_LINE>guestbookResponse.setWriteResponse(false);<NEW_LINE>}<NEW_LINE>// guestbookResponse.setDatasetVersion(workingVersion);<NEW_LINE>if (fileMetadata != null) {<NEW_LINE>guestbookResponse.setDataFile(fileMetadata.getDataFile());<NEW_LINE>}<NEW_LINE>if (dataset.getGuestbook() != null) {<NEW_LINE>guestbookResponse.setGuestbook(dataset.getGuestbook());<NEW_LINE>setUserDefaultResponses(guestbookResponse, session);<NEW_LINE>if (fileMetadata != null) {<NEW_LINE>guestbookResponse.<MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (fileMetadata != null) {<NEW_LINE>guestbookResponse = initDefaultGuestbookResponse(dataset, fileMetadata.getDataFile(), session);<NEW_LINE>} else {<NEW_LINE>guestbookResponse = initDefaultGuestbookResponse(dataset, null, session);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (dataset.getGuestbook() != null && !dataset.getGuestbook().getCustomQuestions().isEmpty()) {<NEW_LINE>initCustomQuestions(guestbookResponse, dataset);<NEW_LINE>}<NEW_LINE>guestbookResponse.setDownloadtype("Download");<NEW_LINE>guestbookResponse.setDataset(dataset);<NEW_LINE>return guestbookResponse;<NEW_LINE>}
setDataFile(fileMetadata.getDataFile());
1,795,761
private AlertDialog createResetCacheCoordinatesDialog(final Waypoint wpt) {<NEW_LINE>final AlertDialog.Builder builder = Dialogs.newBuilder(this);<NEW_LINE>builder.<MASK><NEW_LINE>final String[] items = { res.getString(R.string.waypoint_localy_reset_cache_coords), res.getString(R.string.waypoint_reset_local_and_remote_cache_coords) };<NEW_LINE>builder.setSingleChoiceItems(items, 0, (dialog, which) -> {<NEW_LINE>dialog.dismiss();<NEW_LINE>final ProgressDialog progressDialog = ProgressDialog.show(CacheDetailActivity.this, getString(R.string.cache), getString(R.string.waypoint_reset), true);<NEW_LINE>final HandlerResetCoordinates handler = new HandlerResetCoordinates(CacheDetailActivity.this, progressDialog, which == 1);<NEW_LINE>resetCoords(cache, handler, wpt, which == 0 || which == 1, which == 1, progressDialog);<NEW_LINE>});<NEW_LINE>return builder.create();<NEW_LINE>}
setTitle(R.string.waypoint_reset_cache_coords);
1,297,949
protected void applyEnterFiltered(CodegenMethod method, ExprForgeCodegenSymbol symbols, CodegenClassScope classScope, CodegenNamedMethods namedMethods) {<NEW_LINE>CodegenExpressionRef eps = symbols.getAddEPS(method);<NEW_LINE>CodegenExpressionRef <MASK><NEW_LINE>CodegenMethod referenceAddToColl = referenceAddToCollCodegen(method, namedMethods, classScope);<NEW_LINE>method.getBlock().declareVar(EventBean.EPTYPE, "theEvent", arrayAtIndex(eps, constant(forge.getSpec().getStreamNum()))).ifRefNull("theEvent").blockReturnNoValue();<NEW_LINE>if (joinRefs == null) {<NEW_LINE>method.getBlock().localMethod(referenceAddToColl, ref("theEvent"), eps, ctx);<NEW_LINE>} else {<NEW_LINE>method.getBlock().ifCondition(exprDotMethod(joinRefs, "add", ref("theEvent"))).localMethod(referenceAddToColl, ref("theEvent"), eps, ctx);<NEW_LINE>}<NEW_LINE>}
ctx = symbols.getAddExprEvalCtx(method);
1,823,479
/*<NEW_LINE>static Map<String, ReplicationStatus> checkIfPasswordIsReplicated(final ChaiUser user, final PwmSession pwmSession)<NEW_LINE>throws ChaiUnavailableException<NEW_LINE>{<NEW_LINE>final Map<String, ReplicationStatus> repStatusMap = new HashMap<String, ReplicationStatus>();<NEW_LINE><NEW_LINE>{<NEW_LINE>final ReplicationStatus repStatus = checkDirectoryReplicationStatus(user, pwmSession);<NEW_LINE>repStatusMap.put("ReplicationSync", repStatus);<NEW_LINE>}<NEW_LINE><NEW_LINE>if (ChaiProvider.DIRECTORY_VENDOR.NOVELL_EDIRECTORY == user.getChaiProvider().getDirectoryVendor()) {<NEW_LINE><NEW_LINE>}<NEW_LINE><NEW_LINE>return repStatusMap;<NEW_LINE>}<NEW_LINE><NEW_LINE>public static Map<String, ReplicationStatus> checkNovellIDMReplicationStatus(final ChaiUser chaiUser)<NEW_LINE>throws ChaiUnavailableException, ChaiOperationException<NEW_LINE>{<NEW_LINE>final Map<String,ReplicationStatus> repStatuses = new HashMap<String,ReplicationStatus>();<NEW_LINE><NEW_LINE>final Set<String> values = chaiUser.readMultiStringAttribute("DirXML-PasswordSyncStatus");<NEW_LINE>if (values != null) {<NEW_LINE>for (final String value : values) {<NEW_LINE>if (value != null && value.length() >= 62 ) {<NEW_LINE>final String guid = value.substring(0,32);<NEW_LINE>final String timestamp = value.substring(32,46);<NEW_LINE>final String status = value.substring(46,62);<NEW_LINE>final String descr = value.substring(61, value.length());<NEW_LINE><NEW_LINE>final Date dateValue = EdirEntries.convertZuluToDate(timestamp + "Z");<NEW_LINE><NEW_LINE>System.out.println("guid=" + guid + ", timestamp=" + dateValue.toString() + ", status=" + status + ", descr=" + descr);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>return repStatuses;<NEW_LINE>}<NEW_LINE><NEW_LINE>private static ReplicationStatus checkDirectoryReplicationStatus(final ChaiUser user, final PwmSession pwmSession)<NEW_LINE>throws ChaiUnavailableException<NEW_LINE>{<NEW_LINE>boolean isReplicated = false;<NEW_LINE>try {<NEW_LINE>isReplicated = ChaiUtility.testAttributeReplication(user, pwmSession.getConfig().readSettingAsString(PwmSetting.PASSWORD_LAST_UPDATE_ATTRIBUTE), null);<NEW_LINE>Helper.pause(PwmConstants.PASSWORD_UPDATE_CYCLE_DELAY_MS);<NEW_LINE>} catch (ChaiOperationException e) {<NEW_LINE>//oh well, give up.<NEW_LINE>LOGGER.trace(pwmSession, "error during password sync check: " + e.getMessage());<NEW_LINE>}<NEW_LINE>return isReplicated ? ReplicationStatus.COMPLETE : ReplicationStatus.IN_PROGRESS;<NEW_LINE>}<NEW_LINE><NEW_LINE>enum ReplicationStatus {<NEW_LINE>IN_PROGRESS,<NEW_LINE>COMPLETE<NEW_LINE>}<NEW_LINE><NEW_LINE>*/<NEW_LINE>public static int judgePasswordStrength(final DomainConfig domainConfig, final String password) throws PwmUnrecoverableException {<NEW_LINE>final StrengthMeterType strengthMeterType = domainConfig.getAppConfig().readSettingAsEnum(<MASK><NEW_LINE>switch(strengthMeterType) {<NEW_LINE>case ZXCVBN:<NEW_LINE>return judgePasswordStrengthUsingZxcvbnAlgorithm(domainConfig, password);<NEW_LINE>case PWM:<NEW_LINE>return judgePasswordStrengthUsingTraditionalAlgorithm(password);<NEW_LINE>default:<NEW_LINE>MiscUtil.unhandledSwitchStatement(strengthMeterType);<NEW_LINE>}<NEW_LINE>return -1;<NEW_LINE>}
PwmSetting.PASSWORD_STRENGTH_METER_TYPE, StrengthMeterType.class);
458,570
protected static boolean nGetFullPathProperties(long pathPtr, byte[] properties, int length) {<NEW_LINE>if (length != TOTAL_PROPERTY_COUNT * 4)<NEW_LINE>return false;<NEW_LINE>Path path = getPath(pathPtr);<NEW_LINE>ByteBuffer propertiesBB = ByteBuffer.wrap(properties);<NEW_LINE>propertiesBB.order(ByteOrder.nativeOrder());<NEW_LINE>propertiesBB.putFloat(STROKE_WIDTH_INDEX * 4, path.strokeWidth);<NEW_LINE>propertiesBB.putInt(STROKE_COLOR_INDEX * 4, path.strokeColor);<NEW_LINE>propertiesBB.putFloat(STROKE_ALPHA_INDEX * 4, path.strokeAlpha);<NEW_LINE>propertiesBB.putInt(FILL_COLOR_INDEX * 4, path.fillColor);<NEW_LINE>propertiesBB.putFloat(FILL_ALPHA_INDEX * 4, path.fillAlpha);<NEW_LINE>propertiesBB.putFloat(TRIM_PATH_START_INDEX * 4, path.trimPathStart);<NEW_LINE>propertiesBB.putFloat(TRIM_PATH_END_INDEX * 4, path.trimPathEnd);<NEW_LINE>propertiesBB.putFloat(TRIM_PATH_OFFSET_INDEX * 4, path.trimPathOffset);<NEW_LINE>propertiesBB.putInt(<MASK><NEW_LINE>propertiesBB.putInt(STROKE_LINE_JOIN_INDEX * 4, path.strokeLineJoin);<NEW_LINE>propertiesBB.putFloat(STROKE_MITER_LIMIT_INDEX * 4, path.strokeMiterLimit);<NEW_LINE>propertiesBB.putInt(FILL_TYPE_INDEX * 4, path.fillType);<NEW_LINE>return true;<NEW_LINE>}
STROKE_LINE_CAP_INDEX * 4, path.strokeLineCap);
1,138,061
public Object calculate(Context ctx) {<NEW_LINE>if (param == null || param.isLeaf() || param.getSubSize() < 5) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("Fyield:" + mm.getMessage("function.missingParam"));<NEW_LINE>}<NEW_LINE>int size = param.getSubSize();<NEW_LINE>Object[<MASK><NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>IParam sub = param.getSub(i);<NEW_LINE>if (sub != null) {<NEW_LINE>result[i] = sub.getLeafExpression().calculate(ctx);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (option == null || (option.indexOf('d') == -1 && option.indexOf('m') == -1)) {<NEW_LINE>return yield(result);<NEW_LINE>} else if (option.indexOf('d') >= 0) {<NEW_LINE>return yielddisc(result);<NEW_LINE>} else {<NEW_LINE>return yieldMAT(result);<NEW_LINE>}<NEW_LINE>}
] result = new Object[size];
693,969
public void bindViewHolder(FlexibleAdapter adapter, ViewHolder holder, int position, List<Object> payloads) {<NEW_LINE>Context context = holder.itemView.getContext();<NEW_LINE>holder.accountColorIndicator.setBackgroundColor(ColorManager.getInstance().getAccountPainter().getDefaultMainColor());<NEW_LINE>holder.accountColorIndicatorBack.setBackgroundColor(ColorManager.getInstance().getAccountPainter().getDefaultIndicatorBackColor());<NEW_LINE>final int[] accountGroupColors = context.getResources().getIntArray(getThemeResource(context, R.attr.contact_list_account_group_background));<NEW_LINE>final int level = AccountManager.getInstance().getColorLevel(AccountPainter.getFirstAccount());<NEW_LINE>holder.itemView.setBackgroundColor(accountGroupColors[level]);<NEW_LINE>switch(currentChatsState) {<NEW_LINE>case unread:<NEW_LINE>holder.tvTitle.setText(R.string.unread_chats);<NEW_LINE>break;<NEW_LINE>case archived:<NEW_LINE>holder.tvTitle.<MASK><NEW_LINE>break;<NEW_LINE>case all:<NEW_LINE>holder.tvTitle.setText(R.string.all_chats);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>holder.tvTitle.setText("Xabber");<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}
setText(R.string.archived_chats);
49,544
public static byte[] serialize(ConstraintDescriptor constraint, MemoryTracker memoryTracker) {<NEW_LINE>try (var scopedBuffer = new HeapScopedBuffer(lengthOf(constraint), memoryTracker)) {<NEW_LINE>ByteBuffer target = scopedBuffer.getBuffer();<NEW_LINE>target.putInt(LEGACY_LABEL_OR_REL_TYPE_ID);<NEW_LINE>target.put(CONSTRAINT_RULE);<NEW_LINE>switch(constraint.type()) {<NEW_LINE>case EXISTS:<NEW_LINE>target.put(EXISTS_CONSTRAINT);<NEW_LINE>break;<NEW_LINE>case UNIQUE:<NEW_LINE>target.put(UNIQUE_CONSTRAINT);<NEW_LINE>target.putLong(constraint.<MASK><NEW_LINE>break;<NEW_LINE>case UNIQUE_EXISTS:<NEW_LINE>target.put(UNIQUE_EXISTS_CONSTRAINT);<NEW_LINE>target.putLong(constraint.asIndexBackedConstraint().ownedIndexId());<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new UnsupportedOperationException(format("Got unknown index descriptor type '%s'.", constraint.type()));<NEW_LINE>}<NEW_LINE>constraint.schema().processWith(new SchemaDescriptorSerializer(target));<NEW_LINE>UTF8.putEncodedStringInto(constraint.getName(), target);<NEW_LINE>return target.array();<NEW_LINE>}<NEW_LINE>}
asIndexBackedConstraint().ownedIndexId());
1,572,991
private void fixSpinner(Context context, int hourOfDay, int minute, boolean is24HourView, RNTimePickerDisplay display) {<NEW_LINE>if (Build.VERSION.SDK_INT == Build.VERSION_CODES.N && display == RNTimePickerDisplay.SPINNER) {<NEW_LINE>try {<NEW_LINE>Class<?> styleableClass = Class.forName("com.android.internal.R$styleable");<NEW_LINE>Field timePickerStyleableField = styleableClass.getField("TimePicker");<NEW_LINE>int[] timePickerStyleable = (int[]) timePickerStyleableField.get(null);<NEW_LINE>final TypedArray a = context.obtainStyledAttributes(null, timePickerStyleable, android.R.attr.timePickerStyle, 0);<NEW_LINE>a.recycle();<NEW_LINE>TimePicker timePicker = (TimePicker) findField(TimePickerDialog.class, TimePicker.class, "mTimePicker").get(this);<NEW_LINE>Class<?> delegateClass = Class.forName("android.widget.TimePicker$TimePickerDelegate");<NEW_LINE>Field delegateField = findField(TimePicker.class, delegateClass, "mDelegate");<NEW_LINE>Object delegate = delegateField.get(timePicker);<NEW_LINE>Class<?> spinnerDelegateClass;<NEW_LINE>spinnerDelegateClass = Class.forName("android.widget.TimePickerSpinnerDelegate");<NEW_LINE>// In 7.0 Nougat for some reason the timePickerMode is ignored and the delegate is TimePickerClockDelegate<NEW_LINE>if (delegate.getClass() != spinnerDelegateClass) {<NEW_LINE>// throw out the TimePickerClockDelegate!<NEW_LINE>delegateField.set(timePicker, null);<NEW_LINE>// remove the TimePickerClockDelegate views<NEW_LINE>timePicker.removeAllViews();<NEW_LINE>Constructor spinnerDelegateConstructor = spinnerDelegateClass.getConstructor(TimePicker.class, Context.class, AttributeSet.class, <MASK><NEW_LINE>spinnerDelegateConstructor.setAccessible(true);<NEW_LINE>// Instantiate a TimePickerSpinnerDelegate<NEW_LINE>delegate = spinnerDelegateConstructor.newInstance(timePicker, context, null, android.R.attr.timePickerStyle, 0);<NEW_LINE>// set the TimePicker.mDelegate to the spinner delegate<NEW_LINE>delegateField.set(timePicker, delegate);<NEW_LINE>// Set up the TimePicker again, with the TimePickerSpinnerDelegate<NEW_LINE>timePicker.setIs24HourView(is24HourView);<NEW_LINE>timePicker.setCurrentHour(hourOfDay);<NEW_LINE>timePicker.setCurrentMinute(minute);<NEW_LINE>timePicker.setOnTimeChangedListener(this);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
int.class, int.class);
961,607
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {<NEW_LINE>config.put("noCode", "true");<NEW_LINE>WebApplicationContext ctx = WebApplicationContextUtils.getRequiredWebApplicationContext(req.getServletContext());<NEW_LINE>config.put("supportsImpactAnalysis", checkImpactAnalysisSupport(ctx));<NEW_LINE>GitVersion version = getGitVersion(ctx);<NEW_LINE>Map<String, Object> versionConfig = new HashMap<>();<NEW_LINE>versionConfig.put("linkedin/datahub", version.toConfig());<NEW_LINE>config.put("versions", versionConfig);<NEW_LINE>ConfigurationProvider configProvider = getConfigProvider(ctx);<NEW_LINE>Map<String, Object> telemetryConfig = new HashMap<String, Object>() {<NEW_LINE><NEW_LINE>{<NEW_LINE>put("enabledCli", configProvider.getTelemetry().enabledCli);<NEW_LINE>put("enabledIngestion", configProvider.getTelemetry().enabledIngestion);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>config.put("telemetry", telemetryConfig);<NEW_LINE>Map<String, Object> ingestionConfig = new HashMap<String, Object>() {<NEW_LINE><NEW_LINE>{<NEW_LINE>put("enabled", configProvider.getIngestion().enabled);<NEW_LINE>put("defaultCliVersion", configProvider.getIngestion().defaultCliVersion);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>config.put("managedIngestion", ingestionConfig);<NEW_LINE>resp.setContentType("application/json");<NEW_LINE>PrintWriter out = resp.getWriter();<NEW_LINE>try {<NEW_LINE>Map<String, Object> config = new HashMap<>(this.config);<NEW_LINE>Map<String, Map<ComparableVersion, EntityRegistryLoadResult>> pluginTree = getPluginModels(req.getServletContext());<NEW_LINE><MASK><NEW_LINE>String json = objectMapper.writerWithDefaultPrettyPrinter().writeValueAsString(config);<NEW_LINE>out.println(json);<NEW_LINE>out.flush();<NEW_LINE>resp.setStatus(200);<NEW_LINE>} catch (JsonProcessingException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>resp.setStatus(500);<NEW_LINE>}<NEW_LINE>}
config.put("models", pluginTree);
629,326
public StopRelationalDatabaseResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>StopRelationalDatabaseResult stopRelationalDatabaseResult = new StopRelationalDatabaseResult();<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 stopRelationalDatabaseResult;<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("operations", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>stopRelationalDatabaseResult.setOperations(new ListUnmarshaller<Operation>(OperationJsonUnmarshaller.getInstance(<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 stopRelationalDatabaseResult;<NEW_LINE>}
)).unmarshall(context));
1,567,852
boolean tryUploadHeapDumpIfItExists() {<NEW_LINE>if (uploadFilePath == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>boolean uploadedHeapDump = false;<NEW_LINE>File localSource = getDefaultHeapDumpPath();<NEW_LINE>LOG.info("Looking for heap dump at {}", localSource);<NEW_LINE>if (localSource.exists()) {<NEW_LINE><MASK><NEW_LINE>String remoteDest = String.format("%s/heap_dump%s.hprof", uploadFilePath, UUID.randomUUID().toString());<NEW_LINE>ResourceId resource = FileSystems.matchNewResource(remoteDest, false);<NEW_LINE>try {<NEW_LINE>uploadFile(localSource, resource);<NEW_LINE>uploadedHeapDump = true;<NEW_LINE>LOG.warn("Heap dump {} uploaded to {}", localSource, remoteDest);<NEW_LINE>} catch (IOException e) {<NEW_LINE>LOG.error("Error uploading heap dump to {}", remoteDest, e);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Files.delete(localSource.toPath());<NEW_LINE>LOG.info("Deleted local heap dump {}", localSource);<NEW_LINE>} catch (IOException e) {<NEW_LINE>LOG.warn("Unable to delete local heap dump {}", localSource, e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return uploadedHeapDump;<NEW_LINE>}
LOG.warn("Heap dump {} detected, attempting to upload file to ", localSource);
914,346
private void doExperiment() {<NEW_LINE>LookupCSV lookupCSV = new LookupCSV();<NEW_LINE>int[] numberOfQueries = { 100000, 1000000, 10000000, 100000000, 1000000000 };<NEW_LINE>String[] filePaths = { LARGE_INPUT_FILE_PATH1, LARGE_INPUT_FILE_PATH2 };<NEW_LINE>String[] fileNames = { Constants.SURNAMES_CSV_FILE, Constants.SDSS_CSV_FILE };<NEW_LINE>String[] dataStructures = { "Trie", "Ternary Search Trie" };<NEW_LINE>StdOut.printf("%21s %19s %20s %10s\n", "Data structure |", "Large input | ", "Number of queries | ", "Time spent");<NEW_LINE>for (int trieType = 0; trieType < 2; trieType++) {<NEW_LINE>for (int q = 0; q < numberOfQueries.length; q++) {<NEW_LINE>for (int f = 0; f < filePaths.length; f++) {<NEW_LINE>In in = new In(filePaths[f]);<NEW_LINE>String line = in.readLine();<NEW_LINE>String[] tokens = line.split(",");<NEW_LINE>int randomKeyIndex = StdRandom.uniform(tokens.length);<NEW_LINE>int randomValueIndex = StdRandom.uniform(tokens.length);<NEW_LINE>TrieInterface<String> trie;<NEW_LINE>if (trieType == 0) {<NEW_LINE>trie = new Trie<>();<NEW_LINE>} else {<NEW_LINE>trie = new TernarySearchTrie<>();<NEW_LINE>}<NEW_LINE>Stopwatch stopwatch = new Stopwatch();<NEW_LINE>lookupCSV.lookup(trie, filePaths[f], randomKeyIndex, randomValueIndex, numberOfQueries[q]);<NEW_LINE>double timeSpent = stopwatch.elapsedTime();<NEW_LINE>printResults(dataStructures[trieType], fileNames[f]<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
, numberOfQueries[q], timeSpent);
1,788,172
private void handleClientCoreMessage_TemplateChange(Message msg) {<NEW_LINE>SonicUtils.log(TAG, Log.INFO, "handleClientCoreMessage_TemplateChange wasLoadDataInvoked = " + wasLoadDataInvoked.get() + ",msg arg1 = " + msg.arg1);<NEW_LINE>if (wasLoadDataInvoked.get()) {<NEW_LINE>if (TEMPLATE_CHANGE_REFRESH == msg.arg1) {<NEW_LINE>String html = (String) msg.obj;<NEW_LINE>if (TextUtils.isEmpty(html)) {<NEW_LINE>SonicUtils.log(TAG, Log.INFO, "handleClientCoreMessage_TemplateChange:load url with preload=2, webCallback is null? ->" + (null != diffDataCallback));<NEW_LINE>sessionClient.loadUrl(srcUrl, null);<NEW_LINE>} else {<NEW_LINE>SonicUtils.log(TAG, Log.INFO, "handleClientCoreMessage_TemplateChange:load data.");<NEW_LINE>sessionClient.loadDataWithBaseUrlAndHeader(srcUrl, html, "text/html", getCharsetFromHeaders(), srcUrl, getHeaders());<NEW_LINE>}<NEW_LINE>setResult(SONIC_RESULT_CODE_TEMPLATE_CHANGE, SONIC_RESULT_CODE_TEMPLATE_CHANGE, false);<NEW_LINE>} else {<NEW_LINE>SonicUtils.log(TAG, Log.INFO, "handleClientCoreMessage_TemplateChange:not refresh.");<NEW_LINE>setResult(SONIC_RESULT_CODE_TEMPLATE_CHANGE, SONIC_RESULT_CODE_HIT_CACHE, true);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>SonicUtils.log(TAG, Log.INFO, "handleClientCoreMessage_TemplateChange:oh yeah template change hit 304.");<NEW_LINE>if (msg.obj instanceof String) {<NEW_LINE>String html = (String) msg.obj;<NEW_LINE>sessionClient.loadDataWithBaseUrlAndHeader(srcUrl, html, "text/html", getCharsetFromHeaders(), srcUrl, getHeaders());<NEW_LINE>setResult(SONIC_RESULT_CODE_TEMPLATE_CHANGE, SONIC_RESULT_CODE_HIT_CACHE, false);<NEW_LINE>} else {<NEW_LINE>SonicUtils.log(TAG, Log.ERROR, "handleClientCoreMessage_TemplateChange error:call load url.");<NEW_LINE><MASK><NEW_LINE>setResult(SONIC_RESULT_CODE_TEMPLATE_CHANGE, SONIC_RESULT_CODE_FIRST_LOAD, false);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>diffDataCallback = null;<NEW_LINE>mainHandler.removeMessages(CLIENT_MSG_ON_WEB_READY);<NEW_LINE>}
sessionClient.loadUrl(srcUrl, null);
1,276,877
public void run(RegressionEnvironment env) {<NEW_LINE>sendTimer(env, 0);<NEW_LINE>String epl = "@name('s0') select irstream max(price) as maxVol" + " from SupportMarketDataBean#time(1.1 sec) " + "output every 1 seconds";<NEW_LINE>env.compileDeploy(epl).addListener("s0");<NEW_LINE>sendEvent(env, "SYM1", 1d);<NEW_LINE>sendEvent(env, "SYM1", 2d);<NEW_LINE>env.listenerReset("s0");<NEW_LINE>// moves all events out of the window,<NEW_LINE>// newdata is 2 eventa, old data is the same 2 events, therefore the sum is null<NEW_LINE>sendTimer(env, 1000);<NEW_LINE>env.assertListener("s0", listener -> {<NEW_LINE>UniformPair<EventBean[]> result = listener.getDataListsFlattened();<NEW_LINE>assertEquals(2, result.getFirst().length);<NEW_LINE>assertEquals(1.0, result.getFirst()[<MASK><NEW_LINE>assertEquals(2.0, result.getFirst()[1].get("maxVol"));<NEW_LINE>assertEquals(2, result.getSecond().length);<NEW_LINE>assertEquals(null, result.getSecond()[0].get("maxVol"));<NEW_LINE>assertEquals(1.0, result.getSecond()[1].get("maxVol"));<NEW_LINE>});<NEW_LINE>env.undeployAll();<NEW_LINE>}
0].get("maxVol"));
323,952
final DisassociateNodeResult executeDisassociateNode(DisassociateNodeRequest disassociateNodeRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(disassociateNodeRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DisassociateNodeRequest> request = null;<NEW_LINE>Response<DisassociateNodeResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DisassociateNodeRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(disassociateNodeRequest));<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(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "OpsWorksCM");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DisassociateNode");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DisassociateNodeResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DisassociateNodeResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
1,493,480
private void populateExtensions() {<NEW_LINE>for (HypervisorFactory f : pluginRgty.getExtensionList(HypervisorFactory.class)) {<NEW_LINE>HypervisorFactory old = hypervisorFactories.get(f.getHypervisorType().toString());<NEW_LINE>if (old != null) {<NEW_LINE>throw new CloudRuntimeException(String.format("duplicate HypervisorFactory[%s, %s] for hypervisor type[%s]", old.getClass().getName(), f.getClass().getName(), f.getHypervisorType()));<NEW_LINE>}<NEW_LINE>hypervisorFactories.put(f.getHypervisorType(<MASK><NEW_LINE>}<NEW_LINE>for (HostBaseExtensionFactory ext : pluginRgty.getExtensionList(HostBaseExtensionFactory.class)) {<NEW_LINE>for (Class clz : ext.getMessageClasses()) {<NEW_LINE>HostBaseExtensionFactory old = hostBaseExtensionFactories.get(clz);<NEW_LINE>if (old != null) {<NEW_LINE>throw new CloudRuntimeException(String.format("duplicate HostBaseExtensionFactory[%s, %s] for the" + " message[%s]", old.getClass(), ext.getClass(), clz));<NEW_LINE>}<NEW_LINE>hostBaseExtensionFactories.put(clz, ext);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>hostExtensionManagers.addAll(pluginRgty.getExtensionList(HostExtensionManager.class));<NEW_LINE>hostPriorityCaculators.addAll(pluginRgty.getExtensionList(HostPriorityCaculator.class));<NEW_LINE>}
).toString(), f);
230,795
public NumericDoubleValues select(final SortedNumericDoubleValues values, final double missingValue, final BitSet parentDocs, final DocIdSetIterator childDocs, int maxDoc, int maxChildren) throws IOException {<NEW_LINE>if (parentDocs == null || childDocs == null) {<NEW_LINE>return FieldData.replaceMissing(FieldData.emptyNumericDouble(), missingValue);<NEW_LINE>}<NEW_LINE>return new NumericDoubleValues() {<NEW_LINE><NEW_LINE>int lastSeenParentDoc = 0;<NEW_LINE><NEW_LINE>double lastEmittedValue = missingValue;<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean advanceExact(int parentDoc) throws IOException {<NEW_LINE>assert parentDoc >= lastSeenParentDoc : "can only evaluate current and upcoming parent docs";<NEW_LINE>if (parentDoc == lastSeenParentDoc) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>final int prevParentDoc = parentDocs.prevSetBit(parentDoc - 1);<NEW_LINE>final int firstChildDoc;<NEW_LINE>if (childDocs.docID() > prevParentDoc) {<NEW_LINE>firstChildDoc = childDocs.docID();<NEW_LINE>} else {<NEW_LINE>firstChildDoc = childDocs.advance(prevParentDoc + 1);<NEW_LINE>}<NEW_LINE>lastSeenParentDoc = parentDoc;<NEW_LINE>lastEmittedValue = pick(values, missingValue, <MASK><NEW_LINE>return true;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public double doubleValue() throws IOException {<NEW_LINE>return lastEmittedValue;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
childDocs, firstChildDoc, parentDoc, maxChildren);
1,848,848
public static void main(String[] args) throws IOException {<NEW_LINE>DataplexJdbcIngestionOptions options = PipelineOptionsFactory.fromArgs(args).withValidation().as(DataplexJdbcIngestionOptions.class);<NEW_LINE>Pipeline pipeline = Pipeline.create(options);<NEW_LINE>DataplexClient dataplexClient = DefaultDataplexClient.withDefaultClient(options.getGcpCredential());<NEW_LINE>String assetName = options.getOutputAsset();<NEW_LINE>GoogleCloudDataplexV1Asset asset = resolveAsset(assetName, dataplexClient);<NEW_LINE>DynamicDataSourceConfiguration dataSourceConfig = configDataSource(options);<NEW_LINE>String assetType = asset.getResourceSpec().getType();<NEW_LINE>if (DataplexAssetResourceSpec.BIGQUERY_DATASET.name().equals(assetType)) {<NEW_LINE>buildBigQueryPipeline(pipeline, options, dataSourceConfig);<NEW_LINE>} else if (DataplexAssetResourceSpec.STORAGE_BUCKET.name().equals(assetType)) {<NEW_LINE>String targetRootPath = "gs://" + asset.getResourceSpec().getName() + "/" + options.getOutputTable();<NEW_LINE>buildGcsPipeline(pipeline, options, dataSourceConfig, targetRootPath);<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException(String.format("Asset " + assetName + " is of type " + assetType + ". Only " + DataplexAssetResourceSpec.BIGQUERY_DATASET.name() + "and " + DataplexAssetResourceSpec.STORAGE_BUCKET<MASK><NEW_LINE>}<NEW_LINE>pipeline.run();<NEW_LINE>}
.name() + " supported."));
594,502
private void login() {<NEW_LINE>InputUtils.hideKeyboard(mEtLogin);<NEW_LINE>final String username = mEtLogin.getText().toString();<NEW_LINE>final String password = mEtPassword.getText().toString();<NEW_LINE>enableInput(false);<NEW_LINE>UiUtils.show(mProgress);<NEW_LINE>mTvLogin.setText("");<NEW_LINE>ThreadPool.getWorker().execute(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>final String[] auth = OsmOAuth.nativeAuthWithPassword(username, password);<NEW_LINE>final String username = auth == null ? null : OsmOAuth.nativeGetOsmUsername(auth[<MASK><NEW_LINE>UiThread.run(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>if (!isAdded())<NEW_LINE>return;<NEW_LINE>enableInput(true);<NEW_LINE>UiUtils.hide(mProgress);<NEW_LINE>mTvLogin.setText(R.string.login);<NEW_LINE>mDelegate.processAuth(auth, OsmOAuth.AuthType.OSM, username);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
0], auth[1]);
1,025,793
public com.amazonaws.services.appregistry.model.ServiceQuotaExceededException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.appregistry.model.ServiceQuotaExceededException serviceQuotaExceededException = new com.amazonaws.services.appregistry.model.ServiceQuotaExceededException(null);<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return 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 serviceQuotaExceededException;<NEW_LINE>}
JsonToken token = context.getCurrentToken();
642,951
public void open(ClosedListener l) {<NEW_LINE>this.listener = l;<NEW_LINE>skinnedDialog = new SkinnedDialog("skin3_dlg_deviceadd_mfchooser", "shell", SWT.TITLE | SWT.BORDER);<NEW_LINE>skinnedDialog.addCloseListener(new SkinnedDialogClosedListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void skinDialogClosed(SkinnedDialog dialog) {<NEW_LINE>if (listener != null) {<NEW_LINE>listener.MfChooserClosed(chosenMF);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>SWTSkin skin = skinnedDialog.getSkin();<NEW_LINE>SWTSkinObject so = skin.getSkinObject("list");<NEW_LINE>if (so instanceof SWTSkinObjectContainer) {<NEW_LINE>SWTSkinObjectContainer soList = (SWTSkinObjectContainer) so;<NEW_LINE>Composite parent = soList.getComposite();<NEW_LINE>Canvas centerCanvas = new Canvas(parent, SWT.NONE);<NEW_LINE>FormData fd = Utils.getFilledFormData();<NEW_LINE>fd.bottom = null;<NEW_LINE>fd.height = 0;<NEW_LINE>centerCanvas.setLayoutData(fd);<NEW_LINE>Composite area = new Composite(parent, SWT.NONE);<NEW_LINE>RowLayout rowLayout = new RowLayout(SWT.VERTICAL);<NEW_LINE>rowLayout.fill = true;<NEW_LINE>area.setLayout(rowLayout);<NEW_LINE>fd = Utils.getFilledFormData();<NEW_LINE>fd.left = new FormAttachment(centerCanvas, 50, SWT.CENTER);<NEW_LINE>fd.right = null;<NEW_LINE>area.setLayoutData(fd);<NEW_LINE>Listener btnListener = new Listener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void handleEvent(Event event) {<NEW_LINE>chosenMF = (DeviceManufacturer) event.widget.getData("mf");<NEW_LINE>skinnedDialog.close();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>DeviceManager deviceManager = DeviceManagerFactory.getSingleton();<NEW_LINE>DeviceManufacturer[] mfs = deviceManager.getDeviceManufacturers(Device.DT_MEDIA_RENDERER);<NEW_LINE>for (DeviceManufacturer mf : mfs) {<NEW_LINE>DeviceTemplate[] deviceTemplates = mf.getDeviceTemplates();<NEW_LINE>boolean hasNonAuto = false;<NEW_LINE>for (DeviceTemplate deviceTemplate : deviceTemplates) {<NEW_LINE>if (!deviceTemplate.isAuto()) {<NEW_LINE>hasNonAuto = true;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!hasNonAuto) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Button button = new Button(area, SWT.PUSH);<NEW_LINE>button.setText(mf.getName());<NEW_LINE>button.setData("mf", mf);<NEW_LINE>button.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>skinnedDialog.getShell().pack();<NEW_LINE>skinnedDialog.open();<NEW_LINE>}
addListener(SWT.MouseUp, btnListener);
667,727
protected void recalculateBoundingBox() {<NEW_LINE>if (this.direction == null)<NEW_LINE>return;<NEW_LINE>if (this.verticalOrientation == null)<NEW_LINE>return;<NEW_LINE>Vec3 pos = Vec3.atLowerCornerOf(getPos()).add(.5, .5, .5).subtract(Vec3.atLowerCornerOf(direction.getNormal()).scale(0.46875));<NEW_LINE>double d1 = pos.x;<NEW_LINE>double d2 = pos.y;<NEW_LINE>double d3 = pos.z;<NEW_LINE>this.setPosRaw(d1, d2, d3);<NEW_LINE>Axis axis = direction.getAxis();<NEW_LINE>if (size == 2)<NEW_LINE>pos = pos.add(Vec3.atLowerCornerOf(axis.isHorizontal() ? direction.getCounterClockWise().getNormal() : verticalOrientation.getClockWise().getNormal()).scale(0.5)).add(Vec3.atLowerCornerOf(axis.isHorizontal() ? Direction.UP.getNormal() : direction == Direction.UP ? verticalOrientation.getNormal() : verticalOrientation.getOpposite().getNormal()).scale(0.5));<NEW_LINE>d1 = pos.x;<NEW_LINE>d2 = pos.y;<NEW_LINE>d3 = pos.z;<NEW_LINE>double d4 = (double) this.getWidth();<NEW_LINE>double d5 = <MASK><NEW_LINE>double d6 = (double) this.getWidth();<NEW_LINE>Direction.Axis direction$axis = this.direction.getAxis();<NEW_LINE>switch(direction$axis) {<NEW_LINE>case X:<NEW_LINE>d4 = 1.0D;<NEW_LINE>break;<NEW_LINE>case Y:<NEW_LINE>d5 = 1.0D;<NEW_LINE>break;<NEW_LINE>case Z:<NEW_LINE>d6 = 1.0D;<NEW_LINE>}<NEW_LINE>d4 = d4 / 32.0D;<NEW_LINE>d5 = d5 / 32.0D;<NEW_LINE>d6 = d6 / 32.0D;<NEW_LINE>this.setBoundingBox(new AABB(d1 - d4, d2 - d5, d3 - d6, d1 + d4, d2 + d5, d3 + d6));<NEW_LINE>}
(double) this.getHeight();
1,149,293
public void configure(ConfigurableProvider provider) {<NEW_LINE>provider.<MASK><NEW_LINE>provider.addAlgorithm("KeyPairGenerator.McEliecePointcheval", PREFIX + "McElieceCCA2KeyPairGeneratorSpi");<NEW_LINE>provider.addAlgorithm("KeyPairGenerator.McElieceFujisaki", PREFIX + "McElieceCCA2KeyPairGeneratorSpi");<NEW_LINE>provider.addAlgorithm("KeyPairGenerator.McEliece", PREFIX + "McElieceKeyPairGeneratorSpi");<NEW_LINE>provider.addAlgorithm("KeyPairGenerator.McEliece-CCA2", PREFIX + "McElieceCCA2KeyPairGeneratorSpi");<NEW_LINE>provider.addAlgorithm("KeyFactory.McElieceKobaraImai", PREFIX + "McElieceCCA2KeyFactorySpi");<NEW_LINE>provider.addAlgorithm("KeyFactory.McEliecePointcheval", PREFIX + "McElieceCCA2KeyFactorySpi");<NEW_LINE>provider.addAlgorithm("KeyFactory.McElieceFujisaki", PREFIX + "McElieceCCA2KeyFactorySpi");<NEW_LINE>provider.addAlgorithm("KeyFactory.McEliece", PREFIX + "McElieceKeyFactorySpi");<NEW_LINE>provider.addAlgorithm("KeyFactory.McEliece-CCA2", PREFIX + "McElieceCCA2KeyFactorySpi");<NEW_LINE>provider.addAlgorithm("KeyFactory." + PQCObjectIdentifiers.mcElieceCca2, PREFIX + "McElieceCCA2KeyFactorySpi");<NEW_LINE>provider.addAlgorithm("KeyFactory." + PQCObjectIdentifiers.mcEliece, PREFIX + "McElieceKeyFactorySpi");<NEW_LINE>provider.addAlgorithm("Cipher.McEliece", PREFIX + "McEliecePKCSCipherSpi$McEliecePKCS");<NEW_LINE>provider.addAlgorithm("Cipher.McEliecePointcheval", PREFIX + "McEliecePointchevalCipherSpi$McEliecePointcheval");<NEW_LINE>provider.addAlgorithm("Cipher.McElieceKobaraImai", PREFIX + "McElieceKobaraImaiCipherSpi$McElieceKobaraImai");<NEW_LINE>provider.addAlgorithm("Cipher.McElieceFujisaki", PREFIX + "McElieceFujisakiCipherSpi$McElieceFujisaki");<NEW_LINE>}
addAlgorithm("KeyPairGenerator.McElieceKobaraImai", PREFIX + "McElieceCCA2KeyPairGeneratorSpi");
1,271,927
private void step3aBoundsUpdate(List<Vec> X, boolean[] r, int q, Vec v, final List<Vec> means, final int[] assignment, double[] upperBound, double[][] lowerBound, double[] meanSummaryConsts, List<Double> distAccelCache, List<List<Double>> meanQIs) {<NEW_LINE>// 3(a)<NEW_LINE>if (r[q]) {<NEW_LINE>r[q] = false;<NEW_LINE>double d;<NEW_LINE>int meanIndx = assignment[q];<NEW_LINE>if (dmds == null)<NEW_LINE>d = dm.dist(q, means.get(meanIndx), meanQIs.get(meanIndx), X, distAccelCache);<NEW_LINE>else<NEW_LINE>d = dmds.dist(meanSummaryConsts[meanIndx], means.get(meanIndx), v);<NEW_LINE>// /Not sure if this is supposed to be here<NEW_LINE>lowerBound<MASK><NEW_LINE>upperBound[q] = d;<NEW_LINE>}<NEW_LINE>}
[q][meanIndx] = d;
388,584
final ListTestGridSessionsResult executeListTestGridSessions(ListTestGridSessionsRequest listTestGridSessionsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listTestGridSessionsRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListTestGridSessionsRequest> request = null;<NEW_LINE>Response<ListTestGridSessionsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListTestGridSessionsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listTestGridSessionsRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Device Farm");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListTestGridSessions");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListTestGridSessionsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListTestGridSessionsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
98,169
final DescribeExportTasksResult executeDescribeExportTasks(DescribeExportTasksRequest describeExportTasksRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeExportTasksRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeExportTasksRequest> request = null;<NEW_LINE>Response<DescribeExportTasksResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeExportTasksRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeExportTasksRequest));<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, "Application Discovery Service");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeExportTasks");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeExportTasksResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeExportTasksResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
1,348,419
protected HttpProcessor createHttpProcessor(Settings settings) {<NEW_LINE>// request interceptors<NEW_LINE>List<HttpRequestInterceptor> requestInterceptors = new ArrayList<>();<NEW_LINE>requestInterceptors.add(new RequestDefaultHeaders());<NEW_LINE>requestInterceptors.add(new HeaderChecker());<NEW_LINE>requestInterceptors.add(new RequestContentWrapper(true));<NEW_LINE>requestInterceptors.add(new RequestTargetHost());<NEW_LINE>requestInterceptors.add(new RequestClientConnControl());<NEW_LINE>requestInterceptors.add(new RequestUserAgent(VersionInfo.getUserAgent("Apache-HttpClient", "org.apache.http.client", HttpClientBuilder.class)));<NEW_LINE>requestInterceptors.add(new RequestExpectContinue());<NEW_LINE>requestInterceptors.add(new RequestAddCookies());<NEW_LINE>if (settings.getBoolean(HttpSettings.RESPONSE_COMPRESSION)) {<NEW_LINE>requestInterceptors.add(new RequestAcceptEncoding());<NEW_LINE>}<NEW_LINE>requestInterceptors.add(new RequestAuthCache());<NEW_LINE>// this interceptor needs to be last one added and executed.<NEW_LINE>requestInterceptors.add(new HeaderRequestInterceptor());<NEW_LINE>// response interceptors<NEW_LINE>List<HttpResponseInterceptor> <MASK><NEW_LINE>responseInterceptors.add(new ResponseProcessCookies());<NEW_LINE>if (!settings.getBoolean(HttpSettings.DISABLE_RESPONSE_DECOMPRESSION)) {<NEW_LINE>responseInterceptors.add(new ResponseContentEncoding());<NEW_LINE>}<NEW_LINE>return new ImmutableHttpProcessor(requestInterceptors, responseInterceptors);<NEW_LINE>}
responseInterceptors = new ArrayList<>();
1,279,378
public void whenUpdateRetentionTimeThenUpdateInKafkaAndDB() throws Exception {<NEW_LINE>final EventType eventType = NakadiTestUtils.createEventType();<NEW_LINE>IntStream.range(0, 15).forEach(x -> publishEvent(eventType.getName(), "{\"foo\":\"bar\"}"));<NEW_LINE>NakadiTestUtils.switchTimelineDefaultStorage(eventType);<NEW_LINE>NakadiTestUtils.switchTimelineDefaultStorage(eventType);<NEW_LINE>List<Map> timelines = NakadiTestUtils.listTimelines(eventType.getName());<NEW_LINE>final String cleanupTimeBeforeUpdate = (String) timelines.get(0).get("cleaned_up_at");<NEW_LINE>final Long defaultRetentionTime = 172800000L;<NEW_LINE>assertRetentionTime(defaultRetentionTime, eventType.getName());<NEW_LINE>final Long newRetentionTime = 345600000L;<NEW_LINE>eventType.<MASK><NEW_LINE>final String updateBody = MAPPER.writer().writeValueAsString(eventType);<NEW_LINE>given().body(updateBody).header("accept", "application/json").contentType(JSON).put(ENDPOINT + "/" + eventType.getName()).then().body(equalTo("")).statusCode(HttpStatus.SC_OK);<NEW_LINE>timelines = NakadiTestUtils.listTimelines(eventType.getName());<NEW_LINE>final String cleanupTimeAfterUpdate = (String) timelines.get(0).get("cleaned_up_at");<NEW_LINE>final long cleanupTimeDiff = DateTime.parse(cleanupTimeAfterUpdate).getMillis() - DateTime.parse(cleanupTimeBeforeUpdate).getMillis();<NEW_LINE>Assert.assertThat(cleanupTimeDiff, is(newRetentionTime - defaultRetentionTime));<NEW_LINE>assertRetentionTime(newRetentionTime, eventType.getName());<NEW_LINE>}
getOptions().setRetentionTime(newRetentionTime);
252,241
public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) {<NEW_LINE>Route route = <MASK><NEW_LINE>Mono<Void> asyncResult = chain.filter(exchange);<NEW_LINE>if (route != null) {<NEW_LINE>String routeId = route.getId();<NEW_LINE>Object[] params = paramParser.parseParameterFor(routeId, exchange, r -> r.getResourceMode() == SentinelGatewayConstants.RESOURCE_MODE_ROUTE_ID);<NEW_LINE>String origin = Optional.ofNullable(GatewayCallbackManager.getRequestOriginParser()).map(f -> f.apply(exchange)).orElse("");<NEW_LINE>asyncResult = asyncResult.transform(new SentinelReactorTransformer<>(new EntryConfig(routeId, ResourceTypeConstants.COMMON_API_GATEWAY, EntryType.IN, 1, params, new ContextConfig(contextName(routeId), origin))));<NEW_LINE>}<NEW_LINE>Set<String> matchingApis = pickMatchingApiDefinitions(exchange);<NEW_LINE>for (String apiName : matchingApis) {<NEW_LINE>Object[] params = paramParser.parseParameterFor(apiName, exchange, r -> r.getResourceMode() == SentinelGatewayConstants.RESOURCE_MODE_CUSTOM_API_NAME);<NEW_LINE>asyncResult = asyncResult.transform(new SentinelReactorTransformer<>(new EntryConfig(apiName, ResourceTypeConstants.COMMON_API_GATEWAY, EntryType.IN, 1, params)));<NEW_LINE>}<NEW_LINE>return asyncResult;<NEW_LINE>}
exchange.getAttribute(ServerWebExchangeUtils.GATEWAY_ROUTE_ATTR);
1,566,588
private HandlerInfo adaptToHandlerInfo(org.apache.cxf.jaxws30.handler.types.PortComponentHandlerType pt) {<NEW_LINE>HandlerInfo handler = new HandlerInfo();<NEW_LINE>handler.setId(pt.getId());<NEW_LINE>handler.setHandlerClass(pt.getHandlerClass().getValue());<NEW_LINE>handler.setHandlerName(pt.getHandlerName().getValue());<NEW_LINE>for (org.apache.cxf.jaxws30.handler.types.CString sRole : pt.getSoapRole()) {<NEW_LINE>handler.<MASK><NEW_LINE>}<NEW_LINE>for (org.apache.cxf.jaxws30.handler.types.XsdQNameType sHead : pt.getSoapHeader()) {<NEW_LINE>handler.addSoapHeader(new XsdQNameInfo(sHead.getValue(), sHead.getId()));<NEW_LINE>}<NEW_LINE>for (org.apache.cxf.jaxws30.handler.types.ParamValueType param : pt.getInitParam()) {<NEW_LINE>handler.addInitParam(new ParamValueInfo(param.getParamName().getValue(), param.getParamValue().getValue()));<NEW_LINE>}<NEW_LINE>return handler;<NEW_LINE>}
addSoapRole(sRole.getValue());
863,431
public void init(Properties props) {<NEW_LINE>_port = (int) props.get(PORT);<NEW_LINE>_zkStr = props.getProperty(ZOOKEEPER_CONNECT);<NEW_LINE>_logDirPath = props.getProperty(LOG_DIRS);<NEW_LINE>// Create the ZK nodes for Kafka, if needed<NEW_LINE>int indexOfFirstSlash = _zkStr.indexOf('/');<NEW_LINE>if (indexOfFirstSlash != -1) {<NEW_LINE>String bareZkUrl = _zkStr.substring(0, indexOfFirstSlash);<NEW_LINE>String zkNodePath = _zkStr.substring(indexOfFirstSlash);<NEW_LINE>ZkClient client = new ZkClient(bareZkUrl);<NEW_LINE>client.createPersistent(zkNodePath, true);<NEW_LINE>client.close();<NEW_LINE>}<NEW_LINE>File logDir = new File(_logDirPath);<NEW_LINE>logDir.mkdirs();<NEW_LINE>props.put("zookeeper.session.timeout.ms", "60000");<NEW_LINE>_serverStartable = new KafkaServer(new KafkaConfig(props), Time.SYSTEM, Option.empty(), false);<NEW_LINE>final Map<String, Object> config = new HashMap<>();<NEW_LINE>config.put(<MASK><NEW_LINE>config.put(AdminClientConfig.CLIENT_ID_CONFIG, "Kafka2AdminClient-" + UUID.randomUUID().toString());<NEW_LINE>config.put(AdminClientConfig.REQUEST_TIMEOUT_MS_CONFIG, 15000);<NEW_LINE>_adminClient = KafkaAdminClient.create(config);<NEW_LINE>}
AdminClientConfig.BOOTSTRAP_SERVERS_CONFIG, "localhost:" + _port);
527,474
private byte[] renderFunction(WasmFunction function) {<NEW_LINE>WasmBinaryWriter code = new WasmBinaryWriter();<NEW_LINE>List<WasmLocal> localVariables = function.getLocalVariables();<NEW_LINE>int parameterCount = Math.min(function.getParameters().size(), localVariables.size());<NEW_LINE>localVariables = localVariables.subList(parameterCount, localVariables.size());<NEW_LINE>if (localVariables.isEmpty()) {<NEW_LINE>code.writeLEB(0);<NEW_LINE>} else {<NEW_LINE>List<LocalEntry> localEntries = new ArrayList<>();<NEW_LINE>LocalEntry currentEntry = new LocalEntry(localVariables.get(0).getType());<NEW_LINE>for (int i = 1; i < localVariables.size(); ++i) {<NEW_LINE>WasmType type = localVariables.get(i).getType();<NEW_LINE>if (currentEntry.type == type) {<NEW_LINE>currentEntry.count++;<NEW_LINE>} else {<NEW_LINE>localEntries.add(currentEntry);<NEW_LINE>currentEntry = new LocalEntry(type);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>localEntries.add(currentEntry);<NEW_LINE>code.writeLEB(localEntries.size());<NEW_LINE>for (LocalEntry entry : localEntries) {<NEW_LINE><MASK><NEW_LINE>code.writeType(entry.type, version);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Map<String, Integer> importIndexes = this.functionIndexes;<NEW_LINE>WasmBinaryRenderingVisitor visitor = new WasmBinaryRenderingVisitor(code, version, functionIndexes, importIndexes, signatureIndexes);<NEW_LINE>for (WasmExpression part : function.getBody()) {<NEW_LINE>part.acceptVisitor(visitor);<NEW_LINE>}<NEW_LINE>code.writeByte(0x0B);<NEW_LINE>return code.getData();<NEW_LINE>}
code.writeLEB(entry.count);
1,740,092
/*<NEW_LINE>*<NEW_LINE>*/<NEW_LINE>private void onTweetFeedItemSingleTap(View view, int position) {<NEW_LINE>if (mSelectedItems.size() == 0) {<NEW_LINE>TweetFeedItemView tweetFeedItemView = (TweetFeedItemView) (view);<NEW_LINE>TwitterStatus status = tweetFeedItemView.getTwitterStatus();<NEW_LINE>FragmentActivity activity = getActivity();<NEW_LINE>if (activity != null) {<NEW_LINE>Intent tweetSpotlightIntent = new Intent(activity, TweetSpotlightActivity.class);<NEW_LINE>tweetSpotlightIntent.putExtra("statusId", Long.toString(status.mId));<NEW_LINE>tweetSpotlightIntent.putExtra(<MASK><NEW_LINE>tweetSpotlightIntent.putExtra("clearCompose", "true");<NEW_LINE>activity.startActivityForResult(tweetSpotlightIntent, Constant.REQUEST_CODE_SPOTLIGHT);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>onTweetFeedItemLongPress(view, position);<NEW_LINE>}<NEW_LINE>}
"status", status.toString());
526,212
public void initFreeStreamer(double tL, double tV, double tH) {<NEW_LINE>double tx = getFacing().getAxis() == Axis.X ? tL : tH;<NEW_LINE>double ty = getFacing().getAxis() <MASK><NEW_LINE>double tz = getFacing().getAxis() == Axis.Y ? tV : getFacing().getAxis() == Axis.X ? tH : tL;<NEW_LINE>Direction f = null;<NEW_LINE>if (getFacing().getAxis() == Axis.Y) {<NEW_LINE>if (Math.abs(tz) > Math.abs(tx))<NEW_LINE>f = tz < 0 ? Direction.NORTH : Direction.SOUTH;<NEW_LINE>else<NEW_LINE>f = tx < 0 ? Direction.WEST : Direction.EAST;<NEW_LINE>} else if (getFacing().getAxis() == Axis.Z) {<NEW_LINE>if (Math.abs(ty) > Math.abs(tx))<NEW_LINE>f = ty < 0 ? Direction.DOWN : Direction.UP;<NEW_LINE>else<NEW_LINE>f = tx < 0 ? Direction.WEST : Direction.EAST;<NEW_LINE>} else {<NEW_LINE>if (Math.abs(ty) > Math.abs(tz))<NEW_LINE>f = ty < 0 ? Direction.DOWN : Direction.UP;<NEW_LINE>else<NEW_LINE>f = tz < 0 ? Direction.NORTH : Direction.SOUTH;<NEW_LINE>}<NEW_LINE>double verticalOffset = 1 + Utils.RAND.nextDouble() * .25;<NEW_LINE>Vec3 coilPos = Vec3.atCenterOf(getBlockPos());<NEW_LINE>// Vertical offset<NEW_LINE>coilPos = coilPos.add(getFacing().getStepX() * verticalOffset, getFacing().getStepY() * verticalOffset, getFacing().getStepZ() * verticalOffset);<NEW_LINE>// offset to direction<NEW_LINE>coilPos = coilPos.add(f.getStepX() * .375, f.getStepY() * .375, f.getStepZ() * .375);<NEW_LINE>// random side offset<NEW_LINE>f = DirectionUtils.rotateAround(f, getFacing().getAxis());<NEW_LINE>double dShift = (Utils.RAND.nextDouble() - .5) * .75;<NEW_LINE>coilPos = coilPos.add(f.getStepX() * dShift, f.getStepY() * dShift, f.getStepZ() * dShift);<NEW_LINE>addAnimation(new LightningAnimation(coilPos, Vec3.atLowerCornerOf(getBlockPos()).add(tx, ty, tz)));<NEW_LINE>// world.playSound(null, getPos(), IESounds.tesla, SoundCategory.BLOCKS,2.5f, .5f + Utils.RAND.nextFloat());<NEW_LINE>level.playLocalSound(getBlockPos().getX(), getBlockPos().getY(), getBlockPos().getZ(), IESounds.tesla, SoundSource.BLOCKS, 2.5F, 0.5F + Utils.RAND.nextFloat(), true);<NEW_LINE>}
== Axis.Y ? tL : tV;
1,300,256
public void initialize() {<NEW_LINE>themeChoiceBox.getItems().addAll(UiTheme.applicableValues());<NEW_LINE>if (!themeChoiceBox.getItems().contains(settings.theme().get())) {<NEW_LINE>settings.theme().set(UiTheme.LIGHT);<NEW_LINE>}<NEW_LINE>themeChoiceBox.valueProperty().bindBidirectional(settings.theme());<NEW_LINE>themeChoiceBox.setConverter(new UiThemeConverter(resourceBundle));<NEW_LINE>showMinimizeButtonCheckbox.selectedProperty().<MASK><NEW_LINE>showTrayIconCheckbox.selectedProperty().bindBidirectional(settings.showTrayIcon());<NEW_LINE>preferredLanguageChoiceBox.getItems().add(null);<NEW_LINE>preferredLanguageChoiceBox.getItems().addAll(SupportedLanguages.LANGUAGAE_TAGS);<NEW_LINE>preferredLanguageChoiceBox.valueProperty().bindBidirectional(settings.languageProperty());<NEW_LINE>preferredLanguageChoiceBox.setConverter(new LanguageTagConverter(resourceBundle));<NEW_LINE>nodeOrientationLtr.setSelected(settings.userInterfaceOrientation().get() == NodeOrientation.LEFT_TO_RIGHT);<NEW_LINE>nodeOrientationRtl.setSelected(settings.userInterfaceOrientation().get() == NodeOrientation.RIGHT_TO_LEFT);<NEW_LINE>nodeOrientation.selectedToggleProperty().addListener(this::toggleNodeOrientation);<NEW_LINE>}
bindBidirectional(settings.showMinimizeButton());
1,558,063
final CreateSimulationJobResult executeCreateSimulationJob(CreateSimulationJobRequest createSimulationJobRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createSimulationJobRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateSimulationJobRequest> request = null;<NEW_LINE>Response<CreateSimulationJobResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateSimulationJobRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createSimulationJobRequest));<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, "RoboMaker");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateSimulationJob");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateSimulationJobResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(<MASK><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>}
false), new CreateSimulationJobResultJsonUnmarshaller());
1,298,266
public String replace(Parameters parameters) {<NEW_LINE>// URL<NEW_LINE>String urlString = url.replace(parameters);<NEW_LINE>if (!Item.checkReq(isRequired, urlString)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// Options<NEW_LINE>List<String> optionsString = new ArrayList<>();<NEW_LINE>for (Item option : options) {<NEW_LINE>String optionString = option.replace(parameters);<NEW_LINE>if (!Item.checkReq(isRequired, optionString)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>optionsString.add(optionString);<NEW_LINE>}<NEW_LINE>boolean outputError = optionsString.contains("error");<NEW_LINE>// General errors<NEW_LINE>if (parameters.get("allow-request") == null) {<NEW_LINE>return outputError ? "Request not allowed in this context" : error();<NEW_LINE>}<NEW_LINE>if (!urlString.startsWith("http://") && !urlString.startsWith("https://")) {<NEW_LINE>return outputError ? "URL scheme must be http or https" : error();<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>UrlRequest request = new UrlRequest(urlString);<NEW_LINE>request.setLabel("Custom Command");<NEW_LINE>FullResult result = request.sync();<NEW_LINE>String resultText = result.getResult();<NEW_LINE>if (resultText == null) {<NEW_LINE>if (outputError) {<NEW_LINE>if (result.getResponseCode() != 0) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>return "Request error: " + result.getError();<NEW_LINE>}<NEW_LINE>return error();<NEW_LINE>}<NEW_LINE>if (resultText.isEmpty() && isRequired) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return resultText;<NEW_LINE>} catch (Exception ex) {<NEW_LINE>return outputError ? ex.getClass().getSimpleName() + ": " + ex.getLocalizedMessage() : error();<NEW_LINE>}<NEW_LINE>}
return "Request error: " + result.getResponseCode();
471,017
public TableMember unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>TableMember tableMember = new TableMember();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("name", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>tableMember.setName(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("schema", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>tableMember.setSchema(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("type", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>tableMember.setType(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 tableMember;<NEW_LINE>}
class).unmarshall(context));
1,571,166
public static void openTorrentSimple() {<NEW_LINE>Utils.execSWTThread(new AERunnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void runSupport() {<NEW_LINE>final <MASK><NEW_LINE>if (shell == null)<NEW_LINE>return;<NEW_LINE>FileDialog fDialog = new FileDialog(shell, SWT.OPEN | SWT.MULTI);<NEW_LINE>fDialog.setFilterPath(getFilterPathTorrent());<NEW_LINE>fDialog.setFilterExtensions(new String[] { "*.torrent", "*.tor", Constants.FILE_WILDCARD });<NEW_LINE>fDialog.setFilterNames(new String[] { "*.torrent", "*.tor", Constants.FILE_WILDCARD });<NEW_LINE>fDialog.setText(MessageText.getString("MainWindow.dialog.choose.file"));<NEW_LINE>String path = setFilterPathTorrent(fDialog.open());<NEW_LINE>if (path == null)<NEW_LINE>return;<NEW_LINE>UIFunctionsManagerSWT.getUIFunctionsSWT().openTorrentOpenOptions(shell, path, fDialog.getFileNames(), false, false);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
Shell shell = Utils.findAnyShell();
825,832
public void asyncSendMessage(SendMessageCallback callback, List<byte[]> bodyList, String groupId, String streamId, long dt, String msgUUID, long timeout, TimeUnit timeUnit, Map<String, String> extraAttrMap) throws ProxysdkException {<NEW_LINE>dt = ProxyUtils.covertZeroDt(dt);<NEW_LINE>if (!ProxyUtils.isBodyValid(bodyList) || !ProxyUtils.isDtValid(dt) || !ProxyUtils.isAttrKeysValid(extraAttrMap)) {<NEW_LINE>throw new ProxysdkException(SendResult.INVALID_ATTRIBUTES.toString());<NEW_LINE>}<NEW_LINE>addIndexCnt(groupId, streamId, bodyList.size());<NEW_LINE>StringBuilder attrs = ProxyUtils.convertAttrToStr(extraAttrMap);<NEW_LINE>if (msgtype == 7 || msgtype == 8) {<NEW_LINE>// if (!isGroupIdTransfer)<NEW_LINE>EncodeObject encodeObject = new EncodeObject(bodyList, this.getMsgtype(), isCompress, isReport, isGroupIdTransfer, dt / 1000, idGenerator.getNextInt(), groupId, streamId, attrs.toString());<NEW_LINE>encodeObject.setSupportLF(isSupportLF);<NEW_LINE>sender.asyncSendMessage(encodeObject, <MASK><NEW_LINE>} else if (msgtype == 3 || msgtype == 5) {<NEW_LINE>attrs.append("&groupId=").append(groupId).append("&streamId=").append(streamId).append("&dt=").append(dt).append("&cnt=").append(bodyList.size());<NEW_LINE>if (isCompress) {<NEW_LINE>attrs.append("&cp=snappy");<NEW_LINE>sender.asyncSendMessage(new EncodeObject(bodyList, attrs.toString(), idGenerator.getNextId(), this.getMsgtype(), true, groupId), callback, msgUUID, timeout, timeUnit);<NEW_LINE>} else {<NEW_LINE>sender.asyncSendMessage(new EncodeObject(bodyList, attrs.toString(), idGenerator.getNextId(), this.getMsgtype(), false, groupId), callback, msgUUID, timeout, timeUnit);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
callback, msgUUID, timeout, timeUnit);
1,383,498
public void run() {<NEW_LINE>boolean active = TimeHelper.sleepToNextMinute();<NEW_LINE>while (active) {<NEW_LINE>Transaction t = Cat.newTransaction("AlertHeartbeat", TimeHelper.getMinuteStr());<NEW_LINE>long current = System.currentTimeMillis();<NEW_LINE>try {<NEW_LINE>Set<String<MASK><NEW_LINE>for (String domain : domains) {<NEW_LINE>if (m_serverFilterConfigManager.validateDomain(domain) && StringUtils.isNotEmpty(domain)) {<NEW_LINE>try {<NEW_LINE>processDomain(domain);<NEW_LINE>} catch (Exception e) {<NEW_LINE>Cat.logError(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>t.setStatus(Transaction.SUCCESS);<NEW_LINE>} catch (Exception e) {<NEW_LINE>t.setStatus(e);<NEW_LINE>} finally {<NEW_LINE>t.complete();<NEW_LINE>}<NEW_LINE>long duration = System.currentTimeMillis() - current;<NEW_LINE>try {<NEW_LINE>if (duration < DURATION) {<NEW_LINE>Thread.sleep(DURATION - duration);<NEW_LINE>}<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>active = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
> domains = m_projectService.findAllDomains();
7,883
public void marshall(GetTablesRequest getTablesRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (getTablesRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(getTablesRequest.getCatalogId(), CATALOGID_BINDING);<NEW_LINE>protocolMarshaller.marshall(getTablesRequest.getDatabaseName(), DATABASENAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(getTablesRequest.getExpression(), EXPRESSION_BINDING);<NEW_LINE>protocolMarshaller.marshall(getTablesRequest.getNextToken(), NEXTTOKEN_BINDING);<NEW_LINE>protocolMarshaller.marshall(getTablesRequest.getMaxResults(), MAXRESULTS_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(getTablesRequest.getQueryAsOfTime(), QUERYASOFTIME_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
getTablesRequest.getTransactionId(), TRANSACTIONID_BINDING);
310,177
public boolean deleteRecording(File destDir, String recordingId, File recordingDir, String format) {<NEW_LINE>File metadataXml = recordingServiceHelper.getMetadataXmlLocation(recordingDir.getPath());<NEW_LINE>RecordingMetadata r = recordingServiceHelper.getRecordingMetadata(metadataXml);<NEW_LINE>if (r != null) {<NEW_LINE>if (!destDir.exists())<NEW_LINE>destDir.mkdirs();<NEW_LINE>try {<NEW_LINE>FileUtils.moveDirectory(recordingDir, new File(destDir.getPath() <MASK><NEW_LINE>r.setState(Recording.STATE_DELETED);<NEW_LINE>r.setPublished(false);<NEW_LINE>File medataXmlFile = recordingServiceHelper.getMetadataXmlLocation(destDir.getAbsolutePath() + File.separatorChar + recordingId);<NEW_LINE>// Process the changes by saving the recording into metadata.xml<NEW_LINE>return recordingServiceHelper.saveRecordingMetadata(medataXmlFile, r);<NEW_LINE>} catch (IOException e) {<NEW_LINE>log.error("Failed to delete recording : " + recordingId, e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
+ File.separatorChar + recordingId));
341,975
public void drawMap(IMAGE_TYPE image, boolean adjustToFit) {<NEW_LINE>imageBdr.initialize(image);<NEW_LINE>imageBdr.setColor(UColor.WHITE);<NEW_LINE>imageBdr.setAreaFilled(true);<NEW_LINE>imageBdr.drawRect(0, 0, imageBdr.getWidth(), imageBdr.getHeight());<NEW_LINE>if (imageBdr.getWidth() > 0 && map != null) {<NEW_LINE>if (adjustToFit)<NEW_LINE>getTransformer().adjustTransformation(getMap().getBoundingBox(), imageBdr.getWidth(), imageBdr.getHeight());<NEW_LINE>float latMin = transformer.lat(imageBdr.getHeight());<NEW_LINE>float lonMin = transformer.lon(0);<NEW_LINE>float latMax = transformer.lat(0);<NEW_LINE>float lonMax = transformer.lon(imageBdr.getWidth());<NEW_LINE>float scale = transformer.computeScale();<NEW_LINE>BoundingBox vbox = new BoundingBox(latMin, lonMin, latMax, lonMax);<NEW_LINE>float viewScale = scale / renderer.getDisplayFactor();<NEW_LINE>renderer.initForRendering(imageBdr, transformer, map);<NEW_LINE>map.visitEntities(renderer, vbox, viewScale);<NEW_LINE>for (MapEntity entity : map.getVisibleMarkersAndTracks(viewScale)) entity.accept(renderer);<NEW_LINE>renderer.printBufferedObjects();<NEW_LINE>if (renderer.isDebugModeEnabled() && map instanceof DefaultMap) {<NEW_LINE>List<double[]> splits = ((DefaultMap) map).getEntityTree().getSplitCoords();<NEW_LINE>imageBdr.setColor(UColor.LIGHT_GRAY);<NEW_LINE><MASK><NEW_LINE>imageBdr.setAreaFilled(false);<NEW_LINE>CoordTransformer trans = renderer.getTransformer();<NEW_LINE>for (double[] split : splits) imageBdr.drawLine(renderer.getTransformer().x(split[1]), trans.y(split[0]), trans.x(split[3]), trans.y(split[2]));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>image = imageBdr.getResult();<NEW_LINE>}
imageBdr.setLineStyle(false, 1f);
179,568
public void stop(boolean mpOnly, int shutdownMode, boolean closeConnection) throws Exception {<NEW_LINE>if (callback != null)<NEW_LINE>callback.stop(mpOnly, shutdownMode, closeConnection);<NEW_LINE>if (!mpOnly) {<NEW_LINE>if (UnitTestMEStarter.me.getWSRMEngineComponent() != null) {<NEW_LINE>UnitTestMEStarter.me.getWSRMEngineComponent().stop(shutdownMode);<NEW_LINE>UnitTestMEStarter.me<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>UnitTestMEStarter.me.getMessageProcessor().serverStopping();<NEW_LINE>UnitTestMEStarter.me.getMessageProcessor().stop(shutdownMode);<NEW_LINE>UnitTestMEStarter.me.getMessageProcessor().destroy();<NEW_LINE>if (!mpOnly) {<NEW_LINE>((JsEngineComponent) UnitTestMEStarter.me.getMessageStore()).stop(shutdownMode);<NEW_LINE>((JsEngineComponent) UnitTestMEStarter.me.getMessageStore()).destroy();<NEW_LINE>if (reintTRM) {<NEW_LINE>trm.stop(shutdownMode);<NEW_LINE>trm.destroy();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.getWSRMEngineComponent().destroy();
1,023,109
public SortField visitReference(Reference ref, final SortSymbolContext context) {<NEW_LINE>// can't use the SortField(fieldName, type) constructor<NEW_LINE>// because values are saved using docValues and therefore they're indexed in lucene as binary and not<NEW_LINE>// with the reference valueType.<NEW_LINE>// this is why we use a custom comparator source with the same logic as ES<NEW_LINE>// Always prefer doc-values. Should be faster for sorting and otherwise we'd<NEW_LINE>// default to the `NullFieldComparatorSource` - leading to `null` values.<NEW_LINE>if (ref.column().isChildOf(DocSysColumns.DOC)) {<NEW_LINE>ref = (Reference) DocReferences.inverseSourceLookup(ref);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if (DocSysColumns.SCORE.equals(columnIdent)) {<NEW_LINE>return !context.reverseFlag ? SORT_SCORE_REVERSE : SORT_SCORE;<NEW_LINE>}<NEW_LINE>if (DocSysColumns.RAW.equals(columnIdent) || DocSysColumns.ID.equals(columnIdent)) {<NEW_LINE>return customSortField(DocSysColumns.nameForLucene(columnIdent), ref, context);<NEW_LINE>}<NEW_LINE>if (!ref.hasDocValues()) {<NEW_LINE>return customSortField(ref.toString(), ref, context);<NEW_LINE>}<NEW_LINE>MappedFieldType fieldType = fieldTypeLookup.get(columnIdent.fqn());<NEW_LINE>if (fieldType == null) {<NEW_LINE>FieldComparatorSource fieldComparatorSource = new NullFieldComparatorSource(NullSentinelValues.nullSentinelForScoreDoc(ref.valueType(), context.reverseFlag, context.nullFirst));<NEW_LINE>return new SortField(columnIdent.fqn(), fieldComparatorSource, context.reverseFlag);<NEW_LINE>} else if (ref.valueType().equals(DataTypes.IP) || ref.valueType().id() == BitStringType.ID) {<NEW_LINE>return customSortField(ref.toString(), ref, context);<NEW_LINE>} else {<NEW_LINE>return mappedSortField(ref, fieldType, context.reverseFlag, NullValueOrder.fromFlag(context.nullFirst));<NEW_LINE>}<NEW_LINE>}
ColumnIdent columnIdent = ref.column();
1,105,073
static <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> Seq<Tuple10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>> zipAll(Iterable<? extends T1> s1, Iterable<? extends T2> s2, Iterable<? extends T3> s3, Iterable<? extends T4> s4, Iterable<? extends T5> s5, Iterable<? extends T6> s6, Iterable<? extends T7> s7, Iterable<? extends T8> s8, Iterable<? extends T9> s9, Iterable<? extends T10> s10, T1 default1, T2 default2, T3 default3, T4 default4, T5 default5, T6 default6, T7 default7, T8 default8, T9 default9, T10 default10) {<NEW_LINE>return zipAll(s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, default1, default2, default3, default4, default5, default6, default7, default8, <MASK><NEW_LINE>}
default9, default10, Tuple::tuple);
1,819,780
// this method MUST NOT be called with the wabgroup locked.. (and must not lock the wabGroup)<NEW_LINE>// this method is only used when the entire wabGroup is being removed, which occurs during<NEW_LINE>// server-stop and in response to the removal of the wab feature from the server config.<NEW_LINE>void uninstallGroup(WABInstaller installer) {<NEW_LINE>// call for each of them to be removed<NEW_LINE>// in practice this will only mean one web container removal for the group<NEW_LINE>// but we need all the removes to update the WAB states.<NEW_LINE>if (wabs != null) {<NEW_LINE>// iterating over a concurrentlinkedqueue without a lock, means we'll see everything in the list<NEW_LINE>// thats present when we get the iterator. it will NOT throw concurrentmodification if the list is<NEW_LINE>// modified during iteration, but also does not guarantee to reflect all external modifications<NEW_LINE>List<WAB> toRemove <MASK><NEW_LINE>for (WAB wab : wabs) {<NEW_LINE>// remove the wab from the webcontainer, if needed.<NEW_LINE>wab.terminateWAB();<NEW_LINE>wab.removeWAB();<NEW_LINE>toRemove.add(wab);<NEW_LINE>}<NEW_LINE>wabs.removeAll(toRemove);<NEW_LINE>if (wabs.size() != 0) {<NEW_LINE>installer.wabLifecycleDebug("First pass wab group uninstall detected outstanding WABs", wabs);<NEW_LINE>toRemove.clear();<NEW_LINE>for (WAB wab : wabs) {<NEW_LINE>// remove the wab from the webcontainer, if needed.<NEW_LINE>wab.terminateWAB();<NEW_LINE>wab.removeWAB();<NEW_LINE>toRemove.add(wab);<NEW_LINE>}<NEW_LINE>wabs.removeAll(toRemove);<NEW_LINE>// any left in the 2nd pass just don't get removed.<NEW_LINE>if (wabs.size() != 0) {<NEW_LINE>installer.wabLifecycleDebug("Second pass wab group uninstall detected outstanding WABs", wabs);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
= new ArrayList<WAB>();
811,208
private static EObject capture(String subject, MatchResult mr, int group_index, Options opts) {<NEW_LINE>int start = mr.start(group_index);<NEW_LINE>if (start == -1) {<NEW_LINE>return nocapture(opts);<NEW_LINE>}<NEW_LINE>int end = mr.end(group_index);<NEW_LINE>if (opts.capture_type == am_index) {<NEW_LINE>if (INDEX_COMPATIBLE && opts.unicode) {<NEW_LINE>try {<NEW_LINE>int istart = subject.substring(0, start).getBytes("UTF8").length;<NEW_LINE>int ilen = subject.substring(start, end).getBytes("UTF8").length;<NEW_LINE>return new ETuple2(ERT.box(istart), ERT.box(ilen));<NEW_LINE>} catch (UnsupportedEncodingException e) {<NEW_LINE>throw new InternalError();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new ETuple2(ERT.box(start), ERT.box(end - start));<NEW_LINE>} else if (opts.capture_type == am_list) {<NEW_LINE>String sub = subject.substring(start, end);<NEW_LINE>EBigString ebs = EBigString.fromString(sub);<NEW_LINE>return erjang.m.unicode.Native.characters_to_list(ebs, opts.unicode ? am_unicode : am_latin1);<NEW_LINE>} else if (opts.capture_type == am_binary) {<NEW_LINE>String sub = <MASK><NEW_LINE>EBigString ebs = EBigString.fromString(sub);<NEW_LINE>return erjang.m.unicode.Native.characters_to_binary(ebs, opts.unicode ? am_unicode : am_latin1);<NEW_LINE>} else {<NEW_LINE>throw new InternalError("bad capture type: " + opts.capture_type);<NEW_LINE>}<NEW_LINE>}
subject.substring(start, end);
1,562,371
final ListSolutionVersionsResult executeListSolutionVersions(ListSolutionVersionsRequest listSolutionVersionsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listSolutionVersionsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListSolutionVersionsRequest> request = null;<NEW_LINE>Response<ListSolutionVersionsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListSolutionVersionsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listSolutionVersionsRequest));<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, "Personalize");<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<ListSolutionVersionsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListSolutionVersionsResultJsonUnmarshaller());<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, "ListSolutionVersions");
635,687
private void deleteAccountAndReturnIfNecessary() {<NEW_LINE>if (mInitMode && mAccount != null && !mAccount.isOptionSet(Account.OPTION_LOGGED_IN_SUCCESSFULLY)) {<NEW_LINE>xmppConnectionService.deleteAccount(mAccount);<NEW_LINE>}<NEW_LINE>final boolean magicCreate = mAccount != null && mAccount.isOptionSet(Account.OPTION_MAGIC_CREATE) && !mAccount.isOptionSet(Account.OPTION_LOGGED_IN_SUCCESSFULLY);<NEW_LINE>final Jid jid = mAccount == null ? null : mAccount.getJid();<NEW_LINE>if (SignupUtils.isSupportTokenRegistry() && jid != null && magicCreate && !jid.getDomain().equals(Config.MAGIC_CREATE_DOMAIN)) {<NEW_LINE>final Jid preset;<NEW_LINE>if (mAccount.isOptionSet(Account.OPTION_FIXED_USERNAME)) {<NEW_LINE>preset = jid.asBareJid();<NEW_LINE>} else {<NEW_LINE>preset = jid.getDomain();<NEW_LINE>}<NEW_LINE>final Intent intent = SignupUtils.getTokenRegistrationIntent(this, preset, mAccount.getKey(Account.PRE_AUTH_REGISTRATION_TOKEN));<NEW_LINE>StartConversationActivity.addInviteUri(intent, getIntent());<NEW_LINE>startActivity(intent);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final List<Account> accounts = xmppConnectionService == null <MASK><NEW_LINE>if (accounts != null && accounts.size() == 0 && Config.MAGIC_CREATE_DOMAIN != null) {<NEW_LINE>Intent intent = SignupUtils.getSignUpIntent(this, mForceRegister != null && mForceRegister);<NEW_LINE>StartConversationActivity.addInviteUri(intent, getIntent());<NEW_LINE>startActivity(intent);<NEW_LINE>}<NEW_LINE>}
? null : xmppConnectionService.getAccounts();
460,752
final GetDeviceResult executeGetDevice(GetDeviceRequest getDeviceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getDeviceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetDeviceRequest> request = null;<NEW_LINE>Response<GetDeviceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetDeviceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getDeviceRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Device Farm");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetDevice");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetDeviceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetDeviceResultJsonUnmarshaller());<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.ADVANCED_CONFIG, advancedConfig);
589,182
private BaseBottomSheetItem createShowAlongTheRouteItem(final LocalRoutingParameter optionsItem) {<NEW_LINE>return new SimpleBottomSheetItem.Builder().setIcon(getContentIcon((optionsItem.getActiveIconId()))).setTitle(getString(R.string.show_along_the_route)).setLayoutId(R.layout.bottom_sheet_item_simple_56dp).setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View view) {<NEW_LINE><MASK><NEW_LINE>FragmentManager fm = getFragmentManager();<NEW_LINE>if (fm == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Bundle args = new Bundle();<NEW_LINE>ShowAlongTheRouteBottomSheet fragment = new ShowAlongTheRouteBottomSheet();<NEW_LINE>fragment.setUsedOnMap(true);<NEW_LINE>fragment.setArguments(args);<NEW_LINE>fragment.setTargetFragment(RouteOptionsBottomSheet.this, ShowAlongTheRouteBottomSheet.REQUEST_CODE);<NEW_LINE>fragment.setAppMode(applicationMode);<NEW_LINE>fragment.show(fm, ShowAlongTheRouteBottomSheet.TAG);<NEW_LINE>updateMenu();<NEW_LINE>}<NEW_LINE>}).create();<NEW_LINE>}
routingOptionsHelper.addNewRouteMenuParameter(applicationMode, optionsItem);
1,749,868
// Uses a few rules to stem tokens<NEW_LINE>public static String stem(String a) {<NEW_LINE>int i = a.indexOf(' ');<NEW_LINE>if (i != -1)<NEW_LINE>return stem(a.substring(0, i)) + ' ' + stem(a.substring(i + 1));<NEW_LINE>// Maybe we should just use the Stanford stemmer<NEW_LINE>String res = a;<NEW_LINE>// hard coded words<NEW_LINE>if (a.equals("having") || a.equals("has"))<NEW_LINE>res = "have";<NEW_LINE>else if (a.equals("using"))<NEW_LINE>res = "use";<NEW_LINE>else if (a.equals("including"))<NEW_LINE>res = "include";<NEW_LINE>else if (a.equals("beginning"))<NEW_LINE>res = "begin";<NEW_LINE>else if (a.equals("utilizing"))<NEW_LINE>res = "utilize";<NEW_LINE>else if (a.equals("featuring"))<NEW_LINE>res = "feature";<NEW_LINE>else if (a.equals("preceding"))<NEW_LINE>res = "precede";<NEW_LINE>else // rules<NEW_LINE>if (a.endsWith("ing"))<NEW_LINE>res = a.substring(0, <MASK><NEW_LINE>else if (a.endsWith("s") && !a.equals("'s"))<NEW_LINE>res = a.substring(0, a.length() - 1);<NEW_LINE>// don't return an empty string<NEW_LINE>if (res.length() > 0)<NEW_LINE>return res;<NEW_LINE>return a;<NEW_LINE>}
a.length() - 3);
615,085
public int cb(http_parser.lolevel.HTTPParser p, ByteBuffer buf, int pos, int len) {<NEW_LINE>IRubyObject ret = runtime.getNil();<NEW_LINE>byte[] data = fetchBytes(buf, pos, len);<NEW_LINE>if (callback_object != null) {<NEW_LINE>if (((RubyObject) callback_object).respond_to_p(runtime.newSymbol("on_body")).toJava(Boolean.class) == Boolean.TRUE) {<NEW_LINE>ThreadContext context = callback_object.getRuntime().getCurrentContext();<NEW_LINE>ret = callback_object.callMethod(context, "on_body", callback_object.getRuntime().newString<MASK><NEW_LINE>}<NEW_LINE>} else if (on_body != null) {<NEW_LINE>ThreadContext context = on_body.getRuntime().getCurrentContext();<NEW_LINE>ret = on_body.callMethod(context, "call", on_body.getRuntime().newString(new String(data)));<NEW_LINE>}<NEW_LINE>if (ret == runtime.newSymbol("stop")) {<NEW_LINE>throw new StopException();<NEW_LINE>} else {<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>}
(new String(data)));
72,764
private String fixRepositoryName(String repositoryName) {<NEW_LINE>if (StringUtils.isEmpty(repositoryName)) {<NEW_LINE>return repositoryName;<NEW_LINE>}<NEW_LINE>// Decode url-encoded repository name (issue-278)<NEW_LINE>// http://stackoverflow.com/questions/17183110<NEW_LINE>String name = repositoryName.replace("%7E", "~").replace("%7e", "~");<NEW_LINE>name = name.replace("%2F", "/"<MASK><NEW_LINE>if (name.charAt(name.length() - 1) == '/') {<NEW_LINE>name = name.substring(0, name.length() - 1);<NEW_LINE>}<NEW_LINE>// strip duplicate-slashes from requests for repositoryName (ticket-117, issue-454)<NEW_LINE>// specify first char as slash so we strip leading slashes<NEW_LINE>char lastChar = '/';<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>for (char c : name.toCharArray()) {<NEW_LINE>if (c == '/' && lastChar == c) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>sb.append(c);<NEW_LINE>lastChar = c;<NEW_LINE>}<NEW_LINE>return sb.toString();<NEW_LINE>}
).replace("%2f", "/");
926,956
public UpdateClusterResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>UpdateClusterResult updateClusterResult = new UpdateClusterResult();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return updateClusterResult;<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("Cluster", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>updateClusterResult.setCluster(ClusterJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return updateClusterResult;<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
1,032,777
private double computeImpactB(IntVar v, int a, int b, double before) {<NEW_LINE>model<MASK><NEW_LINE>double after;<NEW_LINE>try {<NEW_LINE>v.updateBounds(a, b, this);<NEW_LINE>model.getSolver().getEngine().propagate();<NEW_LINE>after = searchSpaceSize(vars);<NEW_LINE>return 1.0d - (after / before);<NEW_LINE>} catch (ContradictionException e) {<NEW_LINE>model.getSolver().getEngine().flush();<NEW_LINE>model.getEnvironment().worldPop();<NEW_LINE>model.getEnvironment().worldPush();<NEW_LINE>// if the value leads to fail, then the value can be removed from the domain<NEW_LINE>try {<NEW_LINE>v.removeInterval(a, b, this);<NEW_LINE>model.getSolver().getEngine().propagate();<NEW_LINE>} catch (ContradictionException ex) {<NEW_LINE>learnsAndFails = true;<NEW_LINE>model.getSolver().getEngine().flush();<NEW_LINE>}<NEW_LINE>return 1.0d;<NEW_LINE>} finally {<NEW_LINE>model.getEnvironment().worldPop();<NEW_LINE>}<NEW_LINE>}
.getEnvironment().worldPush();
144,811
public void handle(GlowSession session, LoginStartMessage message) {<NEW_LINE>String name = message.getUsername();<NEW_LINE>int length = name.length();<NEW_LINE>if (length > 16 || !usernamePattern.matcher(name).find()) {<NEW_LINE>session.disconnect("Invalid username provided.", true);<NEW_LINE>}<NEW_LINE>GlowServer server = session.getServer();<NEW_LINE>if (server.getOnlineMode()) {<NEW_LINE>// Get necessary information to create our request message<NEW_LINE>String sessionId = session.getSessionId();<NEW_LINE>byte[] publicKey = // Convert to X509 format<NEW_LINE>SecurityUtils.generateX509Key(server.getKeyPair().<MASK><NEW_LINE>byte[] verifyToken = SecurityUtils.generateVerifyToken();<NEW_LINE>// Set verify data on session for use in the response handler<NEW_LINE>session.setVerifyToken(verifyToken);<NEW_LINE>session.setVerifyUsername(name);<NEW_LINE>// Send created request message and wait for the response<NEW_LINE>session.send(new EncryptionKeyRequestMessage(sessionId, publicKey, verifyToken));<NEW_LINE>} else {<NEW_LINE>GlowPlayerProfile profile;<NEW_LINE>ProxyData proxy = session.getProxyData();<NEW_LINE>if (proxy == null) {<NEW_LINE>UUID uuid = UUID.nameUUIDFromBytes(("OfflinePlayer:" + name).getBytes(StandardCharsets.UTF_8));<NEW_LINE>profile = new GlowPlayerProfile(name, uuid, true);<NEW_LINE>} else {<NEW_LINE>profile = proxy.getProfile(name);<NEW_LINE>}<NEW_LINE>AsyncPlayerPreLoginEvent event = EventFactory.getInstance().onPlayerPreLogin(profile.getName(), session.getAddress(), profile.getId());<NEW_LINE>if (event.getLoginResult() != Result.ALLOWED) {<NEW_LINE>session.disconnect(event.getKickMessage(), true);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>GlowPlayerProfile finalProfile = profile;<NEW_LINE>server.getScheduler().runTask(null, () -> session.setPlayer(finalProfile));<NEW_LINE>}<NEW_LINE>}
getPublic()).getEncoded();
1,487,918
public void save(File file) throws IOException {<NEW_LINE>PrintStream out = new PrintStream(file, "UTF-8");<NEW_LINE>out.println("font.name=" + fontName);<NEW_LINE><MASK><NEW_LINE>out.println("font.bold=" + bold);<NEW_LINE>out.println("font.italic=" + italic);<NEW_LINE>out.println("font.gamma=" + gamma);<NEW_LINE>out.println("font.mono=" + mono);<NEW_LINE>out.println();<NEW_LINE>out.println("font2.file=" + font2File);<NEW_LINE>out.println("font2.use=" + font2Active);<NEW_LINE>out.println();<NEW_LINE>out.println("pad.top=" + paddingTop);<NEW_LINE>out.println("pad.right=" + paddingRight);<NEW_LINE>out.println("pad.bottom=" + paddingBottom);<NEW_LINE>out.println("pad.left=" + paddingLeft);<NEW_LINE>out.println("pad.advance.x=" + paddingAdvanceX);<NEW_LINE>out.println("pad.advance.y=" + paddingAdvanceY);<NEW_LINE>out.println();<NEW_LINE>out.println("glyph.native.rendering=" + nativeRendering);<NEW_LINE>out.println("glyph.page.width=" + glyphPageWidth);<NEW_LINE>out.println("glyph.page.height=" + glyphPageHeight);<NEW_LINE>out.println("glyph.text=" + glyphText);<NEW_LINE>out.println();<NEW_LINE>out.println(RENDER_TYPE + "=" + renderType);<NEW_LINE>out.println();<NEW_LINE>for (Iterator iter = effects.iterator(); iter.hasNext(); ) {<NEW_LINE>ConfigurableEffect effect = (ConfigurableEffect) iter.next();<NEW_LINE>out.println("effect.class=" + effect.getClass().getName());<NEW_LINE>for (Iterator iter2 = effect.getValues().iterator(); iter2.hasNext(); ) {<NEW_LINE>Value value = (Value) iter2.next();<NEW_LINE>out.println("effect." + value.getName() + "=" + value.getString());<NEW_LINE>}<NEW_LINE>out.println();<NEW_LINE>}<NEW_LINE>out.close();<NEW_LINE>}
out.println("font.size=" + fontSize);
1,365,343
private JoinReference buildJoin(Queryable source, String referenceName, Map<String, Argument> callingColumnArgs, Map<String, Argument> fixedArguments) {<NEW_LINE>Queryable root = source.getRoot();<NEW_LINE>Type<?> tableClass = dictionary.getEntityClass(root.getName(), root.getVersion());<NEW_LINE>JoinPath joinPath = new JoinPath(tableClass, metaDataStore, referenceName);<NEW_LINE>Path.PathElement lastElement = joinPath.lastElement().get();<NEW_LINE>Queryable joinSource = metaDataStore.getTable(lastElement.getType());<NEW_LINE>String fieldName = lastElement.getFieldName();<NEW_LINE>Reference reference;<NEW_LINE>if (fieldName.startsWith("$")) {<NEW_LINE>reference = PhysicalReference.builder().source(joinSource).name(fieldName.substring<MASK><NEW_LINE>} else {<NEW_LINE>ColumnProjection referencedColumn = joinSource.getColumnProjection(fieldName);<NEW_LINE>ColumnProjection newColumn = referencedColumn.withArguments(mergedArgumentMap(referencedColumn.getArguments(), callingColumnArgs, fixedArguments));<NEW_LINE>reference = LogicalReference.builder().source(joinSource).column(newColumn).references(buildReferenceForColumn(joinSource, newColumn)).build();<NEW_LINE>}<NEW_LINE>return JoinReference.builder().path(joinPath).source(source).reference(reference).build();<NEW_LINE>}
(1)).build();
281,240
boolean checkType(TypeBinding binding) {<NEW_LINE>if (binding == null)<NEW_LINE>return false;<NEW_LINE>switch(binding.kind()) {<NEW_LINE>case Binding.PARAMETERIZED_TYPE:<NEW_LINE>TypeBinding[] arguments = <MASK><NEW_LINE>if (arguments == null)<NEW_LINE>return false;<NEW_LINE>for (int i = 0, length = arguments.length; i < length; i++) {<NEW_LINE>if (checkType(arguments[i]))<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case Binding.WILDCARD_TYPE:<NEW_LINE>return checkType(((WildcardBinding) binding).bound);<NEW_LINE>case Binding.INTERSECTION_TYPE:<NEW_LINE>if (checkType(((WildcardBinding) binding).bound))<NEW_LINE>return true;<NEW_LINE>TypeBinding[] otherBounds = ((WildcardBinding) binding).otherBounds;<NEW_LINE>// per construction, otherBounds is never null<NEW_LINE>for (int i = 0, length = otherBounds.length; i < length; i++) {<NEW_LINE>if (checkType(otherBounds[i]))<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case Binding.ARRAY_TYPE:<NEW_LINE>return checkType(((ArrayBinding) binding).leafComponentType);<NEW_LINE>case Binding.TYPE_PARAMETER:<NEW_LINE>if (binding.isCapture()) {<NEW_LINE>CaptureBinding captureBinding = (CaptureBinding) binding;<NEW_LINE>if (captureBinding.end == position && captureBinding.wildcard == wildcardBinding) {<NEW_LINE>if (captureBinding instanceof CaptureBinding18) {<NEW_LINE>if (((CaptureBinding18) captureBinding).captureID != capture18id)<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>this.capture = captureBinding;<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
((ParameterizedTypeBinding) binding).arguments;
1,668,053
public static ListOrdersResponse unmarshall(ListOrdersResponse listOrdersResponse, UnmarshallerContext _ctx) {<NEW_LINE>listOrdersResponse.setRequestId(_ctx.stringValue("ListOrdersResponse.RequestId"));<NEW_LINE>listOrdersResponse.setTotalCount(_ctx.longValue("ListOrdersResponse.TotalCount"));<NEW_LINE>listOrdersResponse.setErrorCode(_ctx.stringValue("ListOrdersResponse.ErrorCode"));<NEW_LINE>listOrdersResponse.setErrorMessage(_ctx.stringValue("ListOrdersResponse.ErrorMessage"));<NEW_LINE>listOrdersResponse.setSuccess(_ctx.booleanValue("ListOrdersResponse.Success"));<NEW_LINE>List<Order> orders = new ArrayList<Order>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListOrdersResponse.Orders.Length"); i++) {<NEW_LINE>Order order = new Order();<NEW_LINE>order.setComment(_ctx.stringValue("ListOrdersResponse.Orders[" + i + "].Comment"));<NEW_LINE>order.setLastModifyTime(_ctx.stringValue("ListOrdersResponse.Orders[" + i + "].LastModifyTime"));<NEW_LINE>order.setStatusCode(_ctx.stringValue("ListOrdersResponse.Orders[" + i + "].StatusCode"));<NEW_LINE>order.setCreateTime(_ctx.stringValue("ListOrdersResponse.Orders[" + i + "].CreateTime"));<NEW_LINE>order.setCommitter(_ctx.stringValue("ListOrdersResponse.Orders[" + i + "].Committer"));<NEW_LINE>order.setCommitterId(_ctx.longValue<MASK><NEW_LINE>order.setStatusDesc(_ctx.stringValue("ListOrdersResponse.Orders[" + i + "].StatusDesc"));<NEW_LINE>order.setPluginType(_ctx.stringValue("ListOrdersResponse.Orders[" + i + "].PluginType"));<NEW_LINE>order.setOrderId(_ctx.longValue("ListOrdersResponse.Orders[" + i + "].OrderId"));<NEW_LINE>orders.add(order);<NEW_LINE>}<NEW_LINE>listOrdersResponse.setOrders(orders);<NEW_LINE>return listOrdersResponse;<NEW_LINE>}
("ListOrdersResponse.Orders[" + i + "].CommitterId"));
938,270
public DescribeCACertificateResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>DescribeCACertificateResult describeCACertificateResult = new DescribeCACertificateResult();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return describeCACertificateResult;<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("certificateDescription", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>describeCACertificateResult.setCertificateDescription(CACertificateDescriptionJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("registrationConfig", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>describeCACertificateResult.setRegistrationConfig(RegistrationConfigJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return describeCACertificateResult;<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
647,747
protected void onCreate(Bundle savedInstanceState) {<NEW_LINE>((Infinity) getApplication()).getAppComponent().inject(this);<NEW_LINE>setImmersiveModeNotApplicable();<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE><MASK><NEW_LINE>ButterKnife.bind(this);<NEW_LINE>applyCustomTheme();<NEW_LINE>if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && isChangeStatusBarIconColor()) {<NEW_LINE>addOnOffsetChangedListener(mAppBarLayout);<NEW_LINE>}<NEW_LINE>Intent intent = getIntent();<NEW_LINE>privateMessage = intent.getParcelableExtra(EXTRA_PRIVATE_MESSAGE);<NEW_LINE>setSupportActionBar(mToolbar);<NEW_LINE>setToolbarGoToTop(mToolbar);<NEW_LINE>mProvideUserAvatarCallbacks = new ArrayList<>();<NEW_LINE>mAccessToken = mCurrentAccountSharedPreferences.getString(SharedPreferencesUtils.ACCESS_TOKEN, null);<NEW_LINE>mAccountName = mCurrentAccountSharedPreferences.getString(SharedPreferencesUtils.ACCOUNT_NAME, null);<NEW_LINE>if (savedInstanceState != null) {<NEW_LINE>mUserAvatar = savedInstanceState.getString(USER_AVATAR_STATE);<NEW_LINE>}<NEW_LINE>bindView();<NEW_LINE>}
setContentView(R.layout.activity_view_private_messages);
284,005
public static void complete(File datadir) {<NEW_LINE>File renderdata = new File(datadir, "renderdata");<NEW_LINE>File dynamicrenderdata = new File(renderdata, "modsupport");<NEW_LINE>dynamicrenderdata.mkdirs();<NEW_LINE>// Clean up anything in directory<NEW_LINE>File[] files = dynamicrenderdata.listFiles();<NEW_LINE>for (File f : files) {<NEW_LINE>if (f.isFile())<NEW_LINE>f.delete();<NEW_LINE>}<NEW_LINE>// If no API init, quit here<NEW_LINE>if (ModSupportAPI.api == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ModSupportImpl api_impl = (ModSupportImpl) ModSupportAPI.api;<NEW_LINE>// Loop through texture definitions<NEW_LINE>for (ModTextureDefinitionImpl tdi : api_impl.txtDefsByModID.values()) {<NEW_LINE>boolean good = false;<NEW_LINE>if (tdi.isPublished()) {<NEW_LINE>Log.info("Processing mod support from mod " + tdi.getModID() + " version " + tdi.getModVersion());<NEW_LINE>try {<NEW_LINE>tdi.writeToFile(dynamicrenderdata);<NEW_LINE>good = true;<NEW_LINE>} catch (IOException iox) {<NEW_LINE>Log.warning("Error creating texture definition for mod " + tdi.getModID() + " version " + tdi.getModVersion());<NEW_LINE>}<NEW_LINE>ModModelDefinitionImpl mdi = (ModModelDefinitionImpl) tdi.getModelDefinition();<NEW_LINE>if ((mdi != null) && mdi.isPublished() && good) {<NEW_LINE>try {<NEW_LINE>mdi.writeToFile(dynamicrenderdata);<NEW_LINE>} catch (IOException iox) {<NEW_LINE>Log.warning("Error creating model definition for mod " + mdi.getModID() + " version " + mdi.getModVersion());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>Log.warning("Unpublished mod support from mod " + tdi.getModID() + " version " + <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>Log.info("Mod Support processing completed");<NEW_LINE>}
tdi.getModVersion() + " skipped");
100,679
private boolean writeOff(int invoiceId, String documentNo, Timestamp dateInvoiced, int currencyId, BigDecimal openAmt) {<NEW_LINE>// Nothing to do<NEW_LINE>if (openAmt == null || openAmt.signum() == 0)<NEW_LINE>return false;<NEW_LINE>if (openAmt.abs().compareTo(getMaxInvWriteOffAmt()) >= 0)<NEW_LINE>return false;<NEW_LINE>//<NEW_LINE>if (isSimulation()) {<NEW_LINE>addLog("@IsSimulation@");<NEW_LINE>addLog(invoiceId, dateInvoiced, openAmt, documentNo);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>// Invoice<NEW_LINE>MInvoice invoice = new MInvoice(getCtx(), invoiceId, get_TrxName());<NEW_LINE>if (!invoice.isSOTrx())<NEW_LINE>openAmt = openAmt.negate();<NEW_LINE>// Allocation<NEW_LINE>if (allocation == null || currencyId != allocation.getC_Currency_ID()) {<NEW_LINE>processAllocation();<NEW_LINE>allocation = new MAllocationHdr(getCtx(), true, getDateAcct(), currencyId, getProcessInfo().getTitle() + " #" + getAD_PInstance_ID(), get_TrxName());<NEW_LINE>allocation.setAD_Org_ID(invoice.getAD_Org_ID());<NEW_LINE>if (!allocation.save()) {<NEW_LINE>log.log(Level.SEVERE, "Cannot create allocation header");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Payment<NEW_LINE>if (isCreatePayment() && (payment == null || invoice.getC_BPartner_ID() != payment.getC_BPartner_ID() || currencyId != payment.getC_Currency_ID())) {<NEW_LINE>processPayment();<NEW_LINE>payment = new MPayment(getCtx(), 0, get_TrxName());<NEW_LINE>payment.setAD_Org_ID(invoice.getAD_Org_ID());<NEW_LINE>payment.setC_BankAccount_ID(getBankAccountId());<NEW_LINE><MASK><NEW_LINE>payment.setDateTrx(getDateAcct());<NEW_LINE>payment.setDateAcct(getDateAcct());<NEW_LINE>payment.setDescription(getProcessInfo().getTitle() + " #" + getAD_PInstance_ID());<NEW_LINE>payment.setC_BPartner_ID(invoice.getC_BPartner_ID());<NEW_LINE>// payments are negative<NEW_LINE>payment.setIsReceipt(true);<NEW_LINE>payment.setC_Currency_ID(currencyId);<NEW_LINE>if (!payment.save()) {<NEW_LINE>log.log(Level.SEVERE, "Cannot create payment");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Line<NEW_LINE>MAllocationLine allocationLine = null;<NEW_LINE>if (isCreatePayment()) {<NEW_LINE>allocationLine = new MAllocationLine(allocation, openAmt, Env.ZERO, Env.ZERO, Env.ZERO);<NEW_LINE>payment.setPayAmt(payment.getPayAmt().add(openAmt));<NEW_LINE>allocationLine.setC_Payment_ID(payment.getC_Payment_ID());<NEW_LINE>} else<NEW_LINE>allocationLine = new MAllocationLine(allocation, Env.ZERO, Env.ZERO, openAmt, Env.ZERO);<NEW_LINE>allocationLine.setC_Invoice_ID(invoiceId);<NEW_LINE>if (allocationLine.save()) {<NEW_LINE>addLog(invoiceId, dateInvoiced, openAmt, documentNo);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>// Error<NEW_LINE>log.log(Level.SEVERE, "Cannot create allocation line for C_Invoice_ID=" + invoiceId);<NEW_LINE>return false;<NEW_LINE>}
payment.setTenderType(MPayment.TENDERTYPE_Check);
1,257,707
public static Query<? extends Model> createQuery(Long recordId, DataConfigLine line, Class<? extends Model> modelClass) throws AxelorException {<NEW_LINE>String filter;<NEW_LINE>switch(line.getTypeSelect()) {<NEW_LINE>case DataConfigLineRepository.TYPE_PATH:<NEW_LINE>MetaField relationalField = line.getMetaFieldPath();<NEW_LINE>if (relationalField == null) {<NEW_LINE>throw new AxelorException(line, TraceBackRepository.CATEGORY_NO_VALUE, I18n.get(IExceptionMessages.EMPTY_RELATIONAL_FIELD_IN_DATA_CONFIG_LINE), line.getMetaModel().getName());<NEW_LINE>}<NEW_LINE>filter = createFilter(relationalField.getName());<NEW_LINE>break;<NEW_LINE>case DataConfigLineRepository.TYPE_QUERY:<NEW_LINE>filter = line.getPath();<NEW_LINE>if (filter == null) {<NEW_LINE>throw new AxelorException(line, TraceBackRepository.CATEGORY_NO_VALUE, I18n.get(IExceptionMessages.EMPTY_QUERY_IN_DATA_CONFIG_LINE), line.<MASK><NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new AxelorException(line, TraceBackRepository.CATEGORY_CONFIGURATION_ERROR, "Unknown case");<NEW_LINE>}<NEW_LINE>return JpaRepository.of(modelClass).all().filter(filter, recordId);<NEW_LINE>}
getMetaModel().getName());