Different types of media get treated differently by courts. If you repaint a painting 1:1 then you are liable to copyright. If you make a song that is too substantially similar you are liable to penalties. If your branding is too similar to the Oscar’s or Starbucks you are liable for infringement.
On the other hand if you reimplement Java the courts have decided that’s OK.
Different media are treated differently. A game and an OS kernel have different attributes in reality (even if technically they are both bundles of code - courts don’t always decide things on technical literalism, they often apply the spirit of the law, understanding if the application meets the original intent and precedents).