rem
stringlengths 0
477k
| add
stringlengths 0
313k
| context
stringlengths 6
599k
|
---|---|---|
if (iterator == null) { iterator = (new ArrayList(0)).iterator(); } | private void getListOfQueries(IWBundle bundle, IWResourceBundle resourceBundle) { List queryRepresentations = new ArrayList(); Iterator iterator = queryFolder.getChildren(); while (iterator.hasNext()) { ICTreeNode node = (ICTreeNode) iterator.next(); String name = node.getNodeName(); int id = node.getNodeID(); if (showOnlyOneQueryWithId == -1 || id == showOnlyOneQueryWithId) { QueryRepresentation representation = new QueryRepresentation(id, name); queryRepresentations.add(representation); } } Form form = new Form(); EntityBrowser browser = getBrowser(queryRepresentations, bundle, resourceBundle, form); addParametersToBrowser(browser); addParametersToForm(form); if (showOnlyOneQueryWithId != -1) { String newQueryWasCreatedOrModfied = resourceBundle.getLocalizedString("ro_query_was_created_or_modified", "Following query was created or modifed"); Text text = new Text(newQueryWasCreatedOrModfied); text.setBold(); text.setFontColor("#FF0000"); add(text); } Table table = new Table(1,2); table.add(browser, 1,1); table.add(getButtonBar(resourceBundle), 1,2); form.add(table); add(form); } |
|
if (absValue > 1000 || absValue < .001) { | if (absValue < 10 && absValue != 0 ) { | public String getLabel(int i) { if (isLabelTick(i)) { double value = minTick + i * tickInc; double absValue = Math.abs(value); // use regular notation DecimalFormat df; if (absValue > 1000 || absValue < .001) { // exponential notation df = new DecimalFormat("0.00###"); } else { df = new DecimalFormat("#.####"); } return df.format(value); } else { return ""; } } |
public LocalSeismogram apply(LocalSeismogram seis){ if(seismo.can_convert_to_float()){ | public LocalSeismogramImpl apply(LocalSeismogramImpl seis){ if(seis.can_convert_to_float()){ | public LocalSeismogram apply(LocalSeismogram seis){ if(seismo.can_convert_to_float()){ float[] fSeries = seis.get_as_floats(); return new LocalSeismogramImpl(seis, apply(fSeries)); }else{ int[] iSeries = seismo.get_as_longs(); return new LocalSeismogramImpl(seis, apply(iSeries)); } } |
int[] iSeries = seismo.get_as_longs(); | int[] iSeries = seis.get_as_longs(); | public LocalSeismogram apply(LocalSeismogram seis){ if(seismo.can_convert_to_float()){ float[] fSeries = seis.get_as_floats(); return new LocalSeismogramImpl(seis, apply(fSeries)); }else{ int[] iSeries = seismo.get_as_longs(); return new LocalSeismogramImpl(seis, apply(iSeries)); } } |
logger.debug("calling contains(double, double, double, double)"); | public boolean contains(double x, double y, double w, double h){ logger.debug("calling contains(double, double, double, double)"); return false; } |
|
logger.debug("calling getBounds"); return null; } | return null; } | public Rectangle getBounds(){ logger.debug("calling getBounds"); return null; } |
public Rectangle2D getBounds2D(){ logger.debug("calling getBounds2D"); return null; } | public Rectangle2D getBounds2D(){ return null; } | public Rectangle2D getBounds2D(){ logger.debug("calling getBounds2D"); return null; } |
logger.debug("calling getPathIterator(AffineTransform)"); | public PathIterator getPathIterator(AffineTransform at){ logger.debug("calling getPathIterator(AffineTransform)"); return getPathIterator(at, 0); } |
|
logger.debug("calling intersects(double, double, double, double)"); | public boolean intersects(double x, double y, double w, double h){ logger.debug("calling intersects(double, double, double, double)"); return false; } |
|
if(iterator.getPointsPerPixel() <= 1){ | /*if(iterator.getPointsPerPixel() <= 1){ | public void plot(SeismogramShapeIterator iterator){ iterator.setSeisPoints(DisplayUtils.getSeisPoints(dss.getSeismogram(), iterator.getTime())); iterator.setBaseSeisPoint(); iterator.setPointsPerPixel(); if(iterator.getPointsPerPixel() <= 1){ compressPlot(iterator); }else{ iterator.setPoints(new int[2][iterator.getSize().width]); plotPixels(iterator); } currentIterator = iterator; } |
}else{ | }else{*/ | public void plot(SeismogramShapeIterator iterator){ iterator.setSeisPoints(DisplayUtils.getSeisPoints(dss.getSeismogram(), iterator.getTime())); iterator.setBaseSeisPoint(); iterator.setPointsPerPixel(); if(iterator.getPointsPerPixel() <= 1){ compressPlot(iterator); }else{ iterator.setPoints(new int[2][iterator.getSize().width]); plotPixels(iterator); } currentIterator = iterator; } |
} | public void plot(SeismogramShapeIterator iterator){ iterator.setSeisPoints(DisplayUtils.getSeisPoints(dss.getSeismogram(), iterator.getTime())); iterator.setBaseSeisPoint(); iterator.setPointsPerPixel(); if(iterator.getPointsPerPixel() <= 1){ compressPlot(iterator); }else{ iterator.setPoints(new int[2][iterator.getSize().width]); plotPixels(iterator); } currentIterator = iterator; } |
|
this.events = events; | if (events == null) { this.events = new Vector(); } else { this.events = events; } | public FormattedEvents(Collection events, CalendarInfo calInfo, CalTimezones ctz) { this.events = events; this.calInfo = calInfo; this.ctz = ctz; } |
} else if (path.endsWith(".gdo")) { setResourceURL("true"); | public int doStartTag() throws JspException { if (!PortletServlet.isPortletRequest(pageContext.getRequest())) { return super.doStartTag(); } String urlStr = null; BodyContent bodyContent = pageContext.pushBody(); try { super.doStartTag(); URL url = new URL(bodyContent.getString()); String path = url.getPath(); if (path.endsWith(".rdo")) { setRenderURL("true"); } else if (path.endsWith(".do")) { setActionURL("true"); } /* We want a context relative url */ urlStr = url.getFile(); //System.out.println("RRRRRRRRRRRRRRRRRUrlStr = " + urlStr); /* Drop the context */ int pos = urlStr.indexOf('/'); if (pos > 0) { urlStr = urlStr.substring(pos); } urlStr = TagsSupport.getURL(pageContext, urlStr, urlType); /* remove embedded anchor because calendar xsl stylesheet * adds extra parameters later during transformation */ pos = urlStr.indexOf('#'); if (pos > -1) { urlStr = urlStr.substring(0, pos); } /* Remove bedework dummy request parameter - * it's an encoded form of ?b=de */ urlStr = urlStr.replaceAll(bedeworkDummyPar, ""); //Generate valid xml markup for transformationthrow new urlStr = urlStr.replaceAll("&", "&"); //System.out.println("RRRRRRRRRRRRRRRRRUrlStr = " + urlStr); } catch (MalformedURLException mue) { throw new JspException(mue); } finally { pageContext.popBody(); } TagUtils.getInstance().write(pageContext, urlStr); return (SKIP_BODY); } |
|
if(type == FULL.getIntValue()) { | if(type == SCAN.getIntValue()) { return SCAN; } else if(type == FULL.getIntValue()) { | public static RT130FileHandlerFlag fromInt(int type) throws UnsupportedFileTypeException { if(type == FULL.getIntValue()) { return FULL; } else if(type == NO_LOGS.getIntValue()) { return NO_LOGS; } else if(type == POP_DB_WITH_CHANNELS.getIntValue()) { return POP_DB_WITH_CHANNELS; } throw new UnsupportedFileTypeException("" + type); } |
} else if(type == POP_DB_WITH_CHANNELS.getIntValue()) { return POP_DB_WITH_CHANNELS; | } else if(type == MAKE_LOGS.getIntValue()) { return MAKE_LOGS; | public static RT130FileHandlerFlag fromInt(int type) throws UnsupportedFileTypeException { if(type == FULL.getIntValue()) { return FULL; } else if(type == NO_LOGS.getIntValue()) { return NO_LOGS; } else if(type == POP_DB_WITH_CHANNELS.getIntValue()) { return POP_DB_WITH_CHANNELS; } throw new UnsupportedFileTypeException("" + type); } |
if(modeURL.equals(FULL.getURLValue().toString())) { | if(modeURL.equals(SCAN.getURLValue().toString())) { return SCAN; } else if(modeURL.equals(FULL.getURLValue().toString())) { | public static RT130FileHandlerFlag fromString(String modeURL) throws UnsupportedFileTypeException { if(modeURL.equals(FULL.getURLValue().toString())) { return FULL; } else if(modeURL.equals(NO_LOGS.getURLValue().toString())) { return NO_LOGS; } else if(modeURL.equals(POP_DB_WITH_CHANNELS.getURLValue().toString())) { return POP_DB_WITH_CHANNELS; } throw new UnsupportedFileTypeException(modeURL); } |
} else if(modeURL.equals(POP_DB_WITH_CHANNELS.getURLValue().toString())) { return POP_DB_WITH_CHANNELS; | } else if(modeURL.equals(MAKE_LOGS.getURLValue().toString())) { return MAKE_LOGS; | public static RT130FileHandlerFlag fromString(String modeURL) throws UnsupportedFileTypeException { if(modeURL.equals(FULL.getURLValue().toString())) { return FULL; } else if(modeURL.equals(NO_LOGS.getURLValue().toString())) { return NO_LOGS; } else if(modeURL.equals(POP_DB_WITH_CHANNELS.getURLValue().toString())) { return POP_DB_WITH_CHANNELS; } throw new UnsupportedFileTypeException(modeURL); } |
commandHandled = true; if (command[0].toString().equals("SB")) { handleSB(command); } else if (command[0].toString().equals("SV")) { handleSV(command); } else if (command[0].toString().equals("LM")) { handleLM(command); } else if (command[0].toString().equals("GM")) { handleGM(command); } else if (command[0].toString().equals("AT")) { handleAT(command); } else if (command[0].toString().equals("SP")) { handleSP(command); } else if (command[0].toString().equals("SS")) { handleSS(command); } else if (command[0].toString().equals("GT")) { handleGT(command); } else if (command[0].toString().equals("GC")) { handleGC(command); } else if (command[0].toString().equals("GP")) { handleGP(command); } else if (command[0].toString().equals("GD")) { handleGD(command); } else { commandHandled = false; } | Integer commandInt = hashmapCommand.get(command[0].toString()); if (commandInt != null) { commandHandled = true; switch (commandInt) { case COMMAND_AT: handleAT(command); break; case COMMAND_GC: handleGC(command); break; case COMMAND_GD: handleGD(command); break; case COMMAND_GM: handleGM(command); break; case COMMAND_GP: handleGP(command); break; case COMMAND_GT: handleGT(command); break; case COMMAND_LM: handleLM(command); break; case COMMAND_SB: handleSB(command); break; case COMMAND_SP: handleSP(command); break; case COMMAND_SS: handleSS(command); break; case COMMAND_SV: handleSV(command); break; default: commandHandled = false; break; } } else { commandHandled = false; } | protected void processDataRead() { while (true) { Matcher matcher = pattern.matcher(dataRead); if (!matcher.find()) { break; } dataRead = dataRead.substring(matcher.end(), dataRead.length()); Object[] command = Util.commandTextToJava(matcher.group(1)); commandHandled = true; if (command[0].toString().equals("SB")) { handleSB(command); } else if (command[0].toString().equals("SV")) { handleSV(command); } else if (command[0].toString().equals("LM")) { handleLM(command); } else if (command[0].toString().equals("GM")) { handleGM(command); } else if (command[0].toString().equals("AT")) { handleAT(command); } else if (command[0].toString().equals("SP")) { handleSP(command); } else if (command[0].toString().equals("SS")) { handleSS(command); } else if (command[0].toString().equals("GT")) { handleGT(command); } else if (command[0].toString().equals("GC")) { handleGC(command); } else if (command[0].toString().equals("GP")) { handleGP(command); } else if (command[0].toString().equals("GD")) { handleGD(command); } else { commandHandled = false; } if (!commandHandled) { Main.getMainFrame().lobby.append("Unhandled command: " + matcher.group(1)); } } if (gameBoardData.isDirty()) { Main.getMainFrame().gameBoard.sync(gameBoardData); gameBoardData.clean(); } if (scoreSheetCaptionData.isDirty() || scoreSheetBackColorData.isDirty()) { if (scoreSheetCaptionData.isDirty()) { Util.updateNetWorths(scoreSheetCaptionData, gameBoardData); } Main.getMainFrame().scoreSheet.sync(scoreSheetCaptionData, scoreSheetBackColorData); scoreSheetCaptionData.clean(); scoreSheetBackColorData.clean(); } } |
public Vector getCompFilters() { | public Collection getCompFilters() { | public Vector getCompFilters() { if (compFilters == null) { compFilters = new Vector(); } return compFilters; } |
compFilters = new Vector(); | compFilters = new ArrayList(); | public Vector getCompFilters() { if (compFilters == null) { compFilters = new Vector(); } return compFilters; } |
public Vector getPropFilters() { | public Collection getPropFilters() { | public Vector getPropFilters() { if (propFilters == null) { propFilters = new Vector(); } return propFilters; } |
propFilters = new Vector(); | propFilters = new ArrayList(); | public Vector getPropFilters() { if (propFilters == null) { propFilters = new Vector(); } return propFilters; } |
boolean containsOnlyAccessVariable = ( (calculateAccess = identifierValueMap.containsKey(DirectSQLStatement.USER_ACCESS_VARIABLE)) || (calculateAccess = identifierValueMap.containsKey(DirectSQLStatement.GROUP_ACCESS_VARIABLE)) || (calculateAccess = identifierValueMap.containsKey(DirectSQLStatement.USER_GROUP_ACCESS_VARIABLE)) ) && (identifierValueMap.size() == 1); | boolean containsOnlyAccessVariable = containsOnlyAccessVariables(identifierValueMap); | private void showInputFieldsOrExecuteQuery(List executedSQLStatements, IWResourceBundle resourceBundle, IWContext iwc) throws RemoteException { Map identifierValueMap = query.getIdentifierValueMap(); boolean calculateAccess = false; boolean containsOnlyAccessVariable = ( (calculateAccess = identifierValueMap.containsKey(DirectSQLStatement.USER_ACCESS_VARIABLE)) || (calculateAccess = identifierValueMap.containsKey(DirectSQLStatement.GROUP_ACCESS_VARIABLE)) || (calculateAccess = identifierValueMap.containsKey(DirectSQLStatement.USER_GROUP_ACCESS_VARIABLE)) ) && (identifierValueMap.size() == 1); if (! (containsOnlyAccessVariable || iwc.isParameterSet(EXECUTE_QUERY_KEY))) { Map identifierInputDescriptionMap = query.getIdentifierInputDescriptionMap(); showInputFields(query, identifierValueMap, identifierInputDescriptionMap, resourceBundle, iwc); } else { // get the values of the input fields Map modifiedValues = getModifiedIdentiferValueMapByParsingRequest(identifierValueMap, iwc); if (calculateAccess) { setAccessCondition(modifiedValues, iwc); } query.setIdentifierValueMap(modifiedValues); String errorMessage = executeQueries(query, bridge, executedSQLStatements, resourceBundle, iwc); if (errorMessage != null) { if("true".equals(getBundle(iwc).getProperty(ADD_QUERY_SQL_FOR_DEBUG,"false"))){ addExecutedSQLQueries(executedSQLStatements); } addErrorMessage(errorMessage); if (! containsOnlyAccessVariable) { Map identifierInputDescriptionMap = query.getIdentifierInputDescriptionMap(); showInputFields(query, identifierValueMap, identifierInputDescriptionMap, resourceBundle, iwc); } } } } |
userAuth.initialise(user, getUserAuthCallBack(), par); | userAuth.initialise(user, getUserAuthCallBack(), par, debug); | public UserAuth getUserAuth(String user, Object par) throws CalFacadeException { if (userAuth != null) { //userAuth.reinitialise(getUserAuthCallBack()); return userAuth; } try { userAuth = (UserAuth)CalFacadeUtil.getObject(getSyspars().getUserauthClass(), UserAuth.class); } catch (Throwable t) { throw new CalFacadeException(t); } userAuth.initialise(user, getUserAuthCallBack(), par); return userAuth; } |
private BwOrganizer makeOrganizer(String uri) { BwOrganizer org = new BwOrganizer(CalFacadeDefs.unsavedItemKey, | private BwOrganizer makeOrganizer(String uri, BwUser owner) { BwOrganizer org = new BwOrganizer(owner, false, | private BwOrganizer makeOrganizer(String uri) { BwOrganizer org = new BwOrganizer(CalFacadeDefs.unsavedItemKey, null, // cn null, // dir null, // language "[email protected]", uri); return org; } |
ev.setOrganizer(makeOrganizer(orguri1)); | ev.setOrganizer(makeOrganizer(orguri1, ev.getOwner())); | public void testCalSvcEvents() { try { svciUtil.open(privateUser1); /* Add an organizer to our event as private user 1 */ ev = getEvent(key, privateUser1); // clone it to see what happens if (ev instanceof BwEventObj) { ((BwEventObj)ev).clone(); } ev.setOrganizer(makeOrganizer(orguri1)); svciUtil.getSvci(privateUser1).updateEvent(ev); svciUtil.close(privateUser1); /* Open as private user 2 and ensure we cannot see the event */ svciUtil.open(privateUser2); checkMissingEvent(key, privateUser2); svciUtil.close(privateUser2); /* Refetch, check out organizer and then update it. */ svciUtil.open(privateUser1); ev = getEvent(key, privateUser1); BwOrganizer org = ev.getOrganizer(); assertNotNull("Expecting an organizer object", org); assertEquals("Checking uri is correct", orguri1, org.getOrganizerUri()); org.setOrganizerUri(orguri2); svciUtil.getSvci(privateUser1).updateEvent(ev); svciUtil.close(privateUser1); /* Refetch, and see if update stuck. */ svciUtil.open(privateUser1); ev = getEvent(key, privateUser1); org = ev.getOrganizer(); assertNotNull("Expecting an updated organizer object", org); assertEquals("Expecting organizer object update to have stuck", orguri2, org.getOrganizerUri()); // clone it to see what happens if (ev instanceof BwEventObj) { ((BwEventObj)ev).clone(); } svciUtil.close(privateUser1); /* Refetch - check we have the organizer, set it to null and update. close, refetch and ensure it's gone. */ svciUtil.open(privateUser1); ev = getEvent(key, privateUser1); org = ev.getOrganizer(); assertNotNull(org); ev.setOrganizer(null); svciUtil.getSvci(privateUser1).updateEvent(ev); svciUtil.close(privateUser1); svciUtil.open(privateUser1); ev = getEvent(key, privateUser1); org = ev.getOrganizer(); assertNull(org); svciUtil.close(privateUser1); } catch (Throwable t) { t.printStackTrace(); fail("Exception getting service interface: " + t.getMessage()); } } |
this.setLayoutManager(new org.eclipse.gmf.internal.codegen.draw2d.GridLayout()); | org.eclipse.gmf.internal.codegen.draw2d.GridLayout layoutThis = new org.eclipse.gmf.internal.codegen.draw2d.GridLayout(); layoutThis.numColumns = 2; layoutThis.makeColumnsEqualWidth = true; layoutThis.horizontalSpacing = 0; layoutThis.verticalSpacing = 0; layoutThis.marginWidth = 0; layoutThis.marginHeight = 0; this.setLayoutManager(layoutThis); | public PackageFigure() { this.setLayoutManager(new org.eclipse.gmf.internal.codegen.draw2d.GridLayout()); this.setFill(false); this.setFillXOR(false); this.setOutline(false); this.setOutlineXOR(false); this.setLineWidth(1); this.setLineStyle(org.eclipse.draw2d.Graphics.LINE_SOLID); createContents(); } |
double[] coeff = getCoefficients(w); double omega = coeff[0]; double f0 = coeff[1]; double f1 = coeff[2]; for (int i=0; i < w ; i++) { data[i] = (float)(data[i] * (f0 - f1 * Math.cos(omega*i))); data[data.length-i] = (float)(data[data.length-i] * (f0 - f1 * Math.cos(omega*i))); } | double[] coeff = getCoefficients(w); double omega = coeff[0]; double f0 = coeff[1]; double f1 = coeff[2]; for (int i=0; i < w ; i++) { data[i] = (float)(data[i] * (f0 - f1 * Math.cos(omega*i))); data[data.length-i-1] = (float)(data[data.length-i] * (f0 - f1 * Math.cos(omega*i))); | public void applyInPlace(float[] data) { int w = Math.round(data.length*width); double[] coeff = getCoefficients(w); double omega = coeff[0]; double f0 = coeff[1]; double f1 = coeff[2]; for (int i=0; i < w ; i++) { data[i] = (float)(data[i] * (f0 - f1 * Math.cos(omega*i))); data[data.length-i] = (float)(data[data.length-i] * (f0 - f1 * Math.cos(omega*i))); } } |
} | public void applyInPlace(float[] data) { int w = Math.round(data.length*width); double[] coeff = getCoefficients(w); double omega = coeff[0]; double f0 = coeff[1]; double f1 = coeff[2]; for (int i=0; i < w ; i++) { data[i] = (float)(data[i] * (f0 - f1 * Math.cos(omega*i))); data[data.length-i] = (float)(data[data.length-i] * (f0 - f1 * Math.cos(omega*i))); } } |
|
double[] out = new double[3]; if (type == HANNING) { out[0] = Math.PI/length; out[1] = .5f; out[2] = .5f; } else if (type == HANNING) { out[0] = Math.PI/length; out[1] = .54f; out[2] = .46f; } else { out[0] = Math.PI/2/length; out[1] = 1; out[2] = 1; } return out; | double[] out = new double[3]; if (type == HANNING) { out[0] = Math.PI/length; out[1] = .5f; out[2] = .5f; } else if (type == HAMMING) { out[0] = Math.PI/length; out[1] = .54f; out[2] = .46f; } else { out[0] = Math.PI/2/length; out[1] = 1; out[2] = 1; | double[] getCoefficients(int length) { double[] out = new double[3]; if (type == HANNING) { out[0] = Math.PI/length; out[1] = .5f; out[2] = .5f; } else if (type == HANNING) { out[0] = Math.PI/length; out[1] = .54f; out[2] = .46f; } else { // cosine out[0] = Math.PI/2/length; out[1] = 1; out[2] = 1; } return out; } |
return out; } | double[] getCoefficients(int length) { double[] out = new double[3]; if (type == HANNING) { out[0] = Math.PI/length; out[1] = .5f; out[2] = .5f; } else if (type == HANNING) { out[0] = Math.PI/length; out[1] = .54f; out[2] = .46f; } else { // cosine out[0] = Math.PI/2/length; out[1] = 1; out[2] = 1; } return out; } |
|
int currentMode, boolean ignoreCreator, | int currentMode, | public EventProperties(Calintf cal, AccessUtil access, int currentMode, boolean ignoreCreator, String keyFieldName, String className, String refQuery, int minId, boolean debug) { super(cal, access, currentMode, ignoreCreator, debug); this.keyFieldName = keyFieldName; this.className = className; this.refQuery = refQuery; this.minId = minId; } |
super(cal, access, currentMode, ignoreCreator, debug); | super(cal, access, currentMode, debug); | public EventProperties(Calintf cal, AccessUtil access, int currentMode, boolean ignoreCreator, String keyFieldName, String className, String refQuery, int minId, boolean debug) { super(cal, access, currentMode, ignoreCreator, debug); this.keyFieldName = keyFieldName; this.className = className; this.refQuery = refQuery; this.minId = minId; } |
fieldInError = "MONTH"; | fieldInError = "DAY_OF_MONTH"; | public void setDay(String val) { try { getCal().set(Calendar.DAY_OF_MONTH, Integer.parseInt(val)); } catch (NumberFormatException e) { getCal().set(Calendar.DAY_OF_MONTH, 1); fieldInError = "MONTH"; } } |
protected double binarySum(int start, int finish) { | public double binarySum(int start, int finish) { | protected double binarySum(int start, int finish) { if (iSeries != null) { return iBinarySum(start, finish); } // end of if (iSeries != null) if (sSeries != null) { return sBinarySum(start, finish); } // end of if (sSeries != null) if (fSeries != null) { return fBinarySum(start, finish); } // end of if (fSeries != null) if (dSeries != null) { return dBinarySum(start, finish); } // end of if (dSeries != null) return 0; } |
protected double binarySumDevLag(int start, int finish, double mean, int lag) { | public double binarySumDevLag(int start, int finish, double mean, int lag) { | protected double binarySumDevLag(int start, int finish, double mean, int lag) { if (iSeries != null) { return iBinarySumDevLag(start, finish, mean, lag); } // end of if (iSeries != null) if (sSeries != null) { return sBinarySumDevLag(start, finish, mean, lag); } // end of if (sSeries != null) if (fSeries != null) { return fBinarySumDevLag(start, finish, mean, lag); } // end of if (iSeries != null) if (dSeries != null) { return dBinarySumDevLag(start, finish, mean, lag); } // end of if (dSeries != null) return 0; } |
protected double binarySumDevSqr(int start, int finish, double mean) { | public double binarySumDevSqr(int start, int finish, double mean) { | protected double binarySumDevSqr(int start, int finish, double mean) { if (iSeries != null) { return iBinarySumDevSqr(start, finish, mean); } // end of if (iSeries != null) if (sSeries != null) { return sBinarySumDevSqr(start, finish, mean); } // end of if (sSeries != null) if (fSeries != null) { return fBinarySumDevSqr(start, finish, mean); } // end of if (iSeries != null) if (dSeries != null) { return dBinarySumDevSqr(start, finish, mean); } // end of if (dSeries != null) return 0; } |
minMaxMean[0] = Double.POSITIVE_INFINITY; minMaxMean[1] = Double.NEGATIVE_INFINITY; minMaxMean[2] = 0; | double[] outMinMaxMean = new double[3]; outMinMaxMean[0] = Double.POSITIVE_INFINITY; outMinMaxMean[1] = Double.NEGATIVE_INFINITY; outMinMaxMean[2] = 0; | private double[] calculateMinMaxMean(int beginIndex, int endIndex){ minMaxMean[0] = Double.POSITIVE_INFINITY; minMaxMean[1] = Double.NEGATIVE_INFINITY; minMaxMean[2] = 0; if (iSeries != null) { for (int i = beginIndex; i < endIndex; i++) { minMaxMean[0] = Math.min(minMaxMean[0], iSeries[i]); minMaxMean[1] = Math.max(minMaxMean[1], iSeries[i]); minMaxMean[2] += iSeries[i]; } // end of for (int i=0; i<iSeries.length; i++) } else if (sSeries != null) { for (int i = beginIndex; i < endIndex; i++) { minMaxMean[0] = Math.min(minMaxMean[0], sSeries[i]); minMaxMean[1] = Math.max(minMaxMean[1], sSeries[i]); minMaxMean[2] += sSeries[i]; } // end of for (int i=0; i<sSeries.length; i++) } else if (fSeries != null) { for (int i = beginIndex; i < endIndex; i++) { minMaxMean[0] = Math.min(minMaxMean[0], fSeries[i]); minMaxMean[1] = Math.max(minMaxMean[1], fSeries[i]); minMaxMean[2] += fSeries[i]; } // end of for (int i=0; i<fSeries.length; i++) } else if (dSeries != null) { for (int i = beginIndex; i < endIndex; i++) { minMaxMean[0] = Math.min(minMaxMean[0], dSeries[i]); minMaxMean[1] = Math.max(minMaxMean[1], dSeries[i]); minMaxMean[2] += dSeries[i]; } // end of for (int i=0; i<dSeries.length; i++) } minMaxMean[2] /= (endIndex - beginIndex); this.beginIndex = beginIndex; this.endIndex = endIndex; minMaxMeanCalculated = true; return minMaxMean; } |
minMaxMean[0] = Math.min(minMaxMean[0], iSeries[i]); minMaxMean[1] = Math.max(minMaxMean[1], iSeries[i]); minMaxMean[2] += iSeries[i]; | outMinMaxMean[0] = Math.min(outMinMaxMean[0], iSeries[i]); outMinMaxMean[1] = Math.max(outMinMaxMean[1], iSeries[i]); outMinMaxMean[2] += iSeries[i]; | private double[] calculateMinMaxMean(int beginIndex, int endIndex){ minMaxMean[0] = Double.POSITIVE_INFINITY; minMaxMean[1] = Double.NEGATIVE_INFINITY; minMaxMean[2] = 0; if (iSeries != null) { for (int i = beginIndex; i < endIndex; i++) { minMaxMean[0] = Math.min(minMaxMean[0], iSeries[i]); minMaxMean[1] = Math.max(minMaxMean[1], iSeries[i]); minMaxMean[2] += iSeries[i]; } // end of for (int i=0; i<iSeries.length; i++) } else if (sSeries != null) { for (int i = beginIndex; i < endIndex; i++) { minMaxMean[0] = Math.min(minMaxMean[0], sSeries[i]); minMaxMean[1] = Math.max(minMaxMean[1], sSeries[i]); minMaxMean[2] += sSeries[i]; } // end of for (int i=0; i<sSeries.length; i++) } else if (fSeries != null) { for (int i = beginIndex; i < endIndex; i++) { minMaxMean[0] = Math.min(minMaxMean[0], fSeries[i]); minMaxMean[1] = Math.max(minMaxMean[1], fSeries[i]); minMaxMean[2] += fSeries[i]; } // end of for (int i=0; i<fSeries.length; i++) } else if (dSeries != null) { for (int i = beginIndex; i < endIndex; i++) { minMaxMean[0] = Math.min(minMaxMean[0], dSeries[i]); minMaxMean[1] = Math.max(minMaxMean[1], dSeries[i]); minMaxMean[2] += dSeries[i]; } // end of for (int i=0; i<dSeries.length; i++) } minMaxMean[2] /= (endIndex - beginIndex); this.beginIndex = beginIndex; this.endIndex = endIndex; minMaxMeanCalculated = true; return minMaxMean; } |
minMaxMean[0] = Math.min(minMaxMean[0], sSeries[i]); minMaxMean[1] = Math.max(minMaxMean[1], sSeries[i]); minMaxMean[2] += sSeries[i]; | outMinMaxMean[0] = Math.min(outMinMaxMean[0], sSeries[i]); outMinMaxMean[1] = Math.max(outMinMaxMean[1], sSeries[i]); outMinMaxMean[2] += sSeries[i]; | private double[] calculateMinMaxMean(int beginIndex, int endIndex){ minMaxMean[0] = Double.POSITIVE_INFINITY; minMaxMean[1] = Double.NEGATIVE_INFINITY; minMaxMean[2] = 0; if (iSeries != null) { for (int i = beginIndex; i < endIndex; i++) { minMaxMean[0] = Math.min(minMaxMean[0], iSeries[i]); minMaxMean[1] = Math.max(minMaxMean[1], iSeries[i]); minMaxMean[2] += iSeries[i]; } // end of for (int i=0; i<iSeries.length; i++) } else if (sSeries != null) { for (int i = beginIndex; i < endIndex; i++) { minMaxMean[0] = Math.min(minMaxMean[0], sSeries[i]); minMaxMean[1] = Math.max(minMaxMean[1], sSeries[i]); minMaxMean[2] += sSeries[i]; } // end of for (int i=0; i<sSeries.length; i++) } else if (fSeries != null) { for (int i = beginIndex; i < endIndex; i++) { minMaxMean[0] = Math.min(minMaxMean[0], fSeries[i]); minMaxMean[1] = Math.max(minMaxMean[1], fSeries[i]); minMaxMean[2] += fSeries[i]; } // end of for (int i=0; i<fSeries.length; i++) } else if (dSeries != null) { for (int i = beginIndex; i < endIndex; i++) { minMaxMean[0] = Math.min(minMaxMean[0], dSeries[i]); minMaxMean[1] = Math.max(minMaxMean[1], dSeries[i]); minMaxMean[2] += dSeries[i]; } // end of for (int i=0; i<dSeries.length; i++) } minMaxMean[2] /= (endIndex - beginIndex); this.beginIndex = beginIndex; this.endIndex = endIndex; minMaxMeanCalculated = true; return minMaxMean; } |
minMaxMean[0] = Math.min(minMaxMean[0], fSeries[i]); minMaxMean[1] = Math.max(minMaxMean[1], fSeries[i]); minMaxMean[2] += fSeries[i]; | outMinMaxMean[0] = Math.min(outMinMaxMean[0], fSeries[i]); outMinMaxMean[1] = Math.max(outMinMaxMean[1], fSeries[i]); outMinMaxMean[2] += fSeries[i]; | private double[] calculateMinMaxMean(int beginIndex, int endIndex){ minMaxMean[0] = Double.POSITIVE_INFINITY; minMaxMean[1] = Double.NEGATIVE_INFINITY; minMaxMean[2] = 0; if (iSeries != null) { for (int i = beginIndex; i < endIndex; i++) { minMaxMean[0] = Math.min(minMaxMean[0], iSeries[i]); minMaxMean[1] = Math.max(minMaxMean[1], iSeries[i]); minMaxMean[2] += iSeries[i]; } // end of for (int i=0; i<iSeries.length; i++) } else if (sSeries != null) { for (int i = beginIndex; i < endIndex; i++) { minMaxMean[0] = Math.min(minMaxMean[0], sSeries[i]); minMaxMean[1] = Math.max(minMaxMean[1], sSeries[i]); minMaxMean[2] += sSeries[i]; } // end of for (int i=0; i<sSeries.length; i++) } else if (fSeries != null) { for (int i = beginIndex; i < endIndex; i++) { minMaxMean[0] = Math.min(minMaxMean[0], fSeries[i]); minMaxMean[1] = Math.max(minMaxMean[1], fSeries[i]); minMaxMean[2] += fSeries[i]; } // end of for (int i=0; i<fSeries.length; i++) } else if (dSeries != null) { for (int i = beginIndex; i < endIndex; i++) { minMaxMean[0] = Math.min(minMaxMean[0], dSeries[i]); minMaxMean[1] = Math.max(minMaxMean[1], dSeries[i]); minMaxMean[2] += dSeries[i]; } // end of for (int i=0; i<dSeries.length; i++) } minMaxMean[2] /= (endIndex - beginIndex); this.beginIndex = beginIndex; this.endIndex = endIndex; minMaxMeanCalculated = true; return minMaxMean; } |
minMaxMean[0] = Math.min(minMaxMean[0], dSeries[i]); minMaxMean[1] = Math.max(minMaxMean[1], dSeries[i]); minMaxMean[2] += dSeries[i]; | outMinMaxMean[0] = Math.min(outMinMaxMean[0], dSeries[i]); outMinMaxMean[1] = Math.max(outMinMaxMean[1], dSeries[i]); outMinMaxMean[2] += dSeries[i]; | private double[] calculateMinMaxMean(int beginIndex, int endIndex){ minMaxMean[0] = Double.POSITIVE_INFINITY; minMaxMean[1] = Double.NEGATIVE_INFINITY; minMaxMean[2] = 0; if (iSeries != null) { for (int i = beginIndex; i < endIndex; i++) { minMaxMean[0] = Math.min(minMaxMean[0], iSeries[i]); minMaxMean[1] = Math.max(minMaxMean[1], iSeries[i]); minMaxMean[2] += iSeries[i]; } // end of for (int i=0; i<iSeries.length; i++) } else if (sSeries != null) { for (int i = beginIndex; i < endIndex; i++) { minMaxMean[0] = Math.min(minMaxMean[0], sSeries[i]); minMaxMean[1] = Math.max(minMaxMean[1], sSeries[i]); minMaxMean[2] += sSeries[i]; } // end of for (int i=0; i<sSeries.length; i++) } else if (fSeries != null) { for (int i = beginIndex; i < endIndex; i++) { minMaxMean[0] = Math.min(minMaxMean[0], fSeries[i]); minMaxMean[1] = Math.max(minMaxMean[1], fSeries[i]); minMaxMean[2] += fSeries[i]; } // end of for (int i=0; i<fSeries.length; i++) } else if (dSeries != null) { for (int i = beginIndex; i < endIndex; i++) { minMaxMean[0] = Math.min(minMaxMean[0], dSeries[i]); minMaxMean[1] = Math.max(minMaxMean[1], dSeries[i]); minMaxMean[2] += dSeries[i]; } // end of for (int i=0; i<dSeries.length; i++) } minMaxMean[2] /= (endIndex - beginIndex); this.beginIndex = beginIndex; this.endIndex = endIndex; minMaxMeanCalculated = true; return minMaxMean; } |
minMaxMean[2] /= (endIndex - beginIndex); this.beginIndex = beginIndex; this.endIndex = endIndex; minMaxMeanCalculated = true; return minMaxMean; | outMinMaxMean[2] /= (endIndex - beginIndex); return outMinMaxMean; | private double[] calculateMinMaxMean(int beginIndex, int endIndex){ minMaxMean[0] = Double.POSITIVE_INFINITY; minMaxMean[1] = Double.NEGATIVE_INFINITY; minMaxMean[2] = 0; if (iSeries != null) { for (int i = beginIndex; i < endIndex; i++) { minMaxMean[0] = Math.min(minMaxMean[0], iSeries[i]); minMaxMean[1] = Math.max(minMaxMean[1], iSeries[i]); minMaxMean[2] += iSeries[i]; } // end of for (int i=0; i<iSeries.length; i++) } else if (sSeries != null) { for (int i = beginIndex; i < endIndex; i++) { minMaxMean[0] = Math.min(minMaxMean[0], sSeries[i]); minMaxMean[1] = Math.max(minMaxMean[1], sSeries[i]); minMaxMean[2] += sSeries[i]; } // end of for (int i=0; i<sSeries.length; i++) } else if (fSeries != null) { for (int i = beginIndex; i < endIndex; i++) { minMaxMean[0] = Math.min(minMaxMean[0], fSeries[i]); minMaxMean[1] = Math.max(minMaxMean[1], fSeries[i]); minMaxMean[2] += fSeries[i]; } // end of for (int i=0; i<fSeries.length; i++) } else if (dSeries != null) { for (int i = beginIndex; i < endIndex; i++) { minMaxMean[0] = Math.min(minMaxMean[0], dSeries[i]); minMaxMean[1] = Math.max(minMaxMean[1], dSeries[i]); minMaxMean[2] += dSeries[i]; } // end of for (int i=0; i<dSeries.length; i++) } minMaxMean[2] /= (endIndex - beginIndex); this.beginIndex = beginIndex; this.endIndex = endIndex; minMaxMeanCalculated = true; return minMaxMean; } |
public void setIndex(int val) { | private void setIndex(int val) { | public void setIndex(int val) { index = val; encoding = privEncoding[index]; } |
error("Need to implement eventrefs fixup"); | void doRestore() throws Throwable { digester = new Digester(); RegexMatcher m = new SimpleRegexMatcher(); digester.setRules(new RegexRules(m)); digester.addRuleSet(new RestoreRuleSet(globals)); digester.parse(new FileReader(filename)); if (globals.config.getFrom2p3px()) { makePrefs(); if (globals.rintf != null) { globals.rintf.restoreAdminGroup((BwAdminGroup)globals.getSuperGroup()); } } error("Need to implement eventrefs fixup"); } |
|
boolean initSyspars = false; | void getConfigProperties(String[] args) throws Throwable { /* Look for the appname arg */ if (args != null) { for (int i = 0; i < args.length; i++) { if (argpar("-appname", args, i)) { i++; appName = args[i]; } else if (args[i].equals("-initSyspars")) { globals.config.setInitSyspars(true); } } } if (appName == null) { error("Missing required argument -appname"); throw new Exception("Invalid args"); } globals.init((DumpRestoreConfig)CalOptions.getProperty(appPrefix + appName)); if (globals.config.getInitSyspars() || globals.config.getFrom2p3px()) { globals.syspars = (BwSystem)CalOptions.getProperty("org.bedework.syspars"); } } |
|
globals.config.setInitSyspars(true); | initSyspars = true; | void getConfigProperties(String[] args) throws Throwable { /* Look for the appname arg */ if (args != null) { for (int i = 0; i < args.length; i++) { if (argpar("-appname", args, i)) { i++; appName = args[i]; } else if (args[i].equals("-initSyspars")) { globals.config.setInitSyspars(true); } } } if (appName == null) { error("Missing required argument -appname"); throw new Exception("Invalid args"); } globals.init((DumpRestoreConfig)CalOptions.getProperty(appPrefix + appName)); if (globals.config.getInitSyspars() || globals.config.getFrom2p3px()) { globals.syspars = (BwSystem)CalOptions.getProperty("org.bedework.syspars"); } } |
if (globals.config.getInitSyspars() || globals.config.getFrom2p3px()) { | if (initSyspars || globals.config.getInitSyspars() || globals.config.getFrom2p3px()) { | void getConfigProperties(String[] args) throws Throwable { /* Look for the appname arg */ if (args != null) { for (int i = 0; i < args.length; i++) { if (argpar("-appname", args, i)) { i++; appName = args[i]; } else if (args[i].equals("-initSyspars")) { globals.config.setInitSyspars(true); } } } if (appName == null) { error("Missing required argument -appname"); throw new Exception("Invalid args"); } globals.init((DumpRestoreConfig)CalOptions.getProperty(appPrefix + appName)); if (globals.config.getInitSyspars() || globals.config.getFrom2p3px()) { globals.syspars = (BwSystem)CalOptions.getProperty("org.bedework.syspars"); } } |
public synchronized boolean evaluateAccess(AccessPrincipal who, String owner, Privilege[] how, char[] acl) | public CurrentAccess evaluateAccess(AccessPrincipal who, String owner, Privilege[] how, char[] acl) | public synchronized boolean evaluateAccess(AccessPrincipal who, String owner, Privilege[] how, char[] acl) throws AccessException { boolean authenticated = !who.getUnauthenticated(); boolean isOwner = false; char[] privileges = null; setEncoded(acl); if (authenticated) { isOwner = who.getAccount().equals(owner); } StringBuffer debugsb = null; if (debug) { debugsb = new StringBuffer("Check access for '"); debugsb.append(new String(acl)); debugsb.append("' with authenticated = "); debugsb.append(authenticated); debugsb.append(" isOwner = "); debugsb.append(isOwner); } getPrivileges: { if (!authenticated) { if (ace.decode(this, false, null, Ace.whoTypeUnauthenticated)) { privileges = ace.getHow(); } break getPrivileges; } if (isOwner) { if (ace.decode(this, false, null, Ace.whoTypeOwner)) { privileges = ace.getHow(); } else { privileges = defaultOwnerPrivileges; } break getPrivileges; } // Not owner - look for user if (ace.decode(this, false, who.getAccount(), Ace.whoTypeUser)) { privileges = ace.getHow(); if (debug) { debugsb.append("... For user got: " + new String(privileges)); } break getPrivileges; } // No specific user access - look for group access if (who.getGroupNames() != null) { Iterator it = who.getGroupNames().iterator(); while (it.hasNext()) { String group = (String)it.next(); if (debug) { debugsb.append("...Try access for group " + group); } if (ace.decode(this, false, group, Ace.whoTypeGroup)) { privileges = mergePrivileges(privileges, ace.getHow()); } } } if (privileges != null) { if (debug) { debugsb.append("...For groups got: " + new String(privileges)); } break getPrivileges; } // "other" access set? if (ace.decode(this, false, null, Ace.whoTypeOther)) { privileges = ace.getHow(); if (debug) { debugsb.append("...For other got: " + new String(privileges)); } break getPrivileges; } } // getPrivileges if (privileges == null) { if (debug) { debugMsg(debugsb.toString() + "...Check access denied (noprivs)"); } return false; } for (int i = 0; i < how.length; i++) { char priv = privileges[how[i].getIndex()]; if (priv == unspecified) { if (isOwner) { priv = allowed; } else { priv = denied; } } if (priv != allowed) { if (debug) { debugMsg(debugsb.toString() + "...Check access denied (!allowed)"); } return false; } } if (debug) { debugMsg(debugsb.toString() + "...Check access allowed"); } return true; } |
char[] privileges = null; | CurrentAccess ca = new CurrentAccess(); ca.desiredAccess = how; | public synchronized boolean evaluateAccess(AccessPrincipal who, String owner, Privilege[] how, char[] acl) throws AccessException { boolean authenticated = !who.getUnauthenticated(); boolean isOwner = false; char[] privileges = null; setEncoded(acl); if (authenticated) { isOwner = who.getAccount().equals(owner); } StringBuffer debugsb = null; if (debug) { debugsb = new StringBuffer("Check access for '"); debugsb.append(new String(acl)); debugsb.append("' with authenticated = "); debugsb.append(authenticated); debugsb.append(" isOwner = "); debugsb.append(isOwner); } getPrivileges: { if (!authenticated) { if (ace.decode(this, false, null, Ace.whoTypeUnauthenticated)) { privileges = ace.getHow(); } break getPrivileges; } if (isOwner) { if (ace.decode(this, false, null, Ace.whoTypeOwner)) { privileges = ace.getHow(); } else { privileges = defaultOwnerPrivileges; } break getPrivileges; } // Not owner - look for user if (ace.decode(this, false, who.getAccount(), Ace.whoTypeUser)) { privileges = ace.getHow(); if (debug) { debugsb.append("... For user got: " + new String(privileges)); } break getPrivileges; } // No specific user access - look for group access if (who.getGroupNames() != null) { Iterator it = who.getGroupNames().iterator(); while (it.hasNext()) { String group = (String)it.next(); if (debug) { debugsb.append("...Try access for group " + group); } if (ace.decode(this, false, group, Ace.whoTypeGroup)) { privileges = mergePrivileges(privileges, ace.getHow()); } } } if (privileges != null) { if (debug) { debugsb.append("...For groups got: " + new String(privileges)); } break getPrivileges; } // "other" access set? if (ace.decode(this, false, null, Ace.whoTypeOther)) { privileges = ace.getHow(); if (debug) { debugsb.append("...For other got: " + new String(privileges)); } break getPrivileges; } } // getPrivileges if (privileges == null) { if (debug) { debugMsg(debugsb.toString() + "...Check access denied (noprivs)"); } return false; } for (int i = 0; i < how.length; i++) { char priv = privileges[how[i].getIndex()]; if (priv == unspecified) { if (isOwner) { priv = allowed; } else { priv = denied; } } if (priv != allowed) { if (debug) { debugMsg(debugsb.toString() + "...Check access denied (!allowed)"); } return false; } } if (debug) { debugMsg(debugsb.toString() + "...Check access allowed"); } return true; } |
privileges = ace.getHow(); | ca.privileges = ace.getHow(); | public synchronized boolean evaluateAccess(AccessPrincipal who, String owner, Privilege[] how, char[] acl) throws AccessException { boolean authenticated = !who.getUnauthenticated(); boolean isOwner = false; char[] privileges = null; setEncoded(acl); if (authenticated) { isOwner = who.getAccount().equals(owner); } StringBuffer debugsb = null; if (debug) { debugsb = new StringBuffer("Check access for '"); debugsb.append(new String(acl)); debugsb.append("' with authenticated = "); debugsb.append(authenticated); debugsb.append(" isOwner = "); debugsb.append(isOwner); } getPrivileges: { if (!authenticated) { if (ace.decode(this, false, null, Ace.whoTypeUnauthenticated)) { privileges = ace.getHow(); } break getPrivileges; } if (isOwner) { if (ace.decode(this, false, null, Ace.whoTypeOwner)) { privileges = ace.getHow(); } else { privileges = defaultOwnerPrivileges; } break getPrivileges; } // Not owner - look for user if (ace.decode(this, false, who.getAccount(), Ace.whoTypeUser)) { privileges = ace.getHow(); if (debug) { debugsb.append("... For user got: " + new String(privileges)); } break getPrivileges; } // No specific user access - look for group access if (who.getGroupNames() != null) { Iterator it = who.getGroupNames().iterator(); while (it.hasNext()) { String group = (String)it.next(); if (debug) { debugsb.append("...Try access for group " + group); } if (ace.decode(this, false, group, Ace.whoTypeGroup)) { privileges = mergePrivileges(privileges, ace.getHow()); } } } if (privileges != null) { if (debug) { debugsb.append("...For groups got: " + new String(privileges)); } break getPrivileges; } // "other" access set? if (ace.decode(this, false, null, Ace.whoTypeOther)) { privileges = ace.getHow(); if (debug) { debugsb.append("...For other got: " + new String(privileges)); } break getPrivileges; } } // getPrivileges if (privileges == null) { if (debug) { debugMsg(debugsb.toString() + "...Check access denied (noprivs)"); } return false; } for (int i = 0; i < how.length; i++) { char priv = privileges[how[i].getIndex()]; if (priv == unspecified) { if (isOwner) { priv = allowed; } else { priv = denied; } } if (priv != allowed) { if (debug) { debugMsg(debugsb.toString() + "...Check access denied (!allowed)"); } return false; } } if (debug) { debugMsg(debugsb.toString() + "...Check access allowed"); } return true; } |
privileges = defaultOwnerPrivileges; | ca.privileges = defaultOwnerPrivileges; | public synchronized boolean evaluateAccess(AccessPrincipal who, String owner, Privilege[] how, char[] acl) throws AccessException { boolean authenticated = !who.getUnauthenticated(); boolean isOwner = false; char[] privileges = null; setEncoded(acl); if (authenticated) { isOwner = who.getAccount().equals(owner); } StringBuffer debugsb = null; if (debug) { debugsb = new StringBuffer("Check access for '"); debugsb.append(new String(acl)); debugsb.append("' with authenticated = "); debugsb.append(authenticated); debugsb.append(" isOwner = "); debugsb.append(isOwner); } getPrivileges: { if (!authenticated) { if (ace.decode(this, false, null, Ace.whoTypeUnauthenticated)) { privileges = ace.getHow(); } break getPrivileges; } if (isOwner) { if (ace.decode(this, false, null, Ace.whoTypeOwner)) { privileges = ace.getHow(); } else { privileges = defaultOwnerPrivileges; } break getPrivileges; } // Not owner - look for user if (ace.decode(this, false, who.getAccount(), Ace.whoTypeUser)) { privileges = ace.getHow(); if (debug) { debugsb.append("... For user got: " + new String(privileges)); } break getPrivileges; } // No specific user access - look for group access if (who.getGroupNames() != null) { Iterator it = who.getGroupNames().iterator(); while (it.hasNext()) { String group = (String)it.next(); if (debug) { debugsb.append("...Try access for group " + group); } if (ace.decode(this, false, group, Ace.whoTypeGroup)) { privileges = mergePrivileges(privileges, ace.getHow()); } } } if (privileges != null) { if (debug) { debugsb.append("...For groups got: " + new String(privileges)); } break getPrivileges; } // "other" access set? if (ace.decode(this, false, null, Ace.whoTypeOther)) { privileges = ace.getHow(); if (debug) { debugsb.append("...For other got: " + new String(privileges)); } break getPrivileges; } } // getPrivileges if (privileges == null) { if (debug) { debugMsg(debugsb.toString() + "...Check access denied (noprivs)"); } return false; } for (int i = 0; i < how.length; i++) { char priv = privileges[how[i].getIndex()]; if (priv == unspecified) { if (isOwner) { priv = allowed; } else { priv = denied; } } if (priv != allowed) { if (debug) { debugMsg(debugsb.toString() + "...Check access denied (!allowed)"); } return false; } } if (debug) { debugMsg(debugsb.toString() + "...Check access allowed"); } return true; } |
debugsb.append("... For user got: " + new String(privileges)); | debugsb.append("... For user got: " + new String(ca.privileges)); | public synchronized boolean evaluateAccess(AccessPrincipal who, String owner, Privilege[] how, char[] acl) throws AccessException { boolean authenticated = !who.getUnauthenticated(); boolean isOwner = false; char[] privileges = null; setEncoded(acl); if (authenticated) { isOwner = who.getAccount().equals(owner); } StringBuffer debugsb = null; if (debug) { debugsb = new StringBuffer("Check access for '"); debugsb.append(new String(acl)); debugsb.append("' with authenticated = "); debugsb.append(authenticated); debugsb.append(" isOwner = "); debugsb.append(isOwner); } getPrivileges: { if (!authenticated) { if (ace.decode(this, false, null, Ace.whoTypeUnauthenticated)) { privileges = ace.getHow(); } break getPrivileges; } if (isOwner) { if (ace.decode(this, false, null, Ace.whoTypeOwner)) { privileges = ace.getHow(); } else { privileges = defaultOwnerPrivileges; } break getPrivileges; } // Not owner - look for user if (ace.decode(this, false, who.getAccount(), Ace.whoTypeUser)) { privileges = ace.getHow(); if (debug) { debugsb.append("... For user got: " + new String(privileges)); } break getPrivileges; } // No specific user access - look for group access if (who.getGroupNames() != null) { Iterator it = who.getGroupNames().iterator(); while (it.hasNext()) { String group = (String)it.next(); if (debug) { debugsb.append("...Try access for group " + group); } if (ace.decode(this, false, group, Ace.whoTypeGroup)) { privileges = mergePrivileges(privileges, ace.getHow()); } } } if (privileges != null) { if (debug) { debugsb.append("...For groups got: " + new String(privileges)); } break getPrivileges; } // "other" access set? if (ace.decode(this, false, null, Ace.whoTypeOther)) { privileges = ace.getHow(); if (debug) { debugsb.append("...For other got: " + new String(privileges)); } break getPrivileges; } } // getPrivileges if (privileges == null) { if (debug) { debugMsg(debugsb.toString() + "...Check access denied (noprivs)"); } return false; } for (int i = 0; i < how.length; i++) { char priv = privileges[how[i].getIndex()]; if (priv == unspecified) { if (isOwner) { priv = allowed; } else { priv = denied; } } if (priv != allowed) { if (debug) { debugMsg(debugsb.toString() + "...Check access denied (!allowed)"); } return false; } } if (debug) { debugMsg(debugsb.toString() + "...Check access allowed"); } return true; } |
privileges = mergePrivileges(privileges, ace.getHow()); | ca.privileges = mergePrivileges(ca.privileges, ace.getHow()); | public synchronized boolean evaluateAccess(AccessPrincipal who, String owner, Privilege[] how, char[] acl) throws AccessException { boolean authenticated = !who.getUnauthenticated(); boolean isOwner = false; char[] privileges = null; setEncoded(acl); if (authenticated) { isOwner = who.getAccount().equals(owner); } StringBuffer debugsb = null; if (debug) { debugsb = new StringBuffer("Check access for '"); debugsb.append(new String(acl)); debugsb.append("' with authenticated = "); debugsb.append(authenticated); debugsb.append(" isOwner = "); debugsb.append(isOwner); } getPrivileges: { if (!authenticated) { if (ace.decode(this, false, null, Ace.whoTypeUnauthenticated)) { privileges = ace.getHow(); } break getPrivileges; } if (isOwner) { if (ace.decode(this, false, null, Ace.whoTypeOwner)) { privileges = ace.getHow(); } else { privileges = defaultOwnerPrivileges; } break getPrivileges; } // Not owner - look for user if (ace.decode(this, false, who.getAccount(), Ace.whoTypeUser)) { privileges = ace.getHow(); if (debug) { debugsb.append("... For user got: " + new String(privileges)); } break getPrivileges; } // No specific user access - look for group access if (who.getGroupNames() != null) { Iterator it = who.getGroupNames().iterator(); while (it.hasNext()) { String group = (String)it.next(); if (debug) { debugsb.append("...Try access for group " + group); } if (ace.decode(this, false, group, Ace.whoTypeGroup)) { privileges = mergePrivileges(privileges, ace.getHow()); } } } if (privileges != null) { if (debug) { debugsb.append("...For groups got: " + new String(privileges)); } break getPrivileges; } // "other" access set? if (ace.decode(this, false, null, Ace.whoTypeOther)) { privileges = ace.getHow(); if (debug) { debugsb.append("...For other got: " + new String(privileges)); } break getPrivileges; } } // getPrivileges if (privileges == null) { if (debug) { debugMsg(debugsb.toString() + "...Check access denied (noprivs)"); } return false; } for (int i = 0; i < how.length; i++) { char priv = privileges[how[i].getIndex()]; if (priv == unspecified) { if (isOwner) { priv = allowed; } else { priv = denied; } } if (priv != allowed) { if (debug) { debugMsg(debugsb.toString() + "...Check access denied (!allowed)"); } return false; } } if (debug) { debugMsg(debugsb.toString() + "...Check access allowed"); } return true; } |
if (privileges != null) { | if (ca.privileges != null) { | public synchronized boolean evaluateAccess(AccessPrincipal who, String owner, Privilege[] how, char[] acl) throws AccessException { boolean authenticated = !who.getUnauthenticated(); boolean isOwner = false; char[] privileges = null; setEncoded(acl); if (authenticated) { isOwner = who.getAccount().equals(owner); } StringBuffer debugsb = null; if (debug) { debugsb = new StringBuffer("Check access for '"); debugsb.append(new String(acl)); debugsb.append("' with authenticated = "); debugsb.append(authenticated); debugsb.append(" isOwner = "); debugsb.append(isOwner); } getPrivileges: { if (!authenticated) { if (ace.decode(this, false, null, Ace.whoTypeUnauthenticated)) { privileges = ace.getHow(); } break getPrivileges; } if (isOwner) { if (ace.decode(this, false, null, Ace.whoTypeOwner)) { privileges = ace.getHow(); } else { privileges = defaultOwnerPrivileges; } break getPrivileges; } // Not owner - look for user if (ace.decode(this, false, who.getAccount(), Ace.whoTypeUser)) { privileges = ace.getHow(); if (debug) { debugsb.append("... For user got: " + new String(privileges)); } break getPrivileges; } // No specific user access - look for group access if (who.getGroupNames() != null) { Iterator it = who.getGroupNames().iterator(); while (it.hasNext()) { String group = (String)it.next(); if (debug) { debugsb.append("...Try access for group " + group); } if (ace.decode(this, false, group, Ace.whoTypeGroup)) { privileges = mergePrivileges(privileges, ace.getHow()); } } } if (privileges != null) { if (debug) { debugsb.append("...For groups got: " + new String(privileges)); } break getPrivileges; } // "other" access set? if (ace.decode(this, false, null, Ace.whoTypeOther)) { privileges = ace.getHow(); if (debug) { debugsb.append("...For other got: " + new String(privileges)); } break getPrivileges; } } // getPrivileges if (privileges == null) { if (debug) { debugMsg(debugsb.toString() + "...Check access denied (noprivs)"); } return false; } for (int i = 0; i < how.length; i++) { char priv = privileges[how[i].getIndex()]; if (priv == unspecified) { if (isOwner) { priv = allowed; } else { priv = denied; } } if (priv != allowed) { if (debug) { debugMsg(debugsb.toString() + "...Check access denied (!allowed)"); } return false; } } if (debug) { debugMsg(debugsb.toString() + "...Check access allowed"); } return true; } |
debugsb.append("...For groups got: " + new String(privileges)); | debugsb.append("...For groups got: " + new String(ca.privileges)); | public synchronized boolean evaluateAccess(AccessPrincipal who, String owner, Privilege[] how, char[] acl) throws AccessException { boolean authenticated = !who.getUnauthenticated(); boolean isOwner = false; char[] privileges = null; setEncoded(acl); if (authenticated) { isOwner = who.getAccount().equals(owner); } StringBuffer debugsb = null; if (debug) { debugsb = new StringBuffer("Check access for '"); debugsb.append(new String(acl)); debugsb.append("' with authenticated = "); debugsb.append(authenticated); debugsb.append(" isOwner = "); debugsb.append(isOwner); } getPrivileges: { if (!authenticated) { if (ace.decode(this, false, null, Ace.whoTypeUnauthenticated)) { privileges = ace.getHow(); } break getPrivileges; } if (isOwner) { if (ace.decode(this, false, null, Ace.whoTypeOwner)) { privileges = ace.getHow(); } else { privileges = defaultOwnerPrivileges; } break getPrivileges; } // Not owner - look for user if (ace.decode(this, false, who.getAccount(), Ace.whoTypeUser)) { privileges = ace.getHow(); if (debug) { debugsb.append("... For user got: " + new String(privileges)); } break getPrivileges; } // No specific user access - look for group access if (who.getGroupNames() != null) { Iterator it = who.getGroupNames().iterator(); while (it.hasNext()) { String group = (String)it.next(); if (debug) { debugsb.append("...Try access for group " + group); } if (ace.decode(this, false, group, Ace.whoTypeGroup)) { privileges = mergePrivileges(privileges, ace.getHow()); } } } if (privileges != null) { if (debug) { debugsb.append("...For groups got: " + new String(privileges)); } break getPrivileges; } // "other" access set? if (ace.decode(this, false, null, Ace.whoTypeOther)) { privileges = ace.getHow(); if (debug) { debugsb.append("...For other got: " + new String(privileges)); } break getPrivileges; } } // getPrivileges if (privileges == null) { if (debug) { debugMsg(debugsb.toString() + "...Check access denied (noprivs)"); } return false; } for (int i = 0; i < how.length; i++) { char priv = privileges[how[i].getIndex()]; if (priv == unspecified) { if (isOwner) { priv = allowed; } else { priv = denied; } } if (priv != allowed) { if (debug) { debugMsg(debugsb.toString() + "...Check access denied (!allowed)"); } return false; } } if (debug) { debugMsg(debugsb.toString() + "...Check access allowed"); } return true; } |
debugsb.append("...For other got: " + new String(privileges)); | debugsb.append("...For other got: " + new String(ca.privileges)); | public synchronized boolean evaluateAccess(AccessPrincipal who, String owner, Privilege[] how, char[] acl) throws AccessException { boolean authenticated = !who.getUnauthenticated(); boolean isOwner = false; char[] privileges = null; setEncoded(acl); if (authenticated) { isOwner = who.getAccount().equals(owner); } StringBuffer debugsb = null; if (debug) { debugsb = new StringBuffer("Check access for '"); debugsb.append(new String(acl)); debugsb.append("' with authenticated = "); debugsb.append(authenticated); debugsb.append(" isOwner = "); debugsb.append(isOwner); } getPrivileges: { if (!authenticated) { if (ace.decode(this, false, null, Ace.whoTypeUnauthenticated)) { privileges = ace.getHow(); } break getPrivileges; } if (isOwner) { if (ace.decode(this, false, null, Ace.whoTypeOwner)) { privileges = ace.getHow(); } else { privileges = defaultOwnerPrivileges; } break getPrivileges; } // Not owner - look for user if (ace.decode(this, false, who.getAccount(), Ace.whoTypeUser)) { privileges = ace.getHow(); if (debug) { debugsb.append("... For user got: " + new String(privileges)); } break getPrivileges; } // No specific user access - look for group access if (who.getGroupNames() != null) { Iterator it = who.getGroupNames().iterator(); while (it.hasNext()) { String group = (String)it.next(); if (debug) { debugsb.append("...Try access for group " + group); } if (ace.decode(this, false, group, Ace.whoTypeGroup)) { privileges = mergePrivileges(privileges, ace.getHow()); } } } if (privileges != null) { if (debug) { debugsb.append("...For groups got: " + new String(privileges)); } break getPrivileges; } // "other" access set? if (ace.decode(this, false, null, Ace.whoTypeOther)) { privileges = ace.getHow(); if (debug) { debugsb.append("...For other got: " + new String(privileges)); } break getPrivileges; } } // getPrivileges if (privileges == null) { if (debug) { debugMsg(debugsb.toString() + "...Check access denied (noprivs)"); } return false; } for (int i = 0; i < how.length; i++) { char priv = privileges[how[i].getIndex()]; if (priv == unspecified) { if (isOwner) { priv = allowed; } else { priv = denied; } } if (priv != allowed) { if (debug) { debugMsg(debugsb.toString() + "...Check access denied (!allowed)"); } return false; } } if (debug) { debugMsg(debugsb.toString() + "...Check access allowed"); } return true; } |
if (privileges == null) { | if (ca.privileges == null) { | public synchronized boolean evaluateAccess(AccessPrincipal who, String owner, Privilege[] how, char[] acl) throws AccessException { boolean authenticated = !who.getUnauthenticated(); boolean isOwner = false; char[] privileges = null; setEncoded(acl); if (authenticated) { isOwner = who.getAccount().equals(owner); } StringBuffer debugsb = null; if (debug) { debugsb = new StringBuffer("Check access for '"); debugsb.append(new String(acl)); debugsb.append("' with authenticated = "); debugsb.append(authenticated); debugsb.append(" isOwner = "); debugsb.append(isOwner); } getPrivileges: { if (!authenticated) { if (ace.decode(this, false, null, Ace.whoTypeUnauthenticated)) { privileges = ace.getHow(); } break getPrivileges; } if (isOwner) { if (ace.decode(this, false, null, Ace.whoTypeOwner)) { privileges = ace.getHow(); } else { privileges = defaultOwnerPrivileges; } break getPrivileges; } // Not owner - look for user if (ace.decode(this, false, who.getAccount(), Ace.whoTypeUser)) { privileges = ace.getHow(); if (debug) { debugsb.append("... For user got: " + new String(privileges)); } break getPrivileges; } // No specific user access - look for group access if (who.getGroupNames() != null) { Iterator it = who.getGroupNames().iterator(); while (it.hasNext()) { String group = (String)it.next(); if (debug) { debugsb.append("...Try access for group " + group); } if (ace.decode(this, false, group, Ace.whoTypeGroup)) { privileges = mergePrivileges(privileges, ace.getHow()); } } } if (privileges != null) { if (debug) { debugsb.append("...For groups got: " + new String(privileges)); } break getPrivileges; } // "other" access set? if (ace.decode(this, false, null, Ace.whoTypeOther)) { privileges = ace.getHow(); if (debug) { debugsb.append("...For other got: " + new String(privileges)); } break getPrivileges; } } // getPrivileges if (privileges == null) { if (debug) { debugMsg(debugsb.toString() + "...Check access denied (noprivs)"); } return false; } for (int i = 0; i < how.length; i++) { char priv = privileges[how[i].getIndex()]; if (priv == unspecified) { if (isOwner) { priv = allowed; } else { priv = denied; } } if (priv != allowed) { if (debug) { debugMsg(debugsb.toString() + "...Check access denied (!allowed)"); } return false; } } if (debug) { debugMsg(debugsb.toString() + "...Check access allowed"); } return true; } |
return false; | return ca; | public synchronized boolean evaluateAccess(AccessPrincipal who, String owner, Privilege[] how, char[] acl) throws AccessException { boolean authenticated = !who.getUnauthenticated(); boolean isOwner = false; char[] privileges = null; setEncoded(acl); if (authenticated) { isOwner = who.getAccount().equals(owner); } StringBuffer debugsb = null; if (debug) { debugsb = new StringBuffer("Check access for '"); debugsb.append(new String(acl)); debugsb.append("' with authenticated = "); debugsb.append(authenticated); debugsb.append(" isOwner = "); debugsb.append(isOwner); } getPrivileges: { if (!authenticated) { if (ace.decode(this, false, null, Ace.whoTypeUnauthenticated)) { privileges = ace.getHow(); } break getPrivileges; } if (isOwner) { if (ace.decode(this, false, null, Ace.whoTypeOwner)) { privileges = ace.getHow(); } else { privileges = defaultOwnerPrivileges; } break getPrivileges; } // Not owner - look for user if (ace.decode(this, false, who.getAccount(), Ace.whoTypeUser)) { privileges = ace.getHow(); if (debug) { debugsb.append("... For user got: " + new String(privileges)); } break getPrivileges; } // No specific user access - look for group access if (who.getGroupNames() != null) { Iterator it = who.getGroupNames().iterator(); while (it.hasNext()) { String group = (String)it.next(); if (debug) { debugsb.append("...Try access for group " + group); } if (ace.decode(this, false, group, Ace.whoTypeGroup)) { privileges = mergePrivileges(privileges, ace.getHow()); } } } if (privileges != null) { if (debug) { debugsb.append("...For groups got: " + new String(privileges)); } break getPrivileges; } // "other" access set? if (ace.decode(this, false, null, Ace.whoTypeOther)) { privileges = ace.getHow(); if (debug) { debugsb.append("...For other got: " + new String(privileges)); } break getPrivileges; } } // getPrivileges if (privileges == null) { if (debug) { debugMsg(debugsb.toString() + "...Check access denied (noprivs)"); } return false; } for (int i = 0; i < how.length; i++) { char priv = privileges[how[i].getIndex()]; if (priv == unspecified) { if (isOwner) { priv = allowed; } else { priv = denied; } } if (priv != allowed) { if (debug) { debugMsg(debugsb.toString() + "...Check access denied (!allowed)"); } return false; } } if (debug) { debugMsg(debugsb.toString() + "...Check access allowed"); } return true; } |
for (int i = 0; i < how.length; i++) { char priv = privileges[how[i].getIndex()]; if (priv == unspecified) { | ca.privileges = (char[])ca.privileges.clone(); for (int pi = 0; pi < ca.privileges.length; pi++) { if (ca.privileges[pi] == unspecified) { | public synchronized boolean evaluateAccess(AccessPrincipal who, String owner, Privilege[] how, char[] acl) throws AccessException { boolean authenticated = !who.getUnauthenticated(); boolean isOwner = false; char[] privileges = null; setEncoded(acl); if (authenticated) { isOwner = who.getAccount().equals(owner); } StringBuffer debugsb = null; if (debug) { debugsb = new StringBuffer("Check access for '"); debugsb.append(new String(acl)); debugsb.append("' with authenticated = "); debugsb.append(authenticated); debugsb.append(" isOwner = "); debugsb.append(isOwner); } getPrivileges: { if (!authenticated) { if (ace.decode(this, false, null, Ace.whoTypeUnauthenticated)) { privileges = ace.getHow(); } break getPrivileges; } if (isOwner) { if (ace.decode(this, false, null, Ace.whoTypeOwner)) { privileges = ace.getHow(); } else { privileges = defaultOwnerPrivileges; } break getPrivileges; } // Not owner - look for user if (ace.decode(this, false, who.getAccount(), Ace.whoTypeUser)) { privileges = ace.getHow(); if (debug) { debugsb.append("... For user got: " + new String(privileges)); } break getPrivileges; } // No specific user access - look for group access if (who.getGroupNames() != null) { Iterator it = who.getGroupNames().iterator(); while (it.hasNext()) { String group = (String)it.next(); if (debug) { debugsb.append("...Try access for group " + group); } if (ace.decode(this, false, group, Ace.whoTypeGroup)) { privileges = mergePrivileges(privileges, ace.getHow()); } } } if (privileges != null) { if (debug) { debugsb.append("...For groups got: " + new String(privileges)); } break getPrivileges; } // "other" access set? if (ace.decode(this, false, null, Ace.whoTypeOther)) { privileges = ace.getHow(); if (debug) { debugsb.append("...For other got: " + new String(privileges)); } break getPrivileges; } } // getPrivileges if (privileges == null) { if (debug) { debugMsg(debugsb.toString() + "...Check access denied (noprivs)"); } return false; } for (int i = 0; i < how.length; i++) { char priv = privileges[how[i].getIndex()]; if (priv == unspecified) { if (isOwner) { priv = allowed; } else { priv = denied; } } if (priv != allowed) { if (debug) { debugMsg(debugsb.toString() + "...Check access denied (!allowed)"); } return false; } } if (debug) { debugMsg(debugsb.toString() + "...Check access allowed"); } return true; } |
priv = allowed; | ca.privileges[pi] = allowed; | public synchronized boolean evaluateAccess(AccessPrincipal who, String owner, Privilege[] how, char[] acl) throws AccessException { boolean authenticated = !who.getUnauthenticated(); boolean isOwner = false; char[] privileges = null; setEncoded(acl); if (authenticated) { isOwner = who.getAccount().equals(owner); } StringBuffer debugsb = null; if (debug) { debugsb = new StringBuffer("Check access for '"); debugsb.append(new String(acl)); debugsb.append("' with authenticated = "); debugsb.append(authenticated); debugsb.append(" isOwner = "); debugsb.append(isOwner); } getPrivileges: { if (!authenticated) { if (ace.decode(this, false, null, Ace.whoTypeUnauthenticated)) { privileges = ace.getHow(); } break getPrivileges; } if (isOwner) { if (ace.decode(this, false, null, Ace.whoTypeOwner)) { privileges = ace.getHow(); } else { privileges = defaultOwnerPrivileges; } break getPrivileges; } // Not owner - look for user if (ace.decode(this, false, who.getAccount(), Ace.whoTypeUser)) { privileges = ace.getHow(); if (debug) { debugsb.append("... For user got: " + new String(privileges)); } break getPrivileges; } // No specific user access - look for group access if (who.getGroupNames() != null) { Iterator it = who.getGroupNames().iterator(); while (it.hasNext()) { String group = (String)it.next(); if (debug) { debugsb.append("...Try access for group " + group); } if (ace.decode(this, false, group, Ace.whoTypeGroup)) { privileges = mergePrivileges(privileges, ace.getHow()); } } } if (privileges != null) { if (debug) { debugsb.append("...For groups got: " + new String(privileges)); } break getPrivileges; } // "other" access set? if (ace.decode(this, false, null, Ace.whoTypeOther)) { privileges = ace.getHow(); if (debug) { debugsb.append("...For other got: " + new String(privileges)); } break getPrivileges; } } // getPrivileges if (privileges == null) { if (debug) { debugMsg(debugsb.toString() + "...Check access denied (noprivs)"); } return false; } for (int i = 0; i < how.length; i++) { char priv = privileges[how[i].getIndex()]; if (priv == unspecified) { if (isOwner) { priv = allowed; } else { priv = denied; } } if (priv != allowed) { if (debug) { debugMsg(debugsb.toString() + "...Check access denied (!allowed)"); } return false; } } if (debug) { debugMsg(debugsb.toString() + "...Check access allowed"); } return true; } |
priv = denied; | ca.privileges[pi] = denied; | public synchronized boolean evaluateAccess(AccessPrincipal who, String owner, Privilege[] how, char[] acl) throws AccessException { boolean authenticated = !who.getUnauthenticated(); boolean isOwner = false; char[] privileges = null; setEncoded(acl); if (authenticated) { isOwner = who.getAccount().equals(owner); } StringBuffer debugsb = null; if (debug) { debugsb = new StringBuffer("Check access for '"); debugsb.append(new String(acl)); debugsb.append("' with authenticated = "); debugsb.append(authenticated); debugsb.append(" isOwner = "); debugsb.append(isOwner); } getPrivileges: { if (!authenticated) { if (ace.decode(this, false, null, Ace.whoTypeUnauthenticated)) { privileges = ace.getHow(); } break getPrivileges; } if (isOwner) { if (ace.decode(this, false, null, Ace.whoTypeOwner)) { privileges = ace.getHow(); } else { privileges = defaultOwnerPrivileges; } break getPrivileges; } // Not owner - look for user if (ace.decode(this, false, who.getAccount(), Ace.whoTypeUser)) { privileges = ace.getHow(); if (debug) { debugsb.append("... For user got: " + new String(privileges)); } break getPrivileges; } // No specific user access - look for group access if (who.getGroupNames() != null) { Iterator it = who.getGroupNames().iterator(); while (it.hasNext()) { String group = (String)it.next(); if (debug) { debugsb.append("...Try access for group " + group); } if (ace.decode(this, false, group, Ace.whoTypeGroup)) { privileges = mergePrivileges(privileges, ace.getHow()); } } } if (privileges != null) { if (debug) { debugsb.append("...For groups got: " + new String(privileges)); } break getPrivileges; } // "other" access set? if (ace.decode(this, false, null, Ace.whoTypeOther)) { privileges = ace.getHow(); if (debug) { debugsb.append("...For other got: " + new String(privileges)); } break getPrivileges; } } // getPrivileges if (privileges == null) { if (debug) { debugMsg(debugsb.toString() + "...Check access denied (noprivs)"); } return false; } for (int i = 0; i < how.length; i++) { char priv = privileges[how[i].getIndex()]; if (priv == unspecified) { if (isOwner) { priv = allowed; } else { priv = denied; } } if (priv != allowed) { if (debug) { debugMsg(debugsb.toString() + "...Check access denied (!allowed)"); } return false; } } if (debug) { debugMsg(debugsb.toString() + "...Check access allowed"); } return true; } |
return true; | ca.accessAllowed = true; return ca; | public synchronized boolean evaluateAccess(AccessPrincipal who, String owner, Privilege[] how, char[] acl) throws AccessException { boolean authenticated = !who.getUnauthenticated(); boolean isOwner = false; char[] privileges = null; setEncoded(acl); if (authenticated) { isOwner = who.getAccount().equals(owner); } StringBuffer debugsb = null; if (debug) { debugsb = new StringBuffer("Check access for '"); debugsb.append(new String(acl)); debugsb.append("' with authenticated = "); debugsb.append(authenticated); debugsb.append(" isOwner = "); debugsb.append(isOwner); } getPrivileges: { if (!authenticated) { if (ace.decode(this, false, null, Ace.whoTypeUnauthenticated)) { privileges = ace.getHow(); } break getPrivileges; } if (isOwner) { if (ace.decode(this, false, null, Ace.whoTypeOwner)) { privileges = ace.getHow(); } else { privileges = defaultOwnerPrivileges; } break getPrivileges; } // Not owner - look for user if (ace.decode(this, false, who.getAccount(), Ace.whoTypeUser)) { privileges = ace.getHow(); if (debug) { debugsb.append("... For user got: " + new String(privileges)); } break getPrivileges; } // No specific user access - look for group access if (who.getGroupNames() != null) { Iterator it = who.getGroupNames().iterator(); while (it.hasNext()) { String group = (String)it.next(); if (debug) { debugsb.append("...Try access for group " + group); } if (ace.decode(this, false, group, Ace.whoTypeGroup)) { privileges = mergePrivileges(privileges, ace.getHow()); } } } if (privileges != null) { if (debug) { debugsb.append("...For groups got: " + new String(privileges)); } break getPrivileges; } // "other" access set? if (ace.decode(this, false, null, Ace.whoTypeOther)) { privileges = ace.getHow(); if (debug) { debugsb.append("...For other got: " + new String(privileges)); } break getPrivileges; } } // getPrivileges if (privileges == null) { if (debug) { debugMsg(debugsb.toString() + "...Check access denied (noprivs)"); } return false; } for (int i = 0; i < how.length; i++) { char priv = privileges[how[i].getIndex()]; if (priv == unspecified) { if (isOwner) { priv = allowed; } else { priv = denied; } } if (priv != allowed) { if (debug) { debugMsg(debugsb.toString() + "...Check access denied (!allowed)"); } return false; } } if (debug) { debugMsg(debugsb.toString() + "...Check access allowed"); } return true; } |
IdeaReader reader = factory.read(new File("etc/test.opml")); rootIdea = reader.getIdea(); rootView = new IdeaView(rootIdea); | try { IdeaReader reader = factory.read(new File("etc/test.opml")); rootIdea = reader.getIdea(); rootView = new IdeaView(rootIdea); } catch(ReaderException re) { re.printStackTrace(); } | private void buildModel() { ReaderFactory factory = ReaderFactory.getInstance(); IdeaReader reader = factory.read(new File("etc/test.opml")); rootIdea = reader.getIdea(); rootView = new IdeaView(rootIdea); // rootIdea = new Idea("Persistence");// System.out.println("rootIdea = " + rootIdea);// rootView = new IdeaView(rootIdea);//////// Idea mistakes = new Idea("Mistakes");// Idea platforms = new Idea("Platforms");// mistakes.add(platforms);// Idea attempts = new Idea("Attempts");// platforms.add(attempts);// Idea continual = new Idea("Continual");// attempts.add(continual);// Idea further = new Idea("Further");// attempts.add(further);// Idea enjoyed = new Idea("Enjoyed");// attempts.add(enjoyed);// Idea thousands = new Idea("Thousands");// mistakes.add(thousands);// Idea making = new Idea("Making");// mistakes.add(making);// Idea progress = new Idea("Progress");// mistakes.add(progress);// Idea learning = new Idea("Learning");// rootIdea.add(learning);// Idea love = new Idea("Love");// learning.add(love);// love.add(mistakes);// rootIdea.add(mistakes); // final int lines = 15;// (new Thread(){public void run() {// for (int i = 0; i < lines; i++) {// Idea fred2 = new Idea();// synchronized(rootIdea) {// rootIdea.add(fred2);// timeAdded = System.currentTimeMillis();// }// //try { Thread.sleep(100);} catch(Exception e){}// }//// Idea sub = rootIdea.getSubIdeas().get(0);//// Idea subIdea0 = null;// for (int i = 0; i < 4; i++) {// subIdea0 = new Idea();// sub.add(subIdea0);// timeAdded = System.currentTimeMillis();// try { Thread.sleep(1000);} catch(Exception e){}// }//// Idea s2 = subIdea0;// for (int i = 0; i < 6; i++) {// Idea subIdea2 = new Idea();// s2.add(subIdea2);// timeAdded = System.currentTimeMillis();// try { Thread.sleep(1000);} catch(Exception e){}// }// }}).start(); } |
if (timeAdded == 0) { timeAdded = System.currentTimeMillis(); | if (timeChanged == 0) { timeChanged = System.currentTimeMillis(); | private Point2D tweakIdeas(final Vector<IdeaView> views, final Point2D c, final double initAngle, final boolean hasParent) { if (views.size() == 0) { return new Point2D.Double(0.0, 0.0); } double mass = 2000.0 / (points.size() * Math.sqrt((double)points.size())); double totForceX = 0.0; double totForceY = 0.0; if (timeAdded == 0) { timeAdded = System.currentTimeMillis(); } long now = System.currentTimeMillis(); double maxSpeed = 0.0; if ((now - timeAdded) < (MAX_MOVE_TIME_SECS * 1000.0)) { maxSpeed = MAX_SPEED - ((now - timeAdded) * MAX_SPEED / 1000.0 / MAX_MOVE_TIME_SECS); } synchronized(views) { double minDiffAngle = Math.PI / 2 / views.size(); for (int i = 0; i < views.size(); i++) { IdeaView previousView = null; IdeaView nextView = null; IdeaView view = views.get(i); if (i > 0) { previousView = views.get(i - 1); } if (i < views.size() - 1) { nextView = views.get(i + 1); } Point2D point = getPoint(view, c, initAngle); double forceX = 0.0; double forceY = 0.0; for(Point2D other: points) { double dirX = point.getX() - other.getX(); double dirY = point.getY() - other.getY(); double dSquare = point.distanceSq(other); if (dSquare > 0.000001) { double unitFactor = point.distance(other); forceX += (dirX / unitFactor) * (mass * mass / dSquare); if (forceX > 1.0) { forceX = 1.0; } if (forceX < -1.0) { forceX = -1.0; } forceY += (dirY / unitFactor) * (mass * mass / dSquare); if (forceY > 1.0) { forceY = 1.0; } if (forceY < -1.0) { forceY = -1.0; } } } Point2D p2 = getPoint(view, ORIGIN, initAngle); Point2D tf = tweakIdeas(view.getSubViews(), point, view.getAngle(), true); forceX += tf.getX(); forceY += tf.getY(); double sideForce = (p2.getY() * forceX) + (-p2.getX() * forceY); totForceX += forceX; totForceY += forceY; double v = view.getV(); v += sideForce / mass; v *= 0.90; if (v > maxSpeed) { v = maxSpeed; } if (v < -maxSpeed) { v = -maxSpeed; } view.setV(v); double oldAngle = view.getAngle(); double newAngle = oldAngle + (view.getV() / view.getLength()); if (previousView != null) { double previousAngle = previousView.getAngle(); if (previousAngle > newAngle - minDiffAngle) { previousView.setAngle(newAngle - minDiffAngle); newAngle = previousAngle + minDiffAngle; double previousV = previousView.getV(); double diffV = v - previousV; if (diffV > 0) { view.setV(diffV); previousView.setV(-diffV); } else { view.setV(-diffV); previousView.setV(diffV); } v = view.getV(); } } else { double previousAngle = -Math.PI; if (!hasParent) { previousAngle = views.get(views.size() - 1).getAngle() - 2 * Math.PI; } if (previousAngle > newAngle - minDiffAngle) { newAngle = previousAngle + minDiffAngle; double previousV = 0.0; double diffV = v - previousV; if (diffV > 0) { view.setV(diffV); } else { view.setV(-diffV); } v = view.getV(); } } if (nextView != null) { double nextAngle = nextView.getAngle(); if (nextAngle < newAngle + minDiffAngle) { nextView.setAngle(newAngle + minDiffAngle); newAngle = nextAngle - minDiffAngle; double nextV = nextView.getV(); double diffV = 0.0; if (diffV > 0) { view.setV(-diffV); nextView.setV(diffV); } else { view.setV(diffV); nextView.setV(-diffV); } v = view.getV(); } } else { double nextAngle = Math.PI; if (!hasParent) { nextAngle = views.get(0).getAngle() + 2 * Math.PI; } if (nextAngle < newAngle + minDiffAngle) { newAngle = nextAngle - minDiffAngle; double nextV = 0.0; double diffV = 0.0; if (diffV > 0) { view.setV(-diffV); } else { view.setV(diffV); } v = view.getV(); } } view.setAngle(newAngle); } } return new Point2D.Double(totForceX, totForceY); } |
if ((now - timeAdded) < (MAX_MOVE_TIME_SECS * 1000.0)) { maxSpeed = MAX_SPEED - ((now - timeAdded) * MAX_SPEED / 1000.0 | if ((now - timeChanged) < (MAX_MOVE_TIME_SECS * 1000.0)) { maxSpeed = MAX_SPEED - ((now - timeChanged) * MAX_SPEED / 1000.0 | private Point2D tweakIdeas(final Vector<IdeaView> views, final Point2D c, final double initAngle, final boolean hasParent) { if (views.size() == 0) { return new Point2D.Double(0.0, 0.0); } double mass = 2000.0 / (points.size() * Math.sqrt((double)points.size())); double totForceX = 0.0; double totForceY = 0.0; if (timeAdded == 0) { timeAdded = System.currentTimeMillis(); } long now = System.currentTimeMillis(); double maxSpeed = 0.0; if ((now - timeAdded) < (MAX_MOVE_TIME_SECS * 1000.0)) { maxSpeed = MAX_SPEED - ((now - timeAdded) * MAX_SPEED / 1000.0 / MAX_MOVE_TIME_SECS); } synchronized(views) { double minDiffAngle = Math.PI / 2 / views.size(); for (int i = 0; i < views.size(); i++) { IdeaView previousView = null; IdeaView nextView = null; IdeaView view = views.get(i); if (i > 0) { previousView = views.get(i - 1); } if (i < views.size() - 1) { nextView = views.get(i + 1); } Point2D point = getPoint(view, c, initAngle); double forceX = 0.0; double forceY = 0.0; for(Point2D other: points) { double dirX = point.getX() - other.getX(); double dirY = point.getY() - other.getY(); double dSquare = point.distanceSq(other); if (dSquare > 0.000001) { double unitFactor = point.distance(other); forceX += (dirX / unitFactor) * (mass * mass / dSquare); if (forceX > 1.0) { forceX = 1.0; } if (forceX < -1.0) { forceX = -1.0; } forceY += (dirY / unitFactor) * (mass * mass / dSquare); if (forceY > 1.0) { forceY = 1.0; } if (forceY < -1.0) { forceY = -1.0; } } } Point2D p2 = getPoint(view, ORIGIN, initAngle); Point2D tf = tweakIdeas(view.getSubViews(), point, view.getAngle(), true); forceX += tf.getX(); forceY += tf.getY(); double sideForce = (p2.getY() * forceX) + (-p2.getX() * forceY); totForceX += forceX; totForceY += forceY; double v = view.getV(); v += sideForce / mass; v *= 0.90; if (v > maxSpeed) { v = maxSpeed; } if (v < -maxSpeed) { v = -maxSpeed; } view.setV(v); double oldAngle = view.getAngle(); double newAngle = oldAngle + (view.getV() / view.getLength()); if (previousView != null) { double previousAngle = previousView.getAngle(); if (previousAngle > newAngle - minDiffAngle) { previousView.setAngle(newAngle - minDiffAngle); newAngle = previousAngle + minDiffAngle; double previousV = previousView.getV(); double diffV = v - previousV; if (diffV > 0) { view.setV(diffV); previousView.setV(-diffV); } else { view.setV(-diffV); previousView.setV(diffV); } v = view.getV(); } } else { double previousAngle = -Math.PI; if (!hasParent) { previousAngle = views.get(views.size() - 1).getAngle() - 2 * Math.PI; } if (previousAngle > newAngle - minDiffAngle) { newAngle = previousAngle + minDiffAngle; double previousV = 0.0; double diffV = v - previousV; if (diffV > 0) { view.setV(diffV); } else { view.setV(-diffV); } v = view.getV(); } } if (nextView != null) { double nextAngle = nextView.getAngle(); if (nextAngle < newAngle + minDiffAngle) { nextView.setAngle(newAngle + minDiffAngle); newAngle = nextAngle - minDiffAngle; double nextV = nextView.getV(); double diffV = 0.0; if (diffV > 0) { view.setV(-diffV); nextView.setV(diffV); } else { view.setV(diffV); nextView.setV(-diffV); } v = view.getV(); } } else { double nextAngle = Math.PI; if (!hasParent) { nextAngle = views.get(0).getAngle() + 2 * Math.PI; } if (nextAngle < newAngle + minDiffAngle) { newAngle = nextAngle - minDiffAngle; double nextV = 0.0; double diffV = 0.0; if (diffV > 0) { view.setV(-diffV); } else { view.setV(diffV); } v = view.getV(); } } view.setAngle(newAngle); } } return new Point2D.Double(totForceX, totForceY); } |
parentView.remove(selected); | parentView.getIdea().remove(selected.getIdea()); | private void deleteSelected() { final IdeaView selected = this.ideaMap.getSelectedView(); if (selected == null) { return; } MapComponent parent = selected.getParent(); if (!(parent instanceof IdeaView)) { return; } IdeaView parentView = (IdeaView)parent; IdeaView nextToSelect = null; IdeaView nextSibling = selected.getNextSibling(); IdeaView previousSibling = selected.getPreviousSibling(); if (nextSibling != null) { nextToSelect = nextSibling; } else if (previousSibling != null) { nextToSelect = previousSibling; } else { nextToSelect = parentView; } parentView.remove(selected); this.ideaMap.setSelectedView(nextToSelect); } |
new DumpEvents(globals).dumpSection(di.getEventAnnotations()); | new DumpEventAnnotations(globals).dumpSection(di.getEventAnnotations()); | public void dumpSection(Iterator it) throws Throwable { tagStart(dumpTag); info("Dumping system parameters."); di.open(); new DumpSyspars(globals).dumpSection(di.getSyspars()); di.close(); info("Dumping users."); di.open(); new DumpUsers(globals).dumpSection(di.getUsers()); di.close(); info("Dumping timezones."); di.open(); new DumpTimeZones(globals).dumpSection(di.getTimeZones()); di.close(); info("Dumping calendars."); di.open(); new DumpCalendars(globals).dumpSection(di.getCalendars()); di.close(); info("Dumping locations."); di.open(); new DumpLocations(globals).dumpSection(di.getLocations()); di.close(); info("Dumping sponsors."); di.open(); new DumpSponsors(globals).dumpSection(di.getSponsors()); di.close(); info("Dumping organizers."); di.open(); new DumpOrganizers(globals).dumpSection(di.getOrganizers()); di.close(); info("Dumping attendees."); di.open(); new DumpAttendees(globals).dumpSection(di.getAttendees()); di.close(); info("Dumping alarms."); di.open(); new DumpAlarms(globals).dumpSection(di.getAlarms()); di.close(); info("Dumping categories."); di.open(); new DumpCategories(globals).dumpSection(di.getCategories()); di.close(); /* These all reference the above */ info("Dumping auth users (and prefs)."); di.open(); new DumpAuthUsers(globals).dumpSection(di.getAuthUsers()); di.close(); info("Dumping events."); di.open(); new DumpEvents(globals).dumpSection(di.getEvents()); di.close(); info("Dumping event annotations."); di.open(); new DumpEvents(globals).dumpSection(di.getEventAnnotations()); di.close(); /* info("Dumping filters."); di.open(); new DumpFilters(globals).dumpSection(di.getFilters()); di.close(); */ info("Dumping admin groups."); di.open(); new DumpAdminGroups(globals).dumpSection(di.getAdminGroups()); di.close(); info("Dumping user preferences."); di.open(); new DumpUserPrefs(globals).dumpSection(di.getPreferences()); di.close(); /* info("Dumping lastmods."); di.open(); new DumpDbLastmods(globals).dumpSection(di.getDbLastmods()); di.close(); */ tagEnd(dumpTag); } |
if (!access.accessible(subroot, desiredAccess, nullForNoAccess)) { | CurrentAccess ca = access.checkAccess(subroot, desiredAccess, nullForNoAccess); if (!ca.accessAllowed) { | private BwCalendar cloneAndCheckOne(BwCalendar subroot, int desiredAccess, boolean nullForNoAccess) throws CalFacadeException { if (!access.accessible(subroot, desiredAccess, nullForNoAccess)) { return null; } BwCalendar cal = (BwCalendar)subroot.clone(); // XXX Temp fix - add id to the clone cal.setId(subroot.getId()); Iterator it = subroot.iterateChildren(); while (it.hasNext()) { BwCalendar child = (BwCalendar)it.next(); child = cloneAndCheckOne(child, desiredAccess, nullForNoAccess); if (child != null) { cal.addChild(child); } } return cal; } |
cal.setCurrentAccess(ca); | private BwCalendar cloneAndCheckOne(BwCalendar subroot, int desiredAccess, boolean nullForNoAccess) throws CalFacadeException { if (!access.accessible(subroot, desiredAccess, nullForNoAccess)) { return null; } BwCalendar cal = (BwCalendar)subroot.clone(); // XXX Temp fix - add id to the clone cal.setId(subroot.getId()); Iterator it = subroot.iterateChildren(); while (it.hasNext()) { BwCalendar child = (BwCalendar)it.next(); child = cloneAndCheckOne(child, desiredAccess, nullForNoAccess); if (child != null) { cal.addChild(child); } } return cal; } |
|
ical = trans.toIcal(event); | ical = trans.toIcal(eventInfo.getEvent()); | public Calendar getIcal() throws WebdavIntfException { init(true); try { if (ical == null) { if (events.size() == 1) { ical = trans.toIcal(event); } else { // recurring ical = trans.toIcal(events); } } if ((veventString == null)) { veventString = ical.toString(); contentLen = veventString.length(); } } catch (Throwable t) { throw new WebdavIntfException(t); } return ical; } |
if ((event != null) && (vevent == null)) { Calendar ical = trans.toIcal(event); | if ((eventInfo != null) && (vevent == null)) { Calendar ical = trans.toIcal(eventInfo.getEvent()); | public Component getVevent() throws WebdavIntfException { init(true); try { if ((event != null) && (vevent == null)) { Calendar ical = trans.toIcal(event); if (events.size() == 1) { this.ical = ical; // Save doing it again } vevent = (VEvent)ical.getComponents().getComponent(Component.VEVENT); /* vevent = trans.toIcalEvent(event); ical = trans.newIcal(); IcalUtil.addComponent(ical, vevent); */ // XXX Add the timezones if needed comp = new ComponentWrapper(vevent); } } catch (Throwable t) { throw new WebdavIntfException(t); } return vevent; } |
if ((event == null) && exists) { | if ((eventInfo == null) && exists) { | public void init(boolean content) throws WebdavIntfException { if (!content) { return; } try { if ((event == null) && exists) { String entityName = cdURI.getEntityName(); if (entityName == null) { return; } if (debug) { debugMsg("SEARCH: compNode retrieve event on path " + cdURI.getCal().getPath() + " with name " + entityName); } if (events == null) { events = svci.findEventsByName(cdURI.getCal(), entityName); } if ((events == null) || (events.size() == 0)) { exists = false; } else { if (events.size() == 1) { /* Non recurring or no overrides */ event = (BwEvent)events.iterator().next(); } else { /* Find the master */ // XXX Check the guids here? Iterator it = events.iterator(); while (it.hasNext()) { BwEvent ev = (BwEvent)it.next(); if (ev.getRecurring()) { event = ev; } } if (event == null) { throw new WebdavIntfException("Missing master for " + cdURI); } } } } if (event != null) { creDate = event.getCreated(); lastmodDate = event.getLastmod(); } name = cdURI.getEntityName(); } catch (WebdavIntfException wie) { throw wie; } catch (Throwable t) { throw new WebdavIntfException(t); } } |
event = (BwEvent)events.iterator().next(); | eventInfo = (EventInfo)events.iterator().next(); | public void init(boolean content) throws WebdavIntfException { if (!content) { return; } try { if ((event == null) && exists) { String entityName = cdURI.getEntityName(); if (entityName == null) { return; } if (debug) { debugMsg("SEARCH: compNode retrieve event on path " + cdURI.getCal().getPath() + " with name " + entityName); } if (events == null) { events = svci.findEventsByName(cdURI.getCal(), entityName); } if ((events == null) || (events.size() == 0)) { exists = false; } else { if (events.size() == 1) { /* Non recurring or no overrides */ event = (BwEvent)events.iterator().next(); } else { /* Find the master */ // XXX Check the guids here? Iterator it = events.iterator(); while (it.hasNext()) { BwEvent ev = (BwEvent)it.next(); if (ev.getRecurring()) { event = ev; } } if (event == null) { throw new WebdavIntfException("Missing master for " + cdURI); } } } } if (event != null) { creDate = event.getCreated(); lastmodDate = event.getLastmod(); } name = cdURI.getEntityName(); } catch (WebdavIntfException wie) { throw wie; } catch (Throwable t) { throw new WebdavIntfException(t); } } |
BwEvent ev = (BwEvent)it.next(); | EventInfo ei = (EventInfo)it.next(); | public void init(boolean content) throws WebdavIntfException { if (!content) { return; } try { if ((event == null) && exists) { String entityName = cdURI.getEntityName(); if (entityName == null) { return; } if (debug) { debugMsg("SEARCH: compNode retrieve event on path " + cdURI.getCal().getPath() + " with name " + entityName); } if (events == null) { events = svci.findEventsByName(cdURI.getCal(), entityName); } if ((events == null) || (events.size() == 0)) { exists = false; } else { if (events.size() == 1) { /* Non recurring or no overrides */ event = (BwEvent)events.iterator().next(); } else { /* Find the master */ // XXX Check the guids here? Iterator it = events.iterator(); while (it.hasNext()) { BwEvent ev = (BwEvent)it.next(); if (ev.getRecurring()) { event = ev; } } if (event == null) { throw new WebdavIntfException("Missing master for " + cdURI); } } } } if (event != null) { creDate = event.getCreated(); lastmodDate = event.getLastmod(); } name = cdURI.getEntityName(); } catch (WebdavIntfException wie) { throw wie; } catch (Throwable t) { throw new WebdavIntfException(t); } } |
if (ev.getRecurring()) { event = ev; | if (ei.getEvent().getRecurring()) { eventInfo = ei; | public void init(boolean content) throws WebdavIntfException { if (!content) { return; } try { if ((event == null) && exists) { String entityName = cdURI.getEntityName(); if (entityName == null) { return; } if (debug) { debugMsg("SEARCH: compNode retrieve event on path " + cdURI.getCal().getPath() + " with name " + entityName); } if (events == null) { events = svci.findEventsByName(cdURI.getCal(), entityName); } if ((events == null) || (events.size() == 0)) { exists = false; } else { if (events.size() == 1) { /* Non recurring or no overrides */ event = (BwEvent)events.iterator().next(); } else { /* Find the master */ // XXX Check the guids here? Iterator it = events.iterator(); while (it.hasNext()) { BwEvent ev = (BwEvent)it.next(); if (ev.getRecurring()) { event = ev; } } if (event == null) { throw new WebdavIntfException("Missing master for " + cdURI); } } } } if (event != null) { creDate = event.getCreated(); lastmodDate = event.getLastmod(); } name = cdURI.getEntityName(); } catch (WebdavIntfException wie) { throw wie; } catch (Throwable t) { throw new WebdavIntfException(t); } } |
if (event == null) { | if (eventInfo == null) { | public void init(boolean content) throws WebdavIntfException { if (!content) { return; } try { if ((event == null) && exists) { String entityName = cdURI.getEntityName(); if (entityName == null) { return; } if (debug) { debugMsg("SEARCH: compNode retrieve event on path " + cdURI.getCal().getPath() + " with name " + entityName); } if (events == null) { events = svci.findEventsByName(cdURI.getCal(), entityName); } if ((events == null) || (events.size() == 0)) { exists = false; } else { if (events.size() == 1) { /* Non recurring or no overrides */ event = (BwEvent)events.iterator().next(); } else { /* Find the master */ // XXX Check the guids here? Iterator it = events.iterator(); while (it.hasNext()) { BwEvent ev = (BwEvent)it.next(); if (ev.getRecurring()) { event = ev; } } if (event == null) { throw new WebdavIntfException("Missing master for " + cdURI); } } } } if (event != null) { creDate = event.getCreated(); lastmodDate = event.getLastmod(); } name = cdURI.getEntityName(); } catch (WebdavIntfException wie) { throw wie; } catch (Throwable t) { throw new WebdavIntfException(t); } } |
if (event != null) { | if (eventInfo != null) { BwEvent event = eventInfo.getEvent(); | public void init(boolean content) throws WebdavIntfException { if (!content) { return; } try { if ((event == null) && exists) { String entityName = cdURI.getEntityName(); if (entityName == null) { return; } if (debug) { debugMsg("SEARCH: compNode retrieve event on path " + cdURI.getCal().getPath() + " with name " + entityName); } if (events == null) { events = svci.findEventsByName(cdURI.getCal(), entityName); } if ((events == null) || (events.size() == 0)) { exists = false; } else { if (events.size() == 1) { /* Non recurring or no overrides */ event = (BwEvent)events.iterator().next(); } else { /* Find the master */ // XXX Check the guids here? Iterator it = events.iterator(); while (it.hasNext()) { BwEvent ev = (BwEvent)it.next(); if (ev.getRecurring()) { event = ev; } } if (event == null) { throw new WebdavIntfException("Missing master for " + cdURI); } } } } if (event != null) { creDate = event.getCreated(); lastmodDate = event.getLastmod(); } name = cdURI.getEntityName(); } catch (WebdavIntfException wie) { throw wie; } catch (Throwable t) { throw new WebdavIntfException(t); } } |
logger.debug(ExceptionReporterUtils.getMemoryUsage()+" after write image to file"); | public void writeMapToPNG(String filename) throws IOException { synchronized(OpenMap.class) { Projection proj = mapBean.getProjection(); int w = proj.getWidth(), h = proj.getHeight(); logger.debug(ExceptionReporterUtils.getMemoryUsage()+" before make Buf Image"); BufferedImage bufImg = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB); Graphics g = bufImg.getGraphics(); g.setColor(WATER); g.fillRect(0,0,w,h); Layer[] layers = getLayers(); for (int i = layers.length - 1; i >= 0; i--){ layers[i].renderDataForProjection(proj, g); } File loc = new File(filename); File parent = loc.getParentFile(); parent.mkdirs(); File temp = File.createTempFile(loc.getName(), null, parent); ImageIO.write(bufImg, "png", temp); loc.delete(); temp.renameTo(loc); } } |
|
private void generateGenericAmp(){ | protected void generateGenericAmp(){ | private void generateGenericAmp(){ // Currently, we only do "real world units" in the case of one seismogram // eventually, the overlays should if(amps.length == 0){ genericAmp = DisplayUtils.ONE_RANGE; } else if(amps.length == 1){ genericAmp = UnitDisplayUtil.getRealWorldUnitRange(amps[0], seismos[0]); }else{ boolean equal = true; for(int i = 1; i < amps.length; i++){ if(!amps[i].equals(amps[i-1])){ equal = false; i = amps.length; } } if(equal){ genericAmp = amps[0]; }else{ double halfRange = (amps[0].getMaxValue() - amps[0].getMinValue())/2; genericAmp = new UnitRangeImpl(-halfRange, halfRange, amps[0].getUnit()); } } } |
taggedEntityId(o); | ownedEntityTags(o); | private void dumpOrganizer(BwOrganizer o) throws Throwable { tagStart(objectOrganizer); taggedEntityId(o); taggedVal("cn", o.getCn()); taggedVal("dir", o.getDir()); taggedVal("lang", o.getLanguage()); taggedVal("sent-by", o.getSentBy()); taggedVal("organizer-uri", o.getOrganizerUri()); tagEnd(objectOrganizer); globals.organizers++; } |
dtim.init(false, fldval, null, globals.getTzcache()); | dtim.init(dateType, dtVal, tzid, globals.getTzcache()); | protected BwDateTime dateTimeFld() throws Exception { if (fldval == null) { throw new Exception("No value for " + tagName); } try { BwDateTime dtim = new BwDateTime(); dtim.init(false, fldval, null, globals.getTzcache()); return dtim; } catch (Throwable t) { throw new Exception(t); } } |
strCCExpire = yearExpires + monthExpires; | strCCExpire = monthExpires + yearExpires; | public String doSale(String nameOnCard, String cardnumber, String monthExpires, String yearExpires, String ccVerifyNumber, double amount, String currency, String referenceNumber) throws CreditCardAuthorizationException { try { IWTimestamp stamp = IWTimestamp.RightNow(); strName = nameOnCard; strCCNumber = cardnumber; strCCExpire = yearExpires + monthExpires; strCCVerify = ccVerifyNumber; setCurrencyAndAmount(currency, amount); strCurrentDate = getDateString(stamp); strReferenceNumber = convertStringToNumbers(referenceNumber); StringBuffer logText = new StringBuffer(); //System.out.println("referenceNumber => " + strReferenceNumber); Hashtable returnedProperties = getFirstResponse(); String authCode = null; if (returnedProperties != null) { logText.append("Authorization successful"); Hashtable returnedCaptureProperties = finishTransaction(returnedProperties); if (returnedCaptureProperties != null && returnedCaptureProperties.get(PROPERTY_APPROVAL_CODE).toString() != null) { //System.out.println("Approval Code = // "+returnedCaptureProperties.get(PROPERTY_APPROVAL_CODE).toString()); authCode = returnedCaptureProperties.get(PROPERTY_APPROVAL_CODE).toString();//returnedCaptureProperties; logText.append("\nCapture successful").append("\nAuthorization Code = " + authCode); logText.append("\nAction Code = " + returnedCaptureProperties.get(PROPERTY_ACTION_CODE).toString()); try { String tmpCardNum = CreditCardBusinessBean.encodeCreditCardNumber(cardnumber); this.storeAuthorizationEntry(tmpCardNum, null, returnedCaptureProperties, KortathjonustanAuthorisationEntries.AUTHORIZATION_TYPE_SALE); log(logText.toString()); } catch (Exception e) { System.err.println("Unable to save entry to database"); throw new CreditCardAuthorizationException(e); } } } return authCode; } catch (CreditCardAuthorizationException e) { StringBuffer logText = new StringBuffer(); logText.append("Authorization FAILED"); logText.append("\nError = " + e.getErrorMessage()); logText.append("\nNumber = " + e.getErrorNumber()); logText.append("\nDisplay error = " + e.getDisplayError()); log(logText.toString()); throw e; } } |
String name; try { name = CalEnv.getGlobalProperty("system.name"); } catch (Throwable t) { throw new CalFacadeException(t); } | public BwSystem getSyspars() throws CalFacadeException { if (syspars == null) { String name; try { name = CalEnv.getGlobalProperty("system.name"); } catch (Throwable t) { throw new CalFacadeException(t); } sess.namedQuery("getSystemPars"); sess.setString("name", name); syspars = (BwSystem)sess.getUnique(); if (syspars == null) { throw new CalFacadeException("No system parameters with name " + name); } if (debug) { trace("Read system parameters: " + syspars); } } return syspars; } |
|
sess.setString("name", name); | sess.setString("name", getSystemName()); | public BwSystem getSyspars() throws CalFacadeException { if (syspars == null) { String name; try { name = CalEnv.getGlobalProperty("system.name"); } catch (Throwable t) { throw new CalFacadeException(t); } sess.namedQuery("getSystemPars"); sess.setString("name", name); syspars = (BwSystem)sess.getUnique(); if (syspars == null) { throw new CalFacadeException("No system parameters with name " + name); } if (debug) { trace("Read system parameters: " + syspars); } } return syspars; } |
throw new CalFacadeException("No system parameters with name " + name); | throw new CalFacadeException("No system parameters with name " + getSystemName()); | public BwSystem getSyspars() throws CalFacadeException { if (syspars == null) { String name; try { name = CalEnv.getGlobalProperty("system.name"); } catch (Throwable t) { throw new CalFacadeException(t); } sess.namedQuery("getSystemPars"); sess.setString("name", name); syspars = (BwSystem)sess.getUnique(); if (syspars == null) { throw new CalFacadeException("No system parameters with name " + name); } if (debug) { trace("Read system parameters: " + syspars); } } return syspars; } |
public boolean init(String url, | public boolean init(String systemName, String url, | public boolean init(String url, String authenticatedUser, String user, boolean publicAdmin, Groups groups, String synchId, boolean debug) throws CalFacadeException { super.init(url, authenticatedUser, user, publicAdmin, groups, synchId, debug); boolean userCreated = false; BwUser authUser; try { access = new AccessUtil(debug); if ((synchId != null) && publicAdmin) { throw new CalFacadeException("synch only valid for non admin"); } } catch (Throwable t) { throw new CalFacadeException(t); } if (user == null) { user = authenticatedUser; } if (authenticatedUser == null) { // Unauthenticated use // Ensure no guest mods// this.readOnly = true; currentMode = CalintfUtil.guestMode; authUser = new BwUser(); this.user = getUser(user); } else {// this.readOnly = false; authUser = getUser(authenticatedUser); if (authUser == null) { /* Add the user to the database. Presumably this is first logon */ getLogger().info("Add new user " + authenticatedUser); addNewUser(new BwUser(authenticatedUser)); authUser = getUser(authenticatedUser); userCreated = true; } if (!publicAdmin) { currentMode = CalintfUtil.userMode; } else { currentMode = CalintfUtil.publicAdminMode; } logon(authUser); getLogger().info("Authenticated user " + authenticatedUser + " logged on"); if (authenticatedUser.equals(user)) { this.user = authUser; } else { this.user = getUser(user); if (this.user == null) { throw new CalFacadeException("User " + user + " does not exist."); } } } authUser.setGroups(groups.getAllGroups(authUser)); access.setAuthUser(authUser); access.setSyspars((BwSystem)getSyspars().clone()); events = new Events(this, access, currentMode, debug); calendars = new Calendars(this, access, currentMode, debug); categories = new EventProperties(this, access, currentMode, "word", BwCategory.class.getName(), "getCategoryRefs", -1, debug); locations = new EventProperties(this, access, currentMode, "address", BwLocation.class.getName(), "getLocationRefs", CalFacadeDefs.maxReservedLocationId, debug); sponsors = new EventProperties(this, access, currentMode, "name", BwSponsor.class.getName(), "getSponsorRefs", CalFacadeDefs.maxReservedSponsorId, debug); timezones = new CalTimezonesImpl(this, getStats(), publicAdmin, debug); timezones.setDefaultTimeZoneId(getSyspars().getTzid()); if (userCreated) { calendars.addNewCalendars(authUser); } return userCreated; } |
super.init(url, authenticatedUser, user, publicAdmin, | super.init(systemName, url, authenticatedUser, user, publicAdmin, | public boolean init(String url, String authenticatedUser, String user, boolean publicAdmin, Groups groups, String synchId, boolean debug) throws CalFacadeException { super.init(url, authenticatedUser, user, publicAdmin, groups, synchId, debug); boolean userCreated = false; BwUser authUser; try { access = new AccessUtil(debug); if ((synchId != null) && publicAdmin) { throw new CalFacadeException("synch only valid for non admin"); } } catch (Throwable t) { throw new CalFacadeException(t); } if (user == null) { user = authenticatedUser; } if (authenticatedUser == null) { // Unauthenticated use // Ensure no guest mods// this.readOnly = true; currentMode = CalintfUtil.guestMode; authUser = new BwUser(); this.user = getUser(user); } else {// this.readOnly = false; authUser = getUser(authenticatedUser); if (authUser == null) { /* Add the user to the database. Presumably this is first logon */ getLogger().info("Add new user " + authenticatedUser); addNewUser(new BwUser(authenticatedUser)); authUser = getUser(authenticatedUser); userCreated = true; } if (!publicAdmin) { currentMode = CalintfUtil.userMode; } else { currentMode = CalintfUtil.publicAdminMode; } logon(authUser); getLogger().info("Authenticated user " + authenticatedUser + " logged on"); if (authenticatedUser.equals(user)) { this.user = authUser; } else { this.user = getUser(user); if (this.user == null) { throw new CalFacadeException("User " + user + " does not exist."); } } } authUser.setGroups(groups.getAllGroups(authUser)); access.setAuthUser(authUser); access.setSyspars((BwSystem)getSyspars().clone()); events = new Events(this, access, currentMode, debug); calendars = new Calendars(this, access, currentMode, debug); categories = new EventProperties(this, access, currentMode, "word", BwCategory.class.getName(), "getCategoryRefs", -1, debug); locations = new EventProperties(this, access, currentMode, "address", BwLocation.class.getName(), "getLocationRefs", CalFacadeDefs.maxReservedLocationId, debug); sponsors = new EventProperties(this, access, currentMode, "name", BwSponsor.class.getName(), "getSponsorRefs", CalFacadeDefs.maxReservedSponsorId, debug); timezones = new CalTimezonesImpl(this, getStats(), publicAdmin, debug); timezones.setDefaultTimeZoneId(getSyspars().getTzid()); if (userCreated) { calendars.addNewCalendars(authUser); } return userCreated; } |
rtnValue += "edu.sc.seis.gee.configuration : "+System.getProperty("edu.sc.seis.gee.configurtation")+"\n"; | rtnValue += "edu.sc.seis.gee.configuration : "+System.getProperty("edu.sc.seis.gee.configuration")+"\n"; | public static String getSystemInformation() { String rtnValue = ""; rtnValue += "Date : "+new java.util.Date().toString()+"\n"; rtnValue += "os.name : "+System.getProperty("os.name")+"\n"; rtnValue += "os.version : "+System.getProperty("os.version")+"\n"; rtnValue += "os.arch : "+System.getProperty("os.arch")+"\n"; rtnValue += "java.runtime.version : "+System.getProperty("java.runtime.version")+"\n"; rtnValue += "java.class.version : "+System.getProperty("java.class.version")+"\n"; rtnValue += "java.class.path : "+System.getProperty("java.class.path")+"\n"; rtnValue += "edu.sc.seis.gee.configuration : "+System.getProperty("edu.sc.seis.gee.configurtation")+"\n"; rtnValue += "user.name : "+System.getProperty("user.name")+"\n"; rtnValue += "user.timeZone : "+System.getProperty("user.timeZone")+"\n"; rtnValue += "user.region : "+System.getProperty("user.region")+"\n"; rtnValue += "\n\n\n Other Properties:\n"; StringWriter stringWriter = new StringWriter(); java.util.Properties props = System.getProperties(); props.list(new PrintWriter(stringWriter)); rtnValue += stringWriter.toString(); return rtnValue; } |
if(coordinates[0] % 100 == 0){ logger.debug("x: " + coordinates[0] + " y: " + coordinates[1]); } | public int currentSegment(float[] coordinates){ int i = 0; if(min){ i = 1; currentIndex--; } min = !min; coordinates[0] = currentIndex; coordinates[1] = points[i][currentIndex]; if(at != null){ at.transform(coordinates, 0, coordinates, 0, 1); } if(currentIndex == startIndex){ return SEG_MOVETO; }else{ return SEG_LINETO; } } |
|
this.setLineStyle(org.eclipse.draw2d.Graphics.LINE_SOLID); | this.setLineStyle(Graphics.LINE_SOLID); | public SolidLineWDstClosedArrow() { this.setFill(true); this.setFillXOR(false); this.setOutline(true); this.setOutlineXOR(false); this.setLineWidth(1); this.setLineStyle(org.eclipse.draw2d.Graphics.LINE_SOLID); setTargetDecoration(createTargetDecoration()); } |
private org.eclipse.draw2d.RotatableDecoration createTargetDecoration() { org.eclipse.draw2d.PolygonDecoration df = new org.eclipse.draw2d.PolygonDecoration(); | private RotatableDecoration createTargetDecoration() { PolygonDecoration df = new PolygonDecoration(); | private org.eclipse.draw2d.RotatableDecoration createTargetDecoration() { org.eclipse.draw2d.PolygonDecoration df = new org.eclipse.draw2d.PolygonDecoration(); df.setFill(true); df.setFillXOR(false); df.setOutline(true); df.setOutlineXOR(false); df.setLineWidth(1); df.setLineStyle(org.eclipse.draw2d.Graphics.LINE_SOLID); org.eclipse.draw2d.geometry.PointList pl = new org.eclipse.draw2d.geometry.PointList(); pl.addPoint(getMapMode().DPtoLP(0), getMapMode().DPtoLP(0)); pl.addPoint(getMapMode().DPtoLP(-2), getMapMode().DPtoLP(2)); pl.addPoint(getMapMode().DPtoLP(-2), getMapMode().DPtoLP(-2)); pl.addPoint(getMapMode().DPtoLP(0), getMapMode().DPtoLP(0)); df.setTemplate(pl); df.setScale(getMapMode().DPtoLP(7), getMapMode().DPtoLP(3)); return df; } |
df.setLineStyle(org.eclipse.draw2d.Graphics.LINE_SOLID); org.eclipse.draw2d.geometry.PointList pl = new org.eclipse.draw2d.geometry.PointList(); | df.setLineStyle(Graphics.LINE_SOLID); PointList pl = new PointList(); | private org.eclipse.draw2d.RotatableDecoration createTargetDecoration() { org.eclipse.draw2d.PolygonDecoration df = new org.eclipse.draw2d.PolygonDecoration(); df.setFill(true); df.setFillXOR(false); df.setOutline(true); df.setOutlineXOR(false); df.setLineWidth(1); df.setLineStyle(org.eclipse.draw2d.Graphics.LINE_SOLID); org.eclipse.draw2d.geometry.PointList pl = new org.eclipse.draw2d.geometry.PointList(); pl.addPoint(getMapMode().DPtoLP(0), getMapMode().DPtoLP(0)); pl.addPoint(getMapMode().DPtoLP(-2), getMapMode().DPtoLP(2)); pl.addPoint(getMapMode().DPtoLP(-2), getMapMode().DPtoLP(-2)); pl.addPoint(getMapMode().DPtoLP(0), getMapMode().DPtoLP(0)); df.setTemplate(pl); df.setScale(getMapMode().DPtoLP(7), getMapMode().DPtoLP(3)); return df; } |
private boolean disableDoubleBuffering(Component c){ if(c instanceof JComponent == false) return false; JComponent jc = (JComponent)c; boolean wasBuffered = jc.isDoubleBuffered(); | private void disableDoubleBuffering(JComponent jc){ | private boolean disableDoubleBuffering(Component c){ if(c instanceof JComponent == false) return false; JComponent jc = (JComponent)c; boolean wasBuffered = jc.isDoubleBuffered(); jc.setDoubleBuffered(false); return wasBuffered; } |
return wasBuffered; | private boolean disableDoubleBuffering(Component c){ if(c instanceof JComponent == false) return false; JComponent jc = (JComponent)c; boolean wasBuffered = jc.isDoubleBuffered(); jc.setDoubleBuffered(false); return wasBuffered; } |
|
private void restoreDoubleBuffering(Component c, boolean wasBuffered){ if(c instanceof JComponent) ((JComponent)c).setDoubleBuffered(wasBuffered); | private void restoreDoubleBuffering(JComponent jc){ jc.setDoubleBuffered(true); | private void restoreDoubleBuffering(Component c, boolean wasBuffered){ if(c instanceof JComponent) ((JComponent)c).setDoubleBuffered(wasBuffered); } |
oprops.put("xalan:indent-amount", "4"); | public void write(OutputStream out) throws Exception { DocumentBuilderFactory dfactory = DocumentBuilderFactory.newInstance(); DocumentBuilder docBuilder = dfactory.newDocumentBuilder(); org.w3c.dom.Document outNode = docBuilder.newDocument(); javax.xml.transform.TransformerFactory tfactory = javax.xml.transform.TransformerFactory.newInstance(); // This creates a transformer that does a simple identity transform, // and thus can be used for all intents and purposes as a serializer. javax.xml.transform.Transformer serializer = tfactory.newTransformer(); java.util.Properties oprops = new java.util.Properties(); oprops.put("method", "xml"); oprops.put("indent", "yes"); oprops.put("xalan:indent-amount", "4"); serializer.setOutputProperties(oprops); serializer.transform(new javax.xml.transform.dom.DOMSource(getElement()), new javax.xml.transform.stream.StreamResult(out)); } |
|
acl.decode(aclChars); acl.merge(entAccess.toCharArray()); | if (entAccess != null) { acl.decode(entAccess.toCharArray()); } acl.merge(aclChars); | private char[] getAclChars(BwShareableDbentity ent) throws CalFacadeException { if (ent instanceof BwShareableContainedDbentity) { BwCalendar container; if (ent instanceof BwCalendar) { container = (BwCalendar)ent; } else { container = ((BwShareableContainedDbentity)ent).getCalendar(); } String path = container.getPath(); PathInfo pi = pathInfoMap.getInfo(path); if (pi == null) { pi = getPathInfo(container); pathInfoMap.putInfo(path, pi); } char[] aclChars = pi.encoded; if (ent instanceof BwCalendar) { return aclChars; } /* Create a merged access string from the entity access and the * container access */ String entAccess = ent.getAccess(); if (entAccess == null) { // Nomerge needed return aclChars; } try { Acl acl = new Acl(); acl.decode(aclChars); acl.merge(entAccess.toCharArray()); return acl.getEncoded(); } catch (Throwable t) { throw new CalFacadeException(t); } } /* This is a way of making other objects sort of shareable. * The objects are locations, sponsors and categories. * * We store the default access in the owner principal and manipulate that to give * us some degree of sharing. * * In effect, the owner becomes the container for the object. */ String aclString = null; String entAccess = ent.getAccess(); BwUser owner = ent.getOwner(); if (ent instanceof BwCategory) { aclString = owner.getCategoryAccess(); } else if (ent instanceof BwLocation) { aclString = owner.getLocationAccess(); } else if (ent instanceof BwSponsor) { aclString = owner.getSponsorAccess(); } if (aclString == null) { if (entAccess == null) { if (ent.getPublick()) { return access.getDefaultPublicAccess().toCharArray(); } return access.getDefaultPersonalAccess().toCharArray(); } return entAccess.toCharArray(); } if (entAccess == null) { return aclString.toCharArray(); } try { Acl acl = new Acl(); acl.decode(aclString.toCharArray()); acl.merge(entAccess.toCharArray()); return acl.getEncoded(); } catch (Throwable t) { throw new CalFacadeException(t); } } |
return acl.getEncoded(); | return acl.encodeAll(); | private char[] getAclChars(BwShareableDbentity ent) throws CalFacadeException { if (ent instanceof BwShareableContainedDbentity) { BwCalendar container; if (ent instanceof BwCalendar) { container = (BwCalendar)ent; } else { container = ((BwShareableContainedDbentity)ent).getCalendar(); } String path = container.getPath(); PathInfo pi = pathInfoMap.getInfo(path); if (pi == null) { pi = getPathInfo(container); pathInfoMap.putInfo(path, pi); } char[] aclChars = pi.encoded; if (ent instanceof BwCalendar) { return aclChars; } /* Create a merged access string from the entity access and the * container access */ String entAccess = ent.getAccess(); if (entAccess == null) { // Nomerge needed return aclChars; } try { Acl acl = new Acl(); acl.decode(aclChars); acl.merge(entAccess.toCharArray()); return acl.getEncoded(); } catch (Throwable t) { throw new CalFacadeException(t); } } /* This is a way of making other objects sort of shareable. * The objects are locations, sponsors and categories. * * We store the default access in the owner principal and manipulate that to give * us some degree of sharing. * * In effect, the owner becomes the container for the object. */ String aclString = null; String entAccess = ent.getAccess(); BwUser owner = ent.getOwner(); if (ent instanceof BwCategory) { aclString = owner.getCategoryAccess(); } else if (ent instanceof BwLocation) { aclString = owner.getLocationAccess(); } else if (ent instanceof BwSponsor) { aclString = owner.getSponsorAccess(); } if (aclString == null) { if (entAccess == null) { if (ent.getPublick()) { return access.getDefaultPublicAccess().toCharArray(); } return access.getDefaultPersonalAccess().toCharArray(); } return entAccess.toCharArray(); } if (entAccess == null) { return aclString.toCharArray(); } try { Acl acl = new Acl(); acl.decode(aclString.toCharArray()); acl.merge(entAccess.toCharArray()); return acl.getEncoded(); } catch (Throwable t) { throw new CalFacadeException(t); } } |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.