Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6928219
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:09:26+00:00 2026-05-27T11:09:26+00:00

Say I have private void ThisIsMySecurityMethodPleaseLookHERE() { //security stuff } In my program, but

  • 0

Say I have

private void ThisIsMySecurityMethodPleaseLookHERE() {
//security stuff
}

In my program, but that method is called nowhere in any of the actually executed code. Does it get compiled to bytecode? Or does the Java compiler recognize that fact and filter it out? I know it would never make it PAST bytecode, since it is not truly called.

I ask because I know Java is notoriously easy to decompile. would all of my unused methods also be present when they decompile one of my .class files?

I assume that this is not the case, since, were it the case, every java file would have bloat code to hide the real code, and be passed through an obfuscator.

I’m just trying to think of methods other than obfuscation to resist the casual hacker.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T11:09:27+00:00Added an answer on May 27, 2026 at 11:09 am

    Why assume anything? Use javap -c to see what’s in the byte code.

    Given that the compiler can’t know whether the private method might be called by reflection, I’d expect it to still be present, personally.

    I’m not sure what you mean by this:

    I assume that this is not the case, since, were it the case, every java file would have bloat code to hide the real code, and be passed through an obfuscator.

    I would hope that most developers would realise that security through obscurity is little protection at all – but also that the true value of the code itself is usually in the design etc, rather than just the implementation. So no, don’t include sensitive information in your classes – but equally don’t get too paranoid. You need to weigh up the costs of trying to defeat attackers with the cost of them “winning”. That balance will depend on the code involved – and also the kind of attack you’re trying to guard against.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say I have two functions that expect ...rest parameters private function a(...myParams):void { trace(myParams.length);
Let's say I have a method public void Foo(string bar) that the caller should
Say I have a method declaration like: private void someMethod(final String someKey, final Object
Say we have the following method: private MyObject foo = new MyObject(); // and
Let's say I have a class called AppConfig: public static class AppConfig { private
I have a method lets say: private static String drawCellValue( int maxCellLength, String cellValue,
Let's say I have a background worker like this: private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs
Say I have a web service that works with a database. Each method opens
Say I have this code: private void CreateSnapshots(IEnumerable<StreamHead> streams) { foreach (StreamHead head in
let's say we have some simple code like this : private static void Main()

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.