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

      CodeSOD: A Unique Way to Primary Key

      July 22, 2025

      BrowserStack launches Figma plugin for detecting accessibility issues in design phase

      July 22, 2025

      Parasoft brings agentic AI to service virtualization in latest release

      July 22, 2025

      Node.js vs. Python for Backend: 7 Reasons C-Level Leaders Choose Node.js Talent

      July 21, 2025

      The best CRM software with email marketing in 2025: Expert tested and reviewed

      July 22, 2025

      This multi-port car charger can power 4 gadgets at once – and it’s surprisingly cheap

      July 22, 2025

      I’m a wearables editor and here are the 7 Pixel Watch 4 rumors I’m most curious about

      July 22, 2025

      8 ways I quickly leveled up my Linux skills – and you can too

      July 22, 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

      The Intersection of Agile and Accessibility – A Series on Designing for Everyone

      July 22, 2025
      Recent

      The Intersection of Agile and Accessibility – A Series on Designing for Everyone

      July 22, 2025

      Zero Trust & Cybersecurity Mesh: Your Org’s Survival Guide

      July 22, 2025

      Execute Ping Commands and Get Back Structured Data in PHP

      July 22, 2025
    • Operating Systems
      1. Windows
      2. Linux
      3. macOS
      Featured

      A Tomb Raider composer has been jailed — His legacy overshadowed by $75k+ in loan fraud

      July 22, 2025
      Recent

      A Tomb Raider composer has been jailed — His legacy overshadowed by $75k+ in loan fraud

      July 22, 2025

      “I don’t think I changed his mind” — NVIDIA CEO comments on H20 AI GPU sales resuming in China following a meeting with President Trump

      July 22, 2025

      Galaxy Z Fold 7 review: Six years later — Samsung finally cracks the foldable code

      July 22, 2025
    • Learning Resources
      • Books
      • Cheatsheets
      • Tutorials & Guides
    Home»News & Updates»CodeSOD: Objectifying Yourself

    CodeSOD: Objectifying Yourself

    April 28, 2025

    “Boy, stringly typed data is hard to work with. I wish there were some easier way to work with it!”

    This, presumably, is what Gary‘s predecessor said. Followed by, “Wait, I have an idea!”

    public static Object createValue(String string) {
    	Object value = parseBoolean(string);
    	if (value != null) {
    		return value;
    	}
    
    	value = parseInteger(string);
    	if (value != null) {
    		return value;
    	}
    
    	value = parseDouble(string);
    	if (value != null) {
    		return value;
    	}
    
    	return string;
    }
    

    This takes a string, and then tries to parse it, first into a boolean, failing that into an integer, and failing that into a double. Otherwise, it returns the original string.

    And it returns an object, which means you still get to guess what’s in there even after this. You just get to guess what it returned, and hope you cast it to the correct type. Which means this almost certainly is called like this:

    boolean myBoolField = (Boolean)createValue(someStringContainingABool);
    

    Which makes the whole thing useless, which is fun.

    Gary found this code in a “long since abandoned” project, and I can’t imagine why it ended up getting abandoned.

    [Advertisement]
    Keep all your packages and Docker containers in one place, scan for vulnerabilities, and control who can access different feeds. ProGet installs in minutes and has a powerful free version with a lot of great features that you can upgrade when ready.Learn more.

    Source: Read More 

    Facebook Twitter Reddit Email Copy Link
    Previous ArticleDual Booting CachyOS and Windows
    Next Article CVE-2025-4006 – Youyiio BeyongCms Unrestricted File Upload Vulnerability

    Related Posts

    News & Updates

    The best CRM software with email marketing in 2025: Expert tested and reviewed

    July 22, 2025
    News & Updates

    This multi-port car charger can power 4 gadgets at once – and it’s surprisingly cheap

    July 22, 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

    CVE-2025-43697 – Salesforce OmniStudio DataMapper Permission Preservation Encryption Exposure Vulnerability

    Common Vulnerabilities and Exposures (CVEs)

    CVE-2025-5806 – Jenkins Gatling Plugin Cross-Site Scripting Vulnerability

    Common Vulnerabilities and Exposures (CVEs)

    CVE-2025-36506 – RICOH Streamline NX V3 PC Client File Path Traversal

    Common Vulnerabilities and Exposures (CVEs)

    CVE-2025-3052 – Microsoft UEFI Firmware Arbitrary Write Vulnerability

    Common Vulnerabilities and Exposures (CVEs)

    Highlights

    CVE-2025-6301 – PHPGurukul Notice Board System Cross-Site Scripting Vulnerability

    June 20, 2025

    CVE ID : CVE-2025-6301

    Published : June 20, 2025, 3:15 a.m. | 3 hours, 26 minutes ago

    Description : A vulnerability, which was classified as problematic, has been found in PHPGurukul Notice Board System 1.0. This issue affects some unknown processing of the file /admin/manage-notices.php of the component Add Notice. The manipulation of the argument Title/Description leads to cross site scripting. The attack may be initiated remotely. The exploit has been disclosed to the public and may be used.

    Severity: 2.4 | LOW

    Visit the link for more details, such as CVSS details, affected products, timeline, and more…

    Microsoft Open-Sources Windows Subsystem for Linux

    May 19, 2025

    CVE-2025-36016 – IBM Process Mining Open Redirect Phishing Vulnerability

    June 21, 2025

    CVE-2025-4662 – Brocade SANnav Plaintext Passphrase Disclosure

    July 10, 2025
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

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