What is the purpose of left shifting zero by any amount?

java

Solution

Indeed they are equivalent but one possible explanation is that they wanted to map the version numbers including both the major and minor numbers to a unique ID in their code. So in the following:

int ASM4 = 4 << 16 | 0 << 8 | 0; // this looks like 4.0.0
int ASM5 = 5 << 16 | 0 << 8 | 0; // this looks list 5.0.0

The `4` and `5` represent versions `4` and `5` respectively, and the `zero` in `0 << 8` could potentially be the minor numbers, and the last `zero` is another minor number, as in `4.0.0` and `5.0.0`. But that's my guess anyway. You'd really have to ask the authors.

Problem

Upon reading the ASM 4.1 source code I've found instances of the following: ``` int ASM4 = 4 << 16 | 0 << 8 | 0; int ASM5 = 5 << 16 | 0 << 8 | 0; ``` Does these left shifts of zero by 8 do anything to the expression, or the 'or' by 0 for that matter? Wouldn't it be equivalent to just have: ``` int ASM4 = 4 << 16; int ASM5 = 5 << 16; ```

Original source