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 5970683
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T20:24:36+00:00 2026-05-22T20:24:36+00:00

The scalac Java parser is taking objection to my Java code imported `Entity’ is

  • 0

The scalac Java parser is taking objection to my Java code

imported `Entity' is permanently hidden by definition of object Entity in package domain    Asset.java

This seems to be a collision between an import and a class with the same name in the package being compiled.

In my package I have a class

package iMP2020.domain;

public interface Entity {
    public Serializable getId();
}

with the same name as an imported class from a different package

package iMP2020.domain;
import javax.persistence.Entity; // compiler warning

@Entity
public class Asset {

where it is complaining about the import. Javac is quite happy. Note that I don’t have to reference my version of the class- just its existence is enough to trigger the warning on the import.

I can fix this by removing the import and explicitly referencing @Entity, but is it a bug in the compiler?

  • 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-22T20:24:37+00:00Added an answer on May 22, 2026 at 8:24 pm

    I don’t seem to be able to reproduce this except with the Scala Eclipse plugin, so I’m going to wait for that to stabilise before coming to a conclusion.

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

Sidebar

Related Questions

For the following code: package FileOperations import java.net.URL object FileOperations { def processWindowsPath(p: String):
Consider the following Scala code: package scala_java object MyScala { def setFunc(func: Int =>
I'm currently looking for a lexer/parser that generates Scala code from a BNF grammar
Can command java run a compiled scala code? If so, why do we have
Possible Duplicate: Scala equivalent of Java java.lang.Class<T> Object Hi all, I can not call
When I execute following code in scala REPL console: java.util.Collections.max(new java.util.ArrayList[String]()) NoSuchMethodError exception is
How do I do the scala equivalent of this java code int[][] vals =
I just read about the java 2 javascript parser and the demo with scala.
I've grabbed some Scala CSV parsing code from here: Use Scala parser combinator to
I have an application where I would like to have mixed Java and Scala

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.