Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When following the example code, the method package.getElemTo not found #42

Closed
bwangel opened this issue Jul 11, 2020 · 1 comment
Closed
Assignees

Comments

@bwangel
Copy link

bwangel commented Jul 11, 2020

https://docs.tigase.net/tigase-server/master-snapshot/Development_Guide/html/#componentdevelpoment

java compiler reports can not found getElemTo(), and also getElemFrom()

public int hashCodeForPacket(Packet packet) {
        if (packet.getElemTo() != null) {
            return packet.getElemTo().hashCode();
        }
        // This should not happen, every packet must have a destination
        // address, but maybe our SPAM checker is used for checking
        // strange kind of packets too....
        if (packet.getElemFrom() != null) {
            return packet.getElemFrom().hashCode();
        }
        // If this really happens on your system you should look carefully
        // at packets arriving to your component and decide a better way
        // to calculate hashCode
        return 1;
    }
@woj-tek woj-tek self-assigned this Jul 13, 2020
@woj-tek
Copy link
Contributor

woj-tek commented Jul 13, 2020

Thank you for mentioning it - the method was deprecated and you should use .getStanzaFrom() method. (fixed: 6bf8adc)

@woj-tek woj-tek closed this as completed Jul 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants