Optional variable - variable might not be initialized Is this the correct way to  use and initialize the Optional variables .. I get an error "variable might not be initialized " on all these variables when I call calculateAnnualCalculationTotal ..I want to use these variables in the annualCalculationSummaryDto if the insurance.product isn't abc or def otherwise those three fields that am trying to set in the annualCalculationSummaryDto should remain null ..                    Optional&lt;CalculatedPaymentsDto&gt; calculatedPayments  ;         Optional&lt;PaidPaymentsDTO&gt; paidPayments  ;         Optional&lt;CreatePaymentResponseDto&gt; payment ;          if (!insurance.getProduct().equalsIgnoreCase("abc") &amp;&amp; !insurance.getProduct().equalsIgnoreCase("def")) {              int totalAnnualCalculationSum = calculateAnnualCalculationTotal(insurance, requestDto.getAnnualCalculationYear(), calculatedPayments, paidPayments);             payment = Optional.ofNullable(createPayment(getCreatePaymentRequestDto(insurance, calculatedPayments.get(), totalAnnualCalculationSum, requestDto.getAnnualCalculationYear())));         }          AnnualCalculationSummaryDto annualCalculationSummaryDto = new AnnualCalculationSummaryDto();         if(calculatedPayments.isPresent() &amp;&amp; paidPayments.isPresent() &amp;&amp; payment.isPresent()){             annualCalculationSummaryDto.setCalculatedPaymentsDto(calculatedPayments.get());             annualCalculationSummaryDto.setPaidPaymentsDTO(paidPayments.get());             annualCalculationSummaryDto.setPayments(payment.get());         }      annualCalculationSummaryDto.setParam1(inr.getProduct());      annualCalculationSummaryDto.setParam2(requestDto.getTotal());      annualCalculationSummaryRepository.save(annualCalculationSummaryDto);   ............. ............. ..............  private int calculateAnnualCalculationTotal (Insurance insurance , int year , Optional&lt;CalculatedPaymentsDto&gt; calculatedPayments , Optional&lt;PaidPaymentsDTO&gt; paidPayments) {          calculatedPayments = Optional.ofNullable(paymentService.getCalculatedPayments(insurance.getId(), year));          paidPayments = Optional.ofNullable(paymentService.getPaidPayments(insurance.getInsuranceYears(), year));        totalSum = calculatedPayments.get().getParam1()+ paidPayments.get().getParam2(); ..... }   Or is there a better way to write this ..
Is Java "pass-by-reference" or "pass-by-value"? I always thought Java uses pass-by-reference. However, I've seen a couple of blog posts (for example, ) that claim that it isn't (the blog post says that Java uses pass-by-value). I don't think I understand the distinction they're making. What is the explanation?
What is the relationship between UV image and material texture? I am struggling to understand perhaps a very simple concept in Blender. There are materials which might have some diffuse coloring and a texture image, and there are also UV maps with their own images. Both can be applied to meshes or faces, but it seems that if a face has UV map then the material's texture is ignored and an image for UV map is picked.   If so, what is the use for a texture in a material if it is replaced by UV map's image?   EDIT: I've added some images to clarify the issue I have.   Case 1: a basic plane with material which has a texture, and no UV map. Diffuse color is applied, but material's texture is not.   Case 2: like above, but with reduced intensity of texture.   Case 3: Added UVmap and added image to the UVmap. Now I have texture, but not the diffuse color, and if UVmap was a different image, it would be picked regardless of texture set in the material.   So if I have UVmap image, what is the material texture for? Where are the NetworkManager logs? A previous poster on the regular forums (  ) said /var/log/daemon.log, but I don't seem to have such a file. Do I need to enable logging? $$\lim_{n\to\infty} (1+\frac{2}{n})^{n^2} e^{-2n} = ? $$         $e$   $e^2$   $e^{-1}$   $e^{-2}$      My answer is 1. Since $$\lim_{n \to \infty} \left(1+\frac{2}{n}\right)^{n} =e^{+2}.$$  Therefore $$\lim_{n\to\infty} \left(1+\frac{2}{n}\right)^{n^2} =e^{2n}.$$  Where am I wrong? Expected time to roll all 1 through 6 on a die What is the average number of times it would it take to roll a fair 6-sided die and get all numbers on the die?  The order in which the numbers appear does not matter.  I had this questions explained to me by a professor (not math professor), but it was not clear in the explanation.  We were given the answer $(1-(\frac56)^n)^6 = .5$ or $n = 12.152$  Can someone please explain this to me, possibly with a link to a general topic? Is there a way to make Runnable's run() throw an exception? How does Latex compilers integrate packages into its existing core functions? JavaScriptSerializer - JSON serialization of enum as string Resizing an image in a post? Travelling through the Schengen area with a Refugee Travel Document issued by the USA I just want to double check to make sure I won't run into any issues at the border of entry.  I'm a permanent resident of the USA with a green card and I have a travel document issued by the USA (I-571). Will I have any issues traveling around in the Schegen countries?  Do I need a visa? Do I have to pay any fees? [Firmware Bug]: TSC_DEADLINE disabled due to Errata - what should I do about this? Visualization for Euclidean Algorithm Simulating a Brownian Excursion using a Brownian Bridge? UBUNTU 14.04 cheese booth not detect webcam Cheese Booth shows an error:     There was an error playing video from the webcam     I test if webcam works fine or not by opening google hangout, its works fine.    Please tell, what is the issue in cheese booth.  Note: Sometimes the cheese booth works fine but most of time not Is $K[a,b]=K(a,b)$ for algebraic $a, b$? HTML element does not fade in using jquery What is the difference between update-grub and update-grub2? I'm making some changes on my grub file under /etc/default/grub. In some tutorials I have seen sudo update-grub and others sudo update-grub2. What is the difference? I assume that the following sentences are grammatically correct:   He resents your being more popular than he is. Most of the members paid their dues without my asking them. They objected to the youngest girl's being given the command position. What do you think about his buying such an expensive car? We were all sorry about Jane's losing her parents like that.   I'm still getting used to this possessive gerund structure. It sounded so weird to me at first. Is the structure used in both formal and informal contexts? Are there any alternative structures that result in the same meaning and are more frequently used? (Examples taken from ) Generalizing the case $p=2$ we would like to know if the statement below is true.  Let $p$ the smallest prime dividing the order of $G$. If $H$ is a subgroup of $G$ with index $p$ then $H$ is normal. ZF: Difference between POW and SEP? ALTER TABLE [dbo].[REMINDER_EMAIL]  WITH CHECK ADD  CONSTRAINT    [FK__REMINDER_EMAIL__FACILITY_ID] FOREIGN KEY ( [FACILITY_ID] )   REFERENCES [dbo].[FACILITY] ( [FACILITY_ID] )  ALTER TABLE [dbo].[REMINDER_EMAIL] CHECK CONSTRAINT [FK__REMINDER_EMAIL__FACILITY_ID]