Example usage for java.lang String hashCode

List of usage examples for java.lang String hashCode

Introduction

In this page you can find the example usage for java.lang String hashCode.

Prototype

public int hashCode() 

Source Link

Document

Returns a hash code for this string.

Usage

From source file:cms.service.app.InstallLicense.java

public void installLicenseKey(String company, String serverip, String licensekey, String custauthcode,
        String dbtype) {/*from   www  . j ava  2 s . com*/
    String[] licensetoken = tu.getString2TokenArray(licensekey, licseperator);
    String[] authcodelist = tu.getString2TokenArray(authcode, "-");
    String liccountkey = "";
    String vliddayskey = "";
    String wbskey = "";
    String sql = "";
    logger.info("\n Installing License Key!");

    String serverhashFromIP = String.valueOf(serverip.hashCode()); //hashcode generated from sever ip address at runtime
    //serverhashFromIP=Integer.parseInt(serverhashFromIP);
    //logger.info("\n serverhashFromIP="+serverhashFromIP);
    if (licensetoken.length == 5 && authcodelist.length == 5) {
        //company hask key from license
        companyhashkey = tu.getString2TokenArray(licensetoken[0], authsepertor)[1].equals(auth1)
                ? tu.getString2TokenArray(licensetoken[0], authsepertor)[0]
                : "";
        //logger.info("\n Icompanyhashkey="+companyhashkey);
        //server hask key from license
        serverhashkey = tu.getString2TokenArray(licensetoken[1], authsepertor)[1].equals(auth2)
                ? tu.getString2TokenArray(licensetoken[1], authsepertor)[0]
                : "";
        //logger.info("\n serverhashkey="+serverhashkey);
        //server license count from license
        liccountkey = tu.getString2TokenArray(licensetoken[2], authsepertor)[1].equals(auth3)
                ? tu.getString2TokenArray(licensetoken[2], authsepertor)[0]
                : "";
        //logger.info("\n liccountkey="+liccountkey);
        vliddayskey = tu.getString2TokenArray(licensetoken[3], authsepertor)[1].equals(auth4)
                ? tu.getString2TokenArray(licensetoken[3], authsepertor)[0]
                : "";
        //logger.info("\n vliddayskey="+vliddayskey);
        wbskey = tu.getString2TokenArray(licensetoken[4], authsepertor)[1].equals(auth5)
                ? tu.getString2TokenArray(licensetoken[4], authsepertor)[0]
                : "";
        //logger.info("\n wbskey="+wbskey);
    }
    //server hashcode generated from server ip should match the generated hashcode from license key by serverhashFromIP.equals(serverhashkey)
    verifycustAuthCode = (!companyhashkey.equals("") && !serverhashkey.equals("")
            && serverhashFromIP.equals(serverhashkey)
                    ? getStringKeyValue(Integer.parseInt(companyhashkey)) + "-"
                            + getStringKeyValue(Integer.parseInt(serverhashkey))
                    : "");
    //logger.info("\n verifycustAuthCode="+verifycustAuthCode);
    if (verifycustAuthCode.equals(custauthcode) && !liccountkey.equals("") && !vliddayskey.equals("")) {
        liccount = getCountFromKeyValue(liccountkey);
        licvaliddays = getCountFromKeyValue(vliddayskey);
        wbsno = getCountFromKeyValue(wbskey);
        String vsql = "select *from table_installlicense where  LicenseCount>0 and ServerIp='" + serverip
                + "' and ExpiryDate>" + (dbtype.equalsIgnoreCase("oracle") ? "sysdate" : "getdate()");
        TemplateTable result = tu.getResultSet(vsql);
        if (result.getRowCount() > 0
                && !result.getFieldValue("LicenseKey", result.getRowCount() - 1).equalsIgnoreCase(liccountkey)
                && liccount > 0) {
            sql = "update table_installlicense set LicenseKey='" + licensekey + "', LicCountKey='" + liccountkey
                    + "',LicenseCount=" + liccount + ",ExpiryKey='" + vliddayskey + "',ExpiryDate=" + "gendate+"
                    + licvaliddays + ",WbsKey='" + wbskey + "',wbsno=" + wbsno + " where objid='"
                    + result.getFieldValue("objid", result.getRowCount() - 1) + "'";
            tu.executeQuery(sql);
        } else if (result.getRowCount() == 0) {
            String objid = key.getPrimaryKey();
            //String objid=key.getPrimaryKey("table_installlicense","objid",company);
            sql = "insert into table_installlicense(objid,name,serverip,LicenseKey,LicCountKey,LicenseCount,ExpiryKey,ExpiryDate,WbsKey,WbsNo,GenUser,GenDate,Moduser,ModDate)values("
                    + objid + ",'" + company + "','" + serverip + "','" + licensekey + "','" + liccountkey
                    + "'," + liccount + ",'" + vliddayskey + "',"
                    + (dbtype.equalsIgnoreCase("oracle") ? "sysdate+" + licvaliddays
                            : "getdate()+" + licvaliddays)
                    + ",'" + wbskey + "'," + wbsno + ",'sa',"
                    + (dbtype.equalsIgnoreCase("oracle") ? "sysdate" : "getdate()") + ",'sa',"
                    + (dbtype.equalsIgnoreCase("oracle") ? "sysdate)" : "getdate())");
            tu.executeQuery(sql);
        }

        //Install Module licenses
        String mvsql = "select distinct objid, name from table_module";
        //for every startup of the webserver reinstll the module license to avoide the user interaction if anybody change the license informtion
        String msql = "delete table_modulelicense";
        tu.executeQuery(msql);
        result = new TemplateTable();
        result = tu.getResultSet(mvsql);
        if (result.getRowCount() > 0) {
            for (int k = 0; k < result.getRowCount(); k++) {
                String objid = key.getPrimaryKey();
                String name = result.getFieldValue("name", k);
                String moduleid = result.getFieldValue("objid", k);
                sql = "insert into table_modulelicense(objid,name,MODULEKEY,LICENSECOUNT,MODULEID,ORIGINID,DESTINITIONID,GENUSER,GENDATE,MODUSER,MODDATE)values("
                        + objid + ",'" + name + "','" + getStringKeyValue(getLicenseCount(name)) + "',"
                        + getLicenseCount(name) + ",'" + moduleid + "'," + objid + ",'" + moduleid + "','sa',"
                        + (dbtype.equalsIgnoreCase("oracle") ? "sysdate" : "getdate()") + ",'sa',"
                        + (dbtype.equalsIgnoreCase("oracle") ? "sysdate)" : "getdate())");
                tu.executeQuery(sql);
            }
        }

        //Install Privilege Group Licesne
        //Install Module licenses
        String pvsql = "select *from table_privilegegroup";
        //for every startup of the webserver reinstall the module license to avoid the user interaction if anybody change the license information
        String gsql = "delete table_grouplicense";
        tu.executeQuery(gsql);
        result = new TemplateTable();
        result = tu.getResultSet(pvsql);
        String groupid = "";
        if (result.getRowCount() > 0) {
            for (int k = 0; k < result.getRowCount(); k++) {
                String objid = key.getPrimaryKey();

                String name = result.getFieldValue("name", k);
                groupid = result.getFieldValue("objid", k);
                //First get the license count
                String glsql = "select nvl(sum(ms.licensecount),0) count from table_privilegegroup pg,table_module md, table_modulelicense ms  where pg.objid='"
                        + groupid + "' and pg.objid=md.module2privilegegroup and md.objid=ms.moduleid";
                TemplateTable respv = tu.getResultSet(glsql);
                String groupliccount = "0";
                if (respv.getRowCount() > 0)
                    groupliccount = respv.getFieldValue("count", respv.getRowCount() - 1);

                //insert the group license record
                sql = "insert into table_grouplicense(objid,name,GROUPKEY,LICENSECOUNT,GROUPID,ORIGINID,DESTINITIONID,GENUSER,GENDATE,MODUSER,MODDATE)values("
                        + objid + ",'" + name + "','" + getStringKeyValue(Integer.parseInt(groupliccount))
                        + "'," + groupliccount + "," + groupid + "," + objid + ",'" + groupid + ",'sa',"
                        + (dbtype.equalsIgnoreCase("oracle") ? "sysdate" : "getdate()") + "','sa',"
                        + (dbtype.equalsIgnoreCase("oracle") ? "sysdate)" : "getdate())");
                tu.executeQuery(sql);

                //update user license table for all users ssociated to the group having same license count as group
                String ussql = "update Table_UserLicense set licensekey='"
                        + getStringKeyValue(Integer.parseInt(groupliccount)) + "',LICENSECOUNT=" + groupliccount
                        + " where groupid=" + groupid;
                tu.executeQuery(ussql);

            }
        }
        //update entity license count
        String esql = "update table_company e set e.licensecount=" + liccount
                + ",e.licenseused=(select sum(ul.licensecount) "
                + " from Table_TestUser u, Table_UserLicense ul where u.testuser2company=e.objid and ul.destinitionid=u.objid)";
        tu.executeQuery(esql);
    }
}

From source file:jp.ac.u.tokyo.m.pig.udf.eval.group.InnerGroup.java

private void init(String aGroupFilterFormatString) {
    mGroupFilterFormat = StockGroupFilterFormatFactory.INSTANCE
            .generateGroupFilterFormat(aGroupFilterFormatString);
    // Schema information transfer | 
    Properties tProperties = UDFContext.getUDFContext().getUDFProperties(this.getClass());
    StringBuilder tKeyBuilder = new StringBuilder();
    tKeyBuilder.append(this.getClass().getName());
    tKeyBuilder.append(".");
    tKeyBuilder.append(aGroupFilterFormatString.hashCode());
    tKeyBuilder.append(".");
    String tKeyPrefix = tKeyBuilder.toString();
    String tKeyOriginalColumnNum = mKeyOriginalColumnNum = tKeyPrefix + "colums";
    mOriginalColumnNum = Integer.parseInt(tProperties.getProperty(tKeyOriginalColumnNum, "0"));
    String tKeyJoinedValueBagIndexes = mKeyJoinedValueBagIndexes = tKeyPrefix + "joined-value-bag-indexes";
    String tKeyJoinedValueBagSizes = mKeyJoinedValueBagSizes = tKeyPrefix + "joined-value-bag-sizes";
    String[] tJoinedValueBagIndexesString = tProperties.getProperty(tKeyJoinedValueBagIndexes, "")
            .split(FormatConstants.WORD_SEPARATOR);
    if (tJoinedValueBagIndexesString[0] != "") {
        int tJoinedValueBagIndexesLength = tJoinedValueBagIndexesString.length;
        int[] tJoinedValueBagIndexes = mJoinedValueBagIndexes = new int[tJoinedValueBagIndexesLength];
        for (int tIndex = tJoinedValueBagIndexesLength - 1; tIndex >= 0; tIndex--) {
            tJoinedValueBagIndexes[tIndex] = Integer.parseInt(tJoinedValueBagIndexesString[tIndex]);
        }//from   w  w  w .j a v  a 2 s.  c o  m
    }
    String[] tJoinedValueBagSizesString = tProperties.getProperty(tKeyJoinedValueBagSizes, "")
            .split(FormatConstants.WORD_SEPARATOR);
    if (tJoinedValueBagSizesString[0] != "") {
        int tJoinedValueBagSizesLength = tJoinedValueBagSizesString.length;
        int[] tJoinedValueBagSizes = mJoinedValueBagSizes = new int[tJoinedValueBagSizesLength];
        for (int tIndex = tJoinedValueBagSizesLength - 1; tIndex >= 0; tIndex--) {
            tJoinedValueBagSizes[tIndex] = Integer.parseInt(tJoinedValueBagSizesString[tIndex]);
        }
    }
}

From source file:mvm.rya.indexing.accumulo.freetext.AccumuloFreeTextIndexer.java

private void deleteStatement(Statement statement) throws IOException {
    // if the predicate list is empty, accept all predicates.
    // Otherwise, make sure the predicate is on the "valid" list
    boolean isValidPredicate = validPredicates.isEmpty() || validPredicates.contains(statement.getPredicate());

    if (isValidPredicate && (statement.getObject() instanceof Literal)) {

        // Get the tokens
        String text = statement.getObject().stringValue().toLowerCase();
        SortedSet<String> tokens = tokenizer.tokenize(text);

        if (!tokens.isEmpty()) {
            // Get Document Data
            String docContent = StatementSerializer.writeStatement(statement);

            String docId = Md5Hash.md5Base64(docContent);

            // Setup partition
            Text partition = genPartition(docContent.hashCode(), docTableNumPartitions);

            Mutation docTableMut = new Mutation(partition);
            List<Mutation> termTableMutations = new ArrayList<Mutation>();

            Text docIdText = new Text(docId);

            // Delete the Document Data
            docTableMut.putDelete(ColumnPrefixes.DOCS_CF_PREFIX, docIdText);

            // Delete the statement parts in index
            docTableMut.putDelete(ColumnPrefixes.getSubjColFam(statement), docIdText);
            docTableMut.putDelete(ColumnPrefixes.getPredColFam(statement), docIdText);
            docTableMut.putDelete(ColumnPrefixes.getObjColFam(statement), docIdText);
            docTableMut.putDelete(ColumnPrefixes.getContextColFam(statement), docIdText);

            // Delete the statement terms in index
            for (String token : tokens) {
                if (IS_TERM_TABLE_TOKEN_DELETION_ENABLED) {
                    int rowId = Integer.parseInt(partition.toString());
                    boolean doesTermExistInOtherDocs = doesTermExistInOtherDocs(token, rowId, docIdText);
                    // Only delete the term from the term table if it doesn't appear in other docs
                    if (!doesTermExistInOtherDocs) {
                        // Delete the term in the term table
                        termTableMutations
                                .add(createEmptyPutDeleteMutation(ColumnPrefixes.getTermListColFam(token)));
                        termTableMutations
                                .add(createEmptyPutDeleteMutation(ColumnPrefixes.getRevTermListColFam(token)));
                    }/* w w w.j  a  v a  2  s. c  o  m*/
                }

                // Un-tie the token to the document
                docTableMut.putDelete(ColumnPrefixes.getTermColFam(token), docIdText);
            }

            // write the mutations
            try {
                docTableBw.addMutation(docTableMut);
                termTableBw.addMutations(termTableMutations);
            } catch (MutationsRejectedException e) {
                logger.error("error adding mutation", e);
                throw new IOException(e);
            }

        }
    }
}

From source file:com.opendoorlogistics.core.scripts.formulae.FmLookupNearest.java

/**
 * Get in the coord system, caching when possible
 * /*from  w w  w  .  java  2 s .c  o  m*/
 * @param geom
 * @return
 */
private CachedProcessedGeom toCoordSystem(ODLGeomImpl geom) {
    RecentlyUsedCache cache = ApplicationCache.singleton()
            .get(ApplicationCache.LOOKUP_NEAREST_TRANSFORMED_GEOMS);

    class CacheKey {
        final String espg;
        final ODLGeom geom;

        private CacheKey(String espg, ODLGeom geom) {
            super();
            this.espg = espg;
            this.geom = geom;
        }

        @Override
        public int hashCode() {
            final int prime = 31;
            int result = 1;
            result = prime * result + ((espg == null) ? 0 : espg.hashCode());
            result = prime * result + ((geom == null) ? 0 : geom.hashCode());
            return result;
        }

        @Override
        public boolean equals(Object obj) {
            if (this == obj)
                return true;
            if (obj == null)
                return false;
            if (getClass() != obj.getClass())
                return false;
            CacheKey other = (CacheKey) obj;
            if (espg == null) {
                if (other.espg != null)
                    return false;
            } else if (!espg.equals(other.espg))
                return false;
            if (geom == null) {
                if (other.geom != null)
                    return false;
            } else if (!geom.equals(other.geom))
                return false;
            return true;
        }

    }

    CacheKey key = new CacheKey(espg_srid, geom);

    CachedProcessedGeom cached = (CachedProcessedGeom) cache.get(key);
    if (cached != null) {
        return cached;
    }

    try {
        Geometry wgs84 = geom.getJTSGeometry();
        if (wgs84 == null) {
            return null;
        }

        cached = new CachedProcessedGeom(JTS.transform(wgs84, transform));
        cache.put(key, cached, cached.getSizeInBytes());

        return cached;
    } catch (Throwable e) {
        // return value will be null, so error reported later
    }

    return null;
}

From source file:com.datatorrent.lib.io.fs.AbstractFSWriter.java

/**
 * This method processes received tuples.
 * Tuples are written out to the appropriate files as determined by the getFileName method.
 * If the output port is connected incoming tuples are also converted and emitted on the appropriate output port.
 * @param tuple An incoming tuple which needs to be processed.
 *//*from w ww.  jav a  2 s .  co m*/
protected void processTuple(INPUT tuple) {
    String fileName = getFileName(tuple);

    if (Strings.isNullOrEmpty(fileName)) {
        return;
    }

    LOG.debug("file {}, hash {}, filecount {}", fileName, fileName.hashCode(), this.openPart.get(fileName));

    try {
        LOG.debug("end-offsets {}", endOffsets);

        FSDataOutputStream fsOutput = streamsCache.get(fileName);
        byte[] tupleBytes = getBytesForTuple(tuple);
        fsOutput.write(tupleBytes);
        totalBytesWritten += tupleBytes.length;
        MutableLong currentOffset = endOffsets.get(fileName);

        if (currentOffset == null) {
            currentOffset = new MutableLong(0);
            endOffsets.put(fileName, currentOffset);
        }

        currentOffset.add(tupleBytes.length);

        LOG.debug("end-offsets {}", endOffsets);
        LOG.debug("tuple: {}", tuple.toString());
        LOG.debug("current position {}, max length {}", currentOffset.longValue(), maxLength);

        if (rollingFile && currentOffset.longValue() > maxLength) {
            LOG.debug("Rotating file {} {}", fileName, currentOffset.longValue());
            rotate(fileName);
        }

        MutableLong count = counts.get(fileName);
        if (count == null) {
            count = new MutableLong(0);
            counts.put(fileName, count);
        }

        count.add(1);

        LOG.debug("count of {} =  {}", fileName, count);
    } catch (IOException ex) {
        throw new RuntimeException(ex);
    } catch (ExecutionException ex) {
        throw new RuntimeException(ex);
    }

    if (output.isConnected()) {
        output.emit(convert(tuple));
    }
}

From source file:com.cisco.oss.foundation.message.HornetQMessageProducer.java

private ClientProducer getProducer(String groupIdentifier) {
    try {// w ww  .  j a  va  2s. c  o  m
        if (producer.get() == null) {
            String realQueueName = createQueueIfNeeded();
            List<ClientProducer> producers = new ArrayList<>();
            for (Pair<ClientSession, SessionFailureListener> clientSession : HornetQMessagingFactory
                    .getSession()) {
                ClientProducer clientProducer = clientSession.getLeft().createProducer(realQueueName);
                producersSet.add(clientProducer);
                producers.add(clientProducer);
            }
            producer.set(producers);
        }

        ClientProducer clientProducer = null;
        if (groupIdentifier != null) {
            clientProducer = producer.get().get(groupIdentifier.hashCode() % producer.get().size());
        } else {
            clientProducer = producer.get().get(nextNode(producer.get().size()));
        }
        return clientProducer;

    } catch (Exception e) {
        LOGGER.error("can't create queue producer: {}", e, e);
        throw new QueueException(e);
    }
}

From source file:com.layer.atlas.messenger.AtlasMessagesScreen.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    this.uiHandler = new Handler();
    this.app = (MessengerApp) getApplication();

    setContentView(R.layout.atlas_screen_messages);

    boolean convIsNew = getIntent().getBooleanExtra(EXTRA_CONVERSATION_IS_NEW, false);
    String convUri = getIntent().getStringExtra(EXTRA_CONVERSATION_URI);
    if (convUri != null) {
        Uri uri = Uri.parse(convUri);//from   w  ww. ja v  a 2 s  . c  o  m
        conv = app.getLayerClient().getConversation(uri);
        ((NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE)).cancel(convUri.hashCode()); // Clear notifications for this Conversation
    }

    participantsPicker = (AtlasParticipantPicker) findViewById(R.id.atlas_screen_messages_participants_picker);
    participantsPicker.init(new String[] { app.getLayerClient().getAuthenticatedUserId() },
            app.getParticipantProvider());
    if (convIsNew) {
        participantsPicker.setVisibility(View.VISIBLE);
    }

    messageComposer = (AtlasMessageComposer) findViewById(R.id.atlas_screen_messages_message_composer);
    messageComposer.init(app.getLayerClient(), conv);
    messageComposer.setListener(new AtlasMessageComposer.Listener() {
        public boolean beforeSend(Message message) {
            boolean conversationReady = ensureConversationReady();
            if (!conversationReady)
                return false;

            // push
            preparePushMetadata(message);
            return true;
        }

    });

    messageComposer.registerMenuItem("Photo", new OnClickListener() {
        public void onClick(View v) {
            if (!ensureConversationReady())
                return;

            Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
            String fileName = "cameraOutput" + System.currentTimeMillis() + ".jpg";
            photoFile = new File(getExternalFilesDir(android.os.Environment.DIRECTORY_PICTURES), fileName);
            final Uri outputUri = Uri.fromFile(photoFile);
            cameraIntent.putExtra(MediaStore.EXTRA_OUTPUT, outputUri);
            if (debug)
                Log.w(TAG, "onClick() requesting photo to file: " + fileName + ", uri: " + outputUri);
            startActivityForResult(cameraIntent, REQUEST_CODE_CAMERA);
        }
    });

    messageComposer.registerMenuItem("Image", new OnClickListener() {
        public void onClick(View v) {
            if (!ensureConversationReady())
                return;

            // in onCreate or any event where your want the user to select a file
            Intent intent = new Intent();
            intent.setType("image/*");
            intent.setAction(Intent.ACTION_GET_CONTENT);
            startActivityForResult(Intent.createChooser(intent, "Select Picture"), REQUEST_CODE_GALLERY);
        }
    });

    messageComposer.registerMenuItem("Location", new OnClickListener() {
        public void onClick(View v) {
            if (!ensureConversationReady())
                return;

            if (lastKnownLocation == null) {
                Toast.makeText(v.getContext(), "Inserting Location: Location is unknown yet",
                        Toast.LENGTH_SHORT).show();
                return;
            }
            String locationString = "{\"lat\":" + lastKnownLocation.getLatitude() + ", \"lon\":"
                    + lastKnownLocation.getLongitude() + "}";
            MessagePart part = app.getLayerClient().newMessagePart(Atlas.MIME_TYPE_ATLAS_LOCATION,
                    locationString.getBytes());
            Message message = app.getLayerClient().newMessage(Arrays.asList(part));

            preparePushMetadata(message);
            conv.send(message);

            if (debug)
                Log.w(TAG, "onSendLocation() loc:  " + locationString);
        }
    });

    messagesList = (AtlasMessagesList) findViewById(R.id.atlas_screen_messages_messages_list);
    messagesList.init(app.getLayerClient(), app.getParticipantProvider());
    if (USE_QUERY) {
        Query<Message> query = Query.builder(Message.class)
                .predicate(new Predicate(Message.Property.CONVERSATION, Predicate.Operator.EQUAL_TO, conv))
                .sortDescriptor(new SortDescriptor(Message.Property.POSITION, SortDescriptor.Order.ASCENDING))
                .build();
        messagesList.setQuery(query);
    } else {
        messagesList.setConversation(conv);
    }

    messagesList.setItemClickListener(new ItemClickListener() {
        public void onItemClick(Cell cell) {
            if (Atlas.MIME_TYPE_ATLAS_LOCATION.equals(cell.messagePart.getMimeType())) {
                String jsonLonLat = new String(cell.messagePart.getData());
                JSONObject json;
                try {
                    json = new JSONObject(jsonLonLat);
                    double lon = json.getDouble("lon");
                    double lat = json.getDouble("lat");
                    Intent openMapIntent = new Intent(Intent.ACTION_VIEW);
                    String uriString = String.format(Locale.ENGLISH, "geo:%f,%f?z=%d&q=%f,%f", lat, lon, 18,
                            lat, lon);
                    final Uri geoUri = Uri.parse(uriString);
                    openMapIntent.setData(geoUri);
                    if (openMapIntent.resolveActivity(getPackageManager()) != null) {
                        startActivity(openMapIntent);
                        if (debug)
                            Log.w(TAG, "onItemClick() starting Map: " + uriString);
                    } else {
                        if (debug)
                            Log.w(TAG, "onItemClick() No Activity to start Map: " + geoUri);
                    }
                } catch (JSONException ignored) {
                }
            } else if (cell instanceof ImageCell) {
                Intent intent = new Intent(AtlasMessagesScreen.this.getApplicationContext(),
                        AtlasImageViewScreen.class);
                app.setParam(intent, cell);
                startActivity(intent);
            }
        }
    });

    typingIndicator = (AtlasTypingIndicator) findViewById(R.id.atlas_screen_messages_typing_indicator);
    typingIndicator.init(conv,
            new AtlasTypingIndicator.DefaultTypingIndicatorCallback(app.getParticipantProvider()));

    // location manager for inserting locations:
    this.locationManager = (LocationManager) getSystemService(LOCATION_SERVICE);

    prepareActionBar();
}

From source file:com.microsoft.tfs.core.clients.versioncontrol.soapextensions.GetOperation.java

@Override
public synchronized int hashCode() {
    int c = getItemID();

    final String targetServerItem = getTargetServerItem();
    if (!StringUtil.isNullOrEmpty(targetServerItem)) {
        c = c << 7 | targetServerItem.hashCode();
    }/*from   ww w.  ja  va  2 s. c  o  m*/

    return c;
}

From source file:com.at.lic.LicenseControl.java

private String getLicenseCheckCode() {
    String os_arch = getSysProp("os.arch"); // x86
    String os_name = getSysProp("os.name"); // Windows XP
    String os_version = getSysProp("os.version"); // 5.1
    String sun_arch_data_model = getSysProp("sun.arch.data.model"); // 32
    String user_language = getSysProp("user.language"); // zh
    String sun_cpu_isalist = getSysProp("sun.cpu.isalist"); // pentium_pro +
    // mmx/*from  w  w w .ja  va2s.  com*/
    // pentium_pro
    // pentium+mmx
    // pentium i486
    // i386 i86

    String mac = null;
    InetAddress addr = null;

    try {
        mac = getMAC();
        addr = InetAddress.getLocalHost();
    } catch (Exception e) {
        log.error("Getting information from ethernet card failed.", e);
        die();
    }

    StringBuilder sb = new StringBuilder();
    sb.append(os_arch.hashCode());
    sb.append(os_name.hashCode());
    sb.append(os_version.hashCode());
    sb.append(sun_arch_data_model.hashCode());
    sb.append(user_language.hashCode());
    sb.append(sun_cpu_isalist.hashCode());
    sb.append(mac.hashCode());
    sb.append(addr.hashCode());

    int licCheckCode = sb.toString().hashCode();

    return String.valueOf(licCheckCode);
}

From source file:com.opengamma.integration.timeseries.snapshot.CronTriggerComponentFactory.java

@Override
protected Object propertyGet(String propertyName, boolean quiet) {
    switch (propertyName.hashCode()) {
    case -281470431: // classifier
        return getClassifier();
    case -1438096408: // jobName
        return getJobName();
    case -1637271358: // jobGroup
        return getJobGroup();
    case 3373707: // name
        return getName();
    case -348729402: // cronExpression
        return getCronExpression();
    case 836243736: // schemeBlackList
        return getSchemeBlackList();
    case 1058119597: // dataFieldBlackList
        return getDataFieldBlackList();
    case 1272470629: // dataSource
        return getDataSource();
    case 650692196: // normalizationRuleSetId
        return getNormalizationRuleSetId();
    case 951232793: // observationTime
        return getObservationTime();
    case -747889643: // globalPrefix
        return getGlobalPrefix();
    case -1707859415: // htsMaster
        return getHtsMaster();
    case -745461486: // redisConnector
        return getRedisConnector();
    case -332642308: // baseDir
        return getBaseDir();
    case -160710469: // scheduler
        return getScheduler();
    }/*from w  w  w .  j  av  a  2 s.  c om*/
    return super.propertyGet(propertyName, quiet);
}