Close Menu
    DevStackTipsDevStackTips
    • Home
    • News & Updates
      1. Tech & Work
      2. View All

      CodeSOD: An Echo In Here in here

      September 19, 2025

      How To Minimize The Environmental Impact Of Your Website

      September 19, 2025

      Progress adds AI coding assistance to Telerik and Kendo UI libraries

      September 19, 2025

      Wasm 3.0 standard is now officially complete

      September 19, 2025

      Development Release: Ubuntu 25.10 Beta

      September 18, 2025

      Development Release: Linux Mint 7 Beta “LMDE”

      September 18, 2025

      Distribution Release: Tails 7.0

      September 18, 2025

      Distribution Release: Security Onion 2.4.180

      September 18, 2025
    • Development
      1. Algorithms & Data Structures
      2. Artificial Intelligence
      3. Back-End Development
      4. Databases
      5. Front-End Development
      6. Libraries & Frameworks
      7. Machine Learning
      8. Security
      9. Software Engineering
      10. Tools & IDEs
      11. Web Design
      12. Web Development
      13. Web Security
      14. Programming Languages
        • PHP
        • JavaScript
      Featured

      GenStudio for Performance Marketing: What’s New and What We’ve Learned

      September 19, 2025
      Recent

      GenStudio for Performance Marketing: What’s New and What We’ve Learned

      September 19, 2025

      Agentic and Generative Commerce Can Elevate CX in B2B

      September 19, 2025

      AI Momentum and Perficient’s Inclusion in Analyst Reports – Highlights From 2025 So Far

      September 18, 2025
    • Operating Systems
      1. Windows
      2. Linux
      3. macOS
      Featured

      Denmark’s Strategic Leap Replacing Microsoft Office 365 with LibreOffice for Digital Independence

      September 19, 2025
      Recent

      Denmark’s Strategic Leap Replacing Microsoft Office 365 with LibreOffice for Digital Independence

      September 19, 2025

      Development Release: Ubuntu 25.10 Beta

      September 18, 2025

      Development Release: Linux Mint 7 Beta “LMDE”

      September 18, 2025
    • Learning Resources
      • Books
      • Cheatsheets
      • Tutorials & Guides
    Home»News & Updates»CodeSOD: Using the Old Bean

    CodeSOD: Using the Old Bean

    June 19, 2025

    If you write a lot of Java, you’re going to end up writing a lot of getters and setters. Without debating the merits of loads of getters and setters versus bare properties, ideally, getters and setters are the easiest code to write. Many IDEs will just generate them for you! How can you screw up getters and setters?

    Well, Dave found someone who could.

    <span class="hljs-keyword">private</span> ReportDatesDao reportDatesDao;
    <span class="hljs-meta">@Resource(name = CensusDao.BEAN_NAME)</span>
    <span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title function_">setAuditDao</span><span class="hljs-params">(CensusDao censusDao)</span> {
       <span class="hljs-built_in">this</span>.reportDatesDao = reportDatesDao;
    }
    

    The function is called setAuditDao, takes a CensusDao input, but manipulates reportDatesDao, because clearly someone copy/pasted and didn’t think about what they were doing.

    The result, however, is that this just sets this.reportDatesDao equal to itself.

    I’m always impressed by code which given the chance to make multiple decisions makes every wrong choice, even if it is just lazy copy/paste.

    [Advertisement] Plan Your .NET 9 Migration with Confidence
    Your journey to .NET 9 is more than just one decision.Avoid migration migraines with the advice in this free guide. Download Free Guide Now!

    Source: Read More 

    Facebook Twitter Reddit Email Copy Link
    Previous ArticleLingmo OS – modern Linux distribution based on Debian
    Next Article CVE-2025-52474 – WeGIA Web Manager SQL Injection Vulnerability

    Related Posts

    News & Updates

    Development Release: Ubuntu 25.10 Beta

    September 18, 2025
    News & Updates

    Development Release: Linux Mint 7 Beta “LMDE”

    September 18, 2025
    Leave A Reply Cancel Reply

    For security, use of Google's reCAPTCHA service is required which is subject to the Google Privacy Policy and Terms of Use.

    Continue Reading

    CISA Adds SAP NetWeaver Vulnerability to KEV Catalog

    Security

    CVE-2025-53027 – Oracle Virtualization VirtualBox Core Virtual Takeover

    Common Vulnerabilities and Exposures (CVEs)

    CVE-2025-32794 – OpenEMR Cross-Site Scripting (XSS) Vulnerability

    Common Vulnerabilities and Exposures (CVEs)

    CVE-2025-30026 – AXIS Camera Station Authentication Bypass Vulnerability

    Common Vulnerabilities and Exposures (CVEs)

    Highlights

    Development

    Acquia Source: What it is, and why you should be learning to use it

    August 5, 2025

    Meet Acquia Source Acquia Source powered by Drupal is Acquia’s SaaS solution to streamline building,…

    High Tide (TIDAL Client for Linux) Gains New Features

    May 21, 2025

    CVE-2025-54627 – Skia Out-of-Bounds Write Vulnerability

    August 6, 2025

    Visa preps AI-ready credit cards for automated shopping transactions

    April 30, 2025
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.