List of usage examples for java.lang InternalError InternalError
public InternalError(Throwable cause)
From source file:org.eclipse.dataset.ByteDataset.java
@SuppressWarnings({ "unchecked" }) @Override//from w w w. jav a 2s .c o m public int[] maxPos(boolean ignoreInvalids) { if (storedValues == null || storedValues.isEmpty()) { calculateMaxMin(ignoreInvalids, ignoreInvalids); } String n = storeName(ignoreInvalids, ignoreInvalids, STORE_MAX_POS); Object o = storedValues.get(n); List<int[]> max = null; if (o == null) { max = findPositions(max(ignoreInvalids).byteValue()); // PRIM_TYPE // max = findPositions(max(false).intValue() != 0); // BOOLEAN_USE // max = findPositions(null); // OBJECT_USE storedValues.put(n, max); } else if (o instanceof List<?>) { max = (List<int[]>) o; } else { throw new InternalError("Inconsistent internal state of stored values for statistics calculation"); } return max.get(0); // first maximum }
From source file:org.eclipse.dataset.ShortDataset.java
@SuppressWarnings({ "unchecked" }) @Override/*from ww w . j a va2s .c om*/ public int[] maxPos(boolean ignoreInvalids) { if (storedValues == null || storedValues.isEmpty()) { calculateMaxMin(ignoreInvalids, ignoreInvalids); } String n = storeName(ignoreInvalids, ignoreInvalids, STORE_MAX_POS); Object o = storedValues.get(n); List<int[]> max = null; if (o == null) { max = findPositions(max(ignoreInvalids).shortValue()); // PRIM_TYPE // max = findPositions(max(false).intValue() != 0); // BOOLEAN_USE // max = findPositions(null); // OBJECT_USE storedValues.put(n, max); } else if (o instanceof List<?>) { max = (List<int[]>) o; } else { throw new InternalError("Inconsistent internal state of stored values for statistics calculation"); } return max.get(0); // first maximum }
From source file:org.eclipse.dataset.IntegerDataset.java
@SuppressWarnings({ "unchecked" }) @Override/*ww w .jav a 2 s. c o m*/ public int[] maxPos(boolean ignoreInvalids) { if (storedValues == null || storedValues.isEmpty()) { calculateMaxMin(ignoreInvalids, ignoreInvalids); } String n = storeName(ignoreInvalids, ignoreInvalids, STORE_MAX_POS); Object o = storedValues.get(n); List<int[]> max = null; if (o == null) { max = findPositions(max(ignoreInvalids).intValue()); // PRIM_TYPE // max = findPositions(max(false).intValue() != 0); // BOOLEAN_USE // max = findPositions(null); // OBJECT_USE storedValues.put(n, max); } else if (o instanceof List<?>) { max = (List<int[]>) o; } else { throw new InternalError("Inconsistent internal state of stored values for statistics calculation"); } return max.get(0); // first maximum }
From source file:com.clustercontrol.jobmanagement.dialog.JobKickDialog.java
/** * ???????/*www . ja va 2 s .c om*/ * */ private void reflectJobFileCheck() { //??? if (this.m_mode == PropertyDefineConstant.MODE_MODIFY || this.m_mode == PropertyDefineConstant.MODE_COPY) { this.m_jobKick = GetJobKick.getJobFileCheck(this.m_managerName, this.m_jobkickId); } else { this.m_jobKick = new JobFileCheck(); } if (this.m_jobKick == null) { throw new InternalError("JobFileCheck is null"); } // ??? reflectJobKick(); // ???? JobKickFileCheckComposite jobKickFileCheckComposite = (JobKickFileCheckComposite) this.m_detailComposite; JobFileCheck jobFileCheck = (JobFileCheck) this.m_jobKick; jobKickFileCheckComposite.setJobFileCheck(this.m_managerName, jobFileCheck.getOwnerRoleId(), jobFileCheck.getFacilityId(), jobFileCheck.getScope(), jobFileCheck.getDirectory(), jobFileCheck.getFileName(), jobFileCheck.getEventType(), jobFileCheck.getModifyType()); }
From source file:org.eclipse.dataset.FloatDataset.java
@SuppressWarnings({ "unchecked" }) @Override//from ww w .j av a 2 s. c om public int[] maxPos(boolean ignoreInvalids) { if (storedValues == null || storedValues.isEmpty()) { calculateMaxMin(ignoreInvalids, ignoreInvalids); } String n = storeName(ignoreInvalids, ignoreInvalids, STORE_MAX_POS); Object o = storedValues.get(n); List<int[]> max = null; if (o == null) { max = findPositions(max(ignoreInvalids).floatValue()); // PRIM_TYPE // max = findPositions(max(false).intValue() != 0); // BOOLEAN_USE // max = findPositions(null); // OBJECT_USE storedValues.put(n, max); } else if (o instanceof List<?>) { max = (List<int[]>) o; } else { throw new InternalError("Inconsistent internal state of stored values for statistics calculation"); } return max.get(0); // first maximum }
From source file:com.clustercontrol.calendar.dialog.CalendarDialog.java
/** * ??????/*from ww w.j a v a 2 s. com*/ * * @param detailList * @throws HinemosUnknown */ private void reflectCalendar() { // ? if (mode == PropertyDefineConstant.MODE_MODIFY || mode == PropertyDefineConstant.MODE_COPY) { // ????? inputData = new GetCalendar().getCalendar(this.m_managerComposite.getText(), this.calendarId); } else { // ??? inputData = new CalendarInfo(); } if (inputData == null) throw new InternalError("CalendarInfo is null"); //? if (inputData.getCalendarId() != null) { this.calendarId = inputData.getCalendarId(); this.calIdText.setText(inputData.getCalendarId()); //???ID??? if (this.mode == PropertyDefineConstant.MODE_MODIFY) { this.calIdText.setEnabled(false); } } if (inputData.getCalendarName() != null) { this.calNameText.setText(inputData.getCalendarName()); } if (inputData.getDescription() != null) { this.calDescription.setText(inputData.getDescription()); } if (inputData.getValidTimeFrom() != null) { SimpleDateFormat sdf = TimezoneUtil.getSimpleDateFormat(); String tmp = sdf.format(inputData.getValidTimeFrom()); this.calTimeFromText.setText(tmp); this.calTimeFrom = inputData.getValidTimeFrom(); } if (inputData.getValidTimeTo() != null) { SimpleDateFormat sdf = TimezoneUtil.getSimpleDateFormat(); String tmp = sdf.format(inputData.getValidTimeTo()); this.calTimeToText.setText(tmp); this.calTimeTo = inputData.getValidTimeTo(); } // ? calDetailComposite.setDetailList((ArrayList<CalendarDetailInfo>) inputData.getCalendarDetailList()); // ID? if (inputData.getOwnerRoleId() != null) { this.calRoleIdListComposite.setText(inputData.getOwnerRoleId()); } ownerRoleId = this.calRoleIdListComposite.getText(); this.calDetailComposite.setOwnerRoleId(this.calRoleIdListComposite.getText()); this.update(); }
From source file:org.projectforge.framework.persistence.database.XmlDump.java
/** * @param o1//from w ww . j a v a2 s .co m * @param o2 * @param logDifference If true than the difference is logged. * @return True if the given objects are equal. */ private boolean equals(final Object o1, final Object o2, final boolean logDifference) { if (o1 == null) { final boolean equals = (o2 == null); if (equals == false && logDifference == true) { log.error("Value 1 is null and value 2 is " + o2); } return equals; } else if (o2 == null) { if (logDifference == true) { log.error("Value 2 is null and value 1 is " + o1); } return false; } final Class<?> cls1 = o1.getClass(); final Field[] fields = cls1.getDeclaredFields(); AccessibleObject.setAccessible(fields, true); for (final Field field : fields) { if (accept(field) == false) { continue; } try { final Object fieldValue1 = getValue(o1, o2, field); final Object fieldValue2 = getValue(o2, o1, field); if (field.getType().isPrimitive() == true) { if (ObjectUtils.equals(fieldValue2, fieldValue1) == false) { if (logDifference == true) { log.error("Field is different: " + field.getName() + "; value 1 '" + fieldValue1 + "' 2 '" + fieldValue2 + "'."); } return false; } continue; } else if (fieldValue1 == null) { if (fieldValue2 != null) { if (fieldValue2 instanceof Collection<?>) { if (CollectionUtils.isEmpty((Collection<?>) fieldValue2) == true) { // null is equals to empty collection in this case. return true; } } if (logDifference == true) { log.error("Field '" + field.getName() + "': value 1 '" + fieldValue1 + "' is different from value 2 '" + fieldValue2 + "'."); } return false; } } else if (fieldValue2 == null) { if (fieldValue1 != null) { if (logDifference == true) { log.error("Field '" + field.getName() + "': value 1 '" + fieldValue1 + "' is different from value 2 '" + fieldValue2 + "'."); } return false; } } else if (fieldValue1 instanceof Collection<?>) { final Collection<?> col1 = (Collection<?>) fieldValue1; final Collection<?> col2 = (Collection<?>) fieldValue2; if (col1.size() != col2.size()) { if (logDifference == true) { log.error("Field '" + field.getName() + "': colection's size '" + col1.size() + "' is different from collection's size '" + col2.size() + "'."); } return false; } if (equals(field, col1, col2, logDifference) == false || equals(field, col2, col1, logDifference) == false) { return false; } } else if (HibernateUtils.isEntity(fieldValue1.getClass()) == true) { if (fieldValue2 == null || ObjectUtils.equals(HibernateUtils.getIdentifier(fieldValue1), HibernateUtils.getIdentifier(fieldValue2)) == false) { if (logDifference == true) { log.error("Field '" + field.getName() + "': Hibernate object id '" + HibernateUtils.getIdentifier(fieldValue1) + "' is different from id '" + HibernateUtils.getIdentifier(fieldValue2) + "'."); } return false; } } else if (fieldValue1 instanceof BigDecimal) { if (fieldValue2 == null || ((BigDecimal) fieldValue1).compareTo((BigDecimal) fieldValue2) != 0) { if (logDifference == true) { log.error("Field '" + field.getName() + "': value 1 '" + fieldValue1 + "' is different from value 2 '" + fieldValue2 + "'."); } return false; } } else if (fieldValue1.getClass().isArray() == true) { if (ArrayUtils.isEquals(fieldValue1, fieldValue2) == false) { if (logDifference == true) { log.error("Field '" + field.getName() + "': value 1 '" + fieldValue1 + "' is different from value 2 '" + fieldValue2 + "'."); } return false; } } else if (ObjectUtils.equals(fieldValue2, fieldValue1) == false) { if (logDifference == true) { log.error("Field '" + field.getName() + "': value 1 '" + fieldValue1 + "' is different from value 2 '" + fieldValue2 + "'."); } return false; } } catch (final IllegalAccessException ex) { throw new InternalError("Unexpected IllegalAccessException: " + ex.getMessage()); } } return true; }
From source file:org.eclipse.dataset.LongDataset.java
@SuppressWarnings({ "unchecked" }) @Override/*from w w w .j av a2 s. c o m*/ public int[] minPos(boolean ignoreInvalids) { if (storedValues == null || storedValues.isEmpty()) { calculateMaxMin(ignoreInvalids, ignoreInvalids); } String n = storeName(ignoreInvalids, ignoreInvalids, STORE_MIN_POS); Object o = storedValues.get(n); List<int[]> min = null; if (o == null) { min = findPositions(min(ignoreInvalids).longValue()); // PRIM_TYPE // min = findPositions(min(false).intValue() != 0); // BOOLEAN_USE // min = findPositions(null); // OBJECT_USE storedValues.put(n, min); } else if (o instanceof List<?>) { min = (List<int[]>) o; } else { throw new InternalError("Inconsistent internal state of stored values for statistics calculation"); } return min.get(0); // first minimum }
From source file:org.eclipse.dataset.ByteDataset.java
@SuppressWarnings({ "unchecked" }) @Override//from ww w .java 2 s. co m public int[] minPos(boolean ignoreInvalids) { if (storedValues == null || storedValues.isEmpty()) { calculateMaxMin(ignoreInvalids, ignoreInvalids); } String n = storeName(ignoreInvalids, ignoreInvalids, STORE_MIN_POS); Object o = storedValues.get(n); List<int[]> min = null; if (o == null) { min = findPositions(min(ignoreInvalids).byteValue()); // PRIM_TYPE // min = findPositions(min(false).intValue() != 0); // BOOLEAN_USE // min = findPositions(null); // OBJECT_USE storedValues.put(n, min); } else if (o instanceof List<?>) { min = (List<int[]>) o; } else { throw new InternalError("Inconsistent internal state of stored values for statistics calculation"); } return min.get(0); // first minimum }
From source file:org.eclipse.dataset.ShortDataset.java
@SuppressWarnings({ "unchecked" }) @Override/* w w w .ja v a2 s . c om*/ public int[] minPos(boolean ignoreInvalids) { if (storedValues == null || storedValues.isEmpty()) { calculateMaxMin(ignoreInvalids, ignoreInvalids); } String n = storeName(ignoreInvalids, ignoreInvalids, STORE_MIN_POS); Object o = storedValues.get(n); List<int[]> min = null; if (o == null) { min = findPositions(min(ignoreInvalids).shortValue()); // PRIM_TYPE // min = findPositions(min(false).intValue() != 0); // BOOLEAN_USE // min = findPositions(null); // OBJECT_USE storedValues.put(n, min); } else if (o instanceof List<?>) { min = (List<int[]>) o; } else { throw new InternalError("Inconsistent internal state of stored values for statistics calculation"); } return min.get(0); // first minimum }