conflict_resolution
stringlengths
27
16k
<<<<<<< ======= import javax.servlet.ServletException; import edu.umd.cs.findbugs.annotations.NonNull; import hudson.plugins.ec2.util.*; import hudson.XmlFile; import hudson.model.listeners.SaveableListener; import hudson.security.Permission; import hudson.util.Secret; import jenkins.model.Jenkins; import jenkins.model.JenkinsLocationConfiguration; import jenkins.slaves.iterators.api.NodeIterator; import org.apache.commons.lang.StringUtils; import org.kohsuke.accmod.Restricted; import org.kohsuke.accmod.restrictions.NoExternalUse; import org.kohsuke.stapler.DataBoundConstructor; import org.kohsuke.stapler.DataBoundSetter; import org.kohsuke.stapler.QueryParameter; import com.amazonaws.AmazonClientException; import com.amazonaws.AmazonServiceException; import com.amazonaws.auth.AWSCredentialsProvider; import com.amazonaws.services.ec2.AmazonEC2; import com.amazonaws.services.ec2.model.*; import hudson.Extension; import hudson.Util; import hudson.model.*; import hudson.model.Descriptor.FormException; import hudson.model.labels.LabelAtom; import hudson.slaves.NodeProperty; import hudson.slaves.NodePropertyDescriptor; import hudson.util.DescribableList; import hudson.util.FormValidation; import hudson.util.ListBoxModel; import org.kohsuke.stapler.Stapler; import org.kohsuke.stapler.interceptor.RequirePOST; >>>>>>> import javax.servlet.ServletException; import edu.umd.cs.findbugs.annotations.NonNull; import hudson.plugins.ec2.util.*; import hudson.XmlFile; import hudson.model.listeners.SaveableListener; import hudson.security.Permission; import hudson.util.Secret; import jenkins.model.Jenkins; import jenkins.model.JenkinsLocationConfiguration; import jenkins.slaves.iterators.api.NodeIterator; import org.apache.commons.lang.StringUtils; import org.kohsuke.accmod.Restricted; import org.kohsuke.accmod.restrictions.NoExternalUse; import org.kohsuke.stapler.DataBoundConstructor; import org.kohsuke.stapler.DataBoundSetter; import org.kohsuke.stapler.QueryParameter; import com.amazonaws.AmazonClientException; import com.amazonaws.AmazonServiceException; import com.amazonaws.auth.AWSCredentialsProvider; import com.amazonaws.services.ec2.AmazonEC2; import com.amazonaws.services.ec2.model.*; import hudson.Extension; import hudson.Util; import hudson.model.*; import hudson.model.Descriptor.FormException; import hudson.model.labels.LabelAtom; import hudson.slaves.NodeProperty; import hudson.slaves.NodePropertyDescriptor; import hudson.util.DescribableList; import hudson.util.FormValidation; import hudson.util.ListBoxModel; import org.kohsuke.stapler.Stapler; import org.kohsuke.stapler.interceptor.RequirePOST; <<<<<<< /** * * @param ec2 * @param allSubnets if true, uses all subnets defined for this SlaveTemplate as the filter, else will only use the current subnet * @return DescribeInstancesResult of DescribeInstanceRequst constructed from this SlaveTemplate's configs */ DescribeInstancesResult getDescribeInstanceResult(AmazonEC2 ec2, boolean allSubnets) throws IOException { HashMap<RunInstancesRequest, List<Filter>> runInstancesRequestFilterMap = makeRunInstancesRequestAndFilters(1, ec2, false); Map.Entry<RunInstancesRequest, List<Filter>> entry = runInstancesRequestFilterMap.entrySet().iterator().next(); List<Filter> diFilters = entry.getValue(); if (allSubnets) { /* remove any existing subnet-id filters */ List<Filter> rmvFilters = new ArrayList<>(); for (Filter f : diFilters) { if (f.getName().equals("subnet-id")) { rmvFilters.add(f); } } for (Filter f : rmvFilters) { diFilters.remove(f); } /* Add filter using all subnets defined for this SlaveTemplate */ Filter subnetFilter = new Filter("subnet-id"); subnetFilter.setValues(Arrays.asList(getSubnetId().split(" "))); diFilters.add(subnetFilter); } DescribeInstancesRequest diRequest = new DescribeInstancesRequest().withFilters(diFilters); return ec2.describeInstances(diRequest); } ======= public boolean isAllowSelfSignedCertificate() { return amiType.isWindows() && ((WindowsData) amiType).isAllowSelfSignedCertificate(); } >>>>>>> /** * * @param ec2 * @param allSubnets if true, uses all subnets defined for this SlaveTemplate as the filter, else will only use the current subnet * @return DescribeInstancesResult of DescribeInstanceRequst constructed from this SlaveTemplate's configs */ DescribeInstancesResult getDescribeInstanceResult(AmazonEC2 ec2, boolean allSubnets) throws IOException { HashMap<RunInstancesRequest, List<Filter>> runInstancesRequestFilterMap = makeRunInstancesRequestAndFilters(1, ec2, false); Map.Entry<RunInstancesRequest, List<Filter>> entry = runInstancesRequestFilterMap.entrySet().iterator().next(); List<Filter> diFilters = entry.getValue(); if (allSubnets) { /* remove any existing subnet-id filters */ List<Filter> rmvFilters = new ArrayList<>(); for (Filter f : diFilters) { if (f.getName().equals("subnet-id")) { rmvFilters.add(f); } } for (Filter f : rmvFilters) { diFilters.remove(f); } /* Add filter using all subnets defined for this SlaveTemplate */ Filter subnetFilter = new Filter("subnet-id"); subnetFilter.setValues(Arrays.asList(getSubnetId().split(" "))); diFilters.add(subnetFilter); } DescribeInstancesRequest diRequest = new DescribeInstancesRequest().withFilters(diFilters); return ec2.describeInstances(diRequest); } public boolean isAllowSelfSignedCertificate() { return amiType.isWindows() && ((WindowsData) amiType).isAllowSelfSignedCertificate(); }
<<<<<<< public String getSlaveCommandSuffix() { return amiType.isUnix() ? ((UnixData) amiType).getSlaveCommandSuffix() : ""; } ======= public String chooseSubnetId() { if (StringUtils.isBlank(subnetId)) { return null; } else { String[] subnetIdList= getSubnetId().split(" "); // Round-robin subnet selection. String subnet = subnetIdList[nextSubnet]; currentSubnetId = subnet; nextSubnet = (nextSubnet + 1) % subnetIdList.length; return subnet; } } >>>>>>> public String getSlaveCommandSuffix() { return amiType.isUnix() ? ((UnixData) amiType).getSlaveCommandSuffix() : ""; } public String chooseSubnetId() { if (StringUtils.isBlank(subnetId)) { return null; } else { String[] subnetIdList= getSubnetId().split(" "); // Round-robin subnet selection. String subnet = subnetIdList[nextSubnet]; currentSubnetId = subnet; nextSubnet = (nextSubnet + 1) % subnetIdList.length; return subnet; } }
<<<<<<< @Override protected AWSCredentialsProvider createCredentialsProvider() { return createCredentialsProvider(isUseInstanceProfileForCredentials(), getCredentialsId(), getRoleArn(), getRoleSessionName(), getRegion()); } ======= public boolean isNoDelayProvisioning() { return noDelayProvisioning; } @DataBoundSetter public void setNoDelayProvisioning(boolean noDelayProvisioning) { this.noDelayProvisioning = noDelayProvisioning; } >>>>>>> public boolean isNoDelayProvisioning() { return noDelayProvisioning; } @DataBoundSetter public void setNoDelayProvisioning(boolean noDelayProvisioning) { this.noDelayProvisioning = noDelayProvisioning; } @Override protected AWSCredentialsProvider createCredentialsProvider() { return createCredentialsProvider(isUseInstanceProfileForCredentials(), getCredentialsId(), getRoleArn(), getRoleSessionName(), getRegion()); }
<<<<<<< public final String idleTerminationMinutes; // Temporary stuff that is obtained live from EC2 public String publicDNS; public String privateDNS; public List<EC2Tag> tags; private long _last_live_fetch = 0; /* 20 seconds is our polling time for refreshing EC2 data that may change externally. */ private static final long POLL_PERIOD = 20 * 1000; ======= public final boolean usePrivateDnsName; >>>>>>> public final String idleTerminationMinutes; // Temporary stuff that is obtained live from EC2 public String publicDNS; public String privateDNS; public List<EC2Tag> tags; public final boolean usePrivateDnsName; private long _last_live_fetch = 0; /* 20 seconds is our polling time for refreshing EC2 data that may change externally. */ private static final long POLL_PERIOD = 20 * 1000; <<<<<<< this.idleTerminationMinutes = idleTerminationMinutes; this.publicDNS = publicDNS; this.privateDNS = privateDNS; this.tags = tags; ======= this.usePrivateDnsName = usePrivateDnsName; >>>>>>> this.idleTerminationMinutes = idleTerminationMinutes; this.publicDNS = publicDNS; this.privateDNS = privateDNS; this.tags = tags; this.usePrivateDnsName = usePrivateDnsName; <<<<<<< this(instanceId,"debug", "/tmp/hudson", 22, 1, Mode.NORMAL, "debug", "", Collections.<NodeProperty<?>>emptyList(), null, null, null, false, null, "Fake public", "Fake private", null); ======= this(instanceId,"debug", "/tmp/hudson", 22, 1, Mode.NORMAL, "debug", "", Collections.<NodeProperty<?>>emptyList(), null, null, null, false, false); >>>>>>> this(instanceId,"debug", "/tmp/hudson", 22, 1, Mode.NORMAL, "debug", "", Collections.<NodeProperty<?>>emptyList(), null, null, null, false, null, "Fake public", "Fake private", null, false);
<<<<<<< AmazonEC2 expiredClient = AmazonEC2FactoryMockImpl.createAmazonEC2Mock(new ThrowsException(expiredException)); AmazonEC2FactoryMockImpl.mock = expiredClient; ======= AmazonEC2 expiredClient = mock(AmazonEC2.class, new ThrowsException(expiredException)); cl.connection = expiredClient; PeriodicWork work = PeriodicWork.all().get(EC2Cloud.EC2ConnectionUpdater.class); assertNotNull(work); work.run(); >>>>>>> AmazonEC2 expiredClient = AmazonEC2FactoryMockImpl.createAmazonEC2Mock(new ThrowsException(expiredException)); AmazonEC2FactoryMockImpl.mock = expiredClient; PeriodicWork work = PeriodicWork.all().get(EC2Cloud.EC2ConnectionUpdater.class); assertNotNull(work); work.run(); <<<<<<< ======= >>>>>>>
<<<<<<< import java.lang.reflect.Method; import java.util.Random; ======= import java.lang.reflect.Method; >>>>>>> import java.lang.reflect.Method; import java.util.Random; <<<<<<< ======= import com.slidinglayer.R; import com.slidinglayer.util.CommonUtils; >>>>>>> <<<<<<< /** * Sentinel value for no current active pointer. Used by {@link #mActivePointerId}. */ private static final int INVALID_POINTER = -1; protected int mActivePointerId = INVALID_POINTER; protected VelocityTracker mVelocityTracker; protected int mMaximumVelocity; private Random mRandom; ======= protected Bundle mState; >>>>>>> /** * Sentinel value for no current active pointer. Used by {@link #mActivePointerId}. */ private static final int INVALID_POINTER = -1; protected int mActivePointerId = INVALID_POINTER; protected VelocityTracker mVelocityTracker; protected int mMaximumVelocity; private Random mRandom; protected Bundle mState; <<<<<<< private float mInitialX = -1; private float mInitialY = -1; ======= protected int mActivePointerId = INVALID_POINTER; /** * Sentinel value for no current active pointer. Used by * {@link #mActivePointerId}. */ private static final int INVALID_POINTER = -1; >>>>>>> private float mInitialX = -1; private float mInitialY = -1; <<<<<<< ======= * Sets the shadow of the width which will be included within the view by * using padding since it's on the left of the view in this case * * @param shadowWidth * Desired width of the shadow * @see #getShadowWidth() * @see #setShadowDrawable(Drawable) * @see #setShadowDrawable(int) */ public void setShadowWidth(int shadowWidth) { mShadowWidth = shadowWidth; invalidate(getLeft(), getTop(), getRight(), getBottom()); } /** >>>>>>> * Sets the shadow of the width which will be included within the view by * using padding since it's on the left of the view in this case * * @param shadowWidth * Desired width of the shadow * @see #getShadowWidth() * @see #setShadowDrawable(Drawable) * @see #setShadowDrawable(int) */ public void setShadowWidth(final int shadowWidth) { mShadowWidth = shadowWidth; invalidate(getLeft(), getTop(), getRight(), getBottom()); } /** <<<<<<< // We invalidate a slightly larger area now, this was only optimised for right menu previously // Keep on drawing until the animation has finished. Just re-draw the necessary part invalidate(getLeft() + oldX, getTop() + oldY, getRight() - oldX, getBottom() - oldY); ======= // Keep on drawing until the animation has finished. Just // re-draw the necessary part invalidate(getLeft() + oldX, getTop(), getRight(), getBottom()); >>>>>>> // We invalidate a slightly larger area now, this was only optimised for right menu previously // Keep on drawing until the animation has finished. Just re-draw the necessary part invalidate(getLeft() + oldX, getTop() + oldY, getRight() - oldX, getBottom() - oldY); <<<<<<< /** * Handler interface for obtaining updates on the <code>SlidingLayer</code>'s state. * <code>OnInteractListener</code> allows for external classes to be notified when the <code>SlidingLayer</code> * receives input to be opened or closed. */ public interface OnInteractListener { /** * This method is called when an attempt is made to open the current <code>SlidingLayer</code>. Note * that because of animation, the <code>SlidingLayer</code> may not be visible yet. */ public void onOpen(); /** * This method is called when an attempt is made to close the current <code>SlidingLayer</code>. Note * that because of animation, the <code>SlidingLayer</code> may still be visible. */ public void onClose(); /** * this method is executed after <code>onOpen()</code>, when the animation has finished. */ public void onOpened(); /** * this method is executed after <code>onClose()</code>, when the animation has finished and the <code>SlidingLayer</code> is * therefore no longer visible. */ public void onClosed(); } ======= static class SavedState extends BaseSavedState { Bundle mState; public SavedState(Parcelable superState) { super(superState); } public SavedState(Parcel in) { super(in); mState = in.readBundle(); } @Override public void writeToParcel(Parcel dest, int flags) { super.writeToParcel(dest, flags); dest.writeBundle(mState); } public static final Creator<SavedState> CREATOR = new Creator<SavedState>() { @Override public SavedState createFromParcel(Parcel in) { return new SavedState(in); } @Override public SavedState[] newArray(int size) { return new SavedState[size]; } }; } >>>>>>> /** * Handler interface for obtaining updates on the <code>SlidingLayer</code>'s state. * <code>OnInteractListener</code> allows for external classes to be notified when the <code>SlidingLayer</code> * receives input to be opened or closed. */ public interface OnInteractListener { /** * This method is called when an attempt is made to open the current <code>SlidingLayer</code>. Note * that because of animation, the <code>SlidingLayer</code> may not be visible yet. */ public void onOpen(); /** * This method is called when an attempt is made to close the current <code>SlidingLayer</code>. Note * that because of animation, the <code>SlidingLayer</code> may still be visible. */ public void onClose(); /** * this method is executed after <code>onOpen()</code>, when the animation has finished. */ public void onOpened(); /** * this method is executed after <code>onClose()</code>, when the animation has finished and the * <code>SlidingLayer</code> is * therefore no longer visible. */ public void onClosed(); } static class SavedState extends BaseSavedState { Bundle mState; public SavedState(Parcelable superState) { super(superState); } public SavedState(Parcel in) { super(in); mState = in.readBundle(); } @Override public void writeToParcel(Parcel dest, int flags) { super.writeToParcel(dest, flags); dest.writeBundle(mState); } public static final Creator<SavedState> CREATOR = new Creator<SavedState>() { @Override public SavedState createFromParcel(Parcel in) { return new SavedState(in); } @Override public SavedState[] newArray(int size) { return new SavedState[size]; } }; }
<<<<<<< import uncc2014watsonsim.search.*; import uncc2014watsonsim.scoring.*; ======= import privatedata.UserSpecificConstants; import uncc2014watsonsim.search.IndriSearcher; import uncc2014watsonsim.search.LuceneSearcher; import uncc2014watsonsim.search.Searcher; import uncc2014watsonsim.search.GoogleSearcher; >>>>>>> import uncc2014watsonsim.search.*; import uncc2014watsonsim.scoring.*; import privatedata.UserSpecificConstants; import uncc2014watsonsim.search.IndriSearcher; import uncc2014watsonsim.search.LuceneSearcher; import uncc2014watsonsim.search.Searcher; import uncc2014watsonsim.search.GoogleSearcher; <<<<<<< static final Searcher[] searchers = new Searcher[]{ ======= static final Searcher[] searchers = { >>>>>>> static final Searcher[] searchers = { <<<<<<< static final Learner learner = new WekaLearner(); ======= static final Learner learner = new AverageLearner(); >>>>>>> static final Learner learner = new WekaLearner(); <<<<<<< // Query every engine for (Searcher s: searchers) question.addAll(s.runQuery(question.text)); ======= for (Searcher s : searchers){ // Query every engine if(question.getType() == QType.FACTOID){ question.addAll(s.runQuery(question.text, UserSpecificConstants.indriIndex, UserSpecificConstants.luceneIndex)); } else if (question.getType() == QType.FITB) { question.addAll(s.runQuery(question.text, UserSpecificConstants.quotesIndriIndex, UserSpecificConstants.quotesLuceneIndex)); } else { return; } } >>>>>>> // Query every engine for (Searcher s: searchers) question.addAll(s.runQuery(question.text)); /* This is Jagan's quotes FITB code. I do not have quotes indexed separately so I can't do this. for (Searcher s : searchers){ // Query every engine if(question.getType() == QType.FACTOID){ question.addAll(s.runQuery(question.text, UserSpecificConstants.indriIndex, UserSpecificConstants.luceneIndex)); } else if (question.getType() == QType.FITB) { question.addAll(s.runQuery(question.text, UserSpecificConstants.quotesIndriIndex, UserSpecificConstants.quotesLuceneIndex)); } else { return; } }*/ <<<<<<< } ======= >>>>>>> }
<<<<<<< ======= import com.slidinglayersample.R; >>>>>>> <<<<<<< smoothScrollTo(destX, destY, Math.max(velocityX, velocityY)); ======= smoothScrollTo(pos[0], pos[1], Math.max(velocityX, velocityY)); >>>>>>> smoothScrollTo(pos[0], pos[1], Math.max(velocityX, velocityY)); <<<<<<< case STICK_TO_RIGHT: targetState = swipeOffsetX > -w / 2; break; case STICK_TO_BOTTOM: targetState = swipeOffsetY > -h / 2; break; case STICK_TO_LEFT: targetState = swipeOffsetX < w / 2; break; case STICK_TO_TOP: targetState = swipeOffsetY < h / 2; break; case STICK_TO_MIDDLE: targetState = Math.abs(swipeOffsetX) < w / 2; break; default: targetState = true; ======= case STICK_TO_RIGHT: targetState = swipeOffsetX > -w / 2; break; case STICK_TO_BOTTOM: targetState = swipeOffsetY > -h / 2; break; case STICK_TO_LEFT: targetState = swipeOffsetX < w / 2; break; case STICK_TO_TOP: targetState = swipeOffsetY < h / 2; break; case STICK_TO_MIDDLE: targetState = Math.abs(swipeOffsetX) < w / 2 && Math.abs(swipeOffsetY) < h / 2; break; default: targetState = true; >>>>>>> case STICK_TO_RIGHT: targetState = swipeOffsetX > -w / 2; break; case STICK_TO_BOTTOM: targetState = swipeOffsetY > -h / 2; break; case STICK_TO_LEFT: targetState = swipeOffsetX < w / 2; break; case STICK_TO_TOP: targetState = swipeOffsetY < h / 2; break; case STICK_TO_MIDDLE: targetState = Math.abs(swipeOffsetX) < w / 2 && Math.abs(swipeOffsetY) < h / 2; break; default: targetState = true; <<<<<<< /** * Convenience method equivalent to {@link #getDestScrollX(int)}, with velocity set to 0 * @return */ private int getDestScrollX() { return getDestScrollX(0); } /** * Convenience method equivalent to {@link #getDestScrollY(int)}, with velocity set to 0 * @return */ private int getDestScrollY() { return getDestScrollY(0); ======= private int[] getDestScrollPos() { return getDestScrollPos(0, 0); >>>>>>> private int[] getDestScrollPos() { return getDestScrollPos(0, 0); <<<<<<< if (mScreenSide == STICK_TO_RIGHT) { return -getWidth() + mOffsetWidth; } else if (mScreenSide == STICK_TO_LEFT) { return getWidth() - mOffsetWidth; } else if (mScreenSide == STICK_TO_TOP || mScreenSide == STICK_TO_BOTTOM) { return 0; } else { if (velocity == 0) { return new Random().nextBoolean() ? -getWidth() : getWidth(); ======= switch (mScreenSide) { case STICK_TO_RIGHT: pos[0] = -getWidth() + mOffsetWidth; break; case STICK_TO_LEFT: pos[0] = getWidth() - mOffsetWidth; break; case STICK_TO_TOP: pos[1] = getHeight() - mOffsetWidth; break; case STICK_TO_BOTTOM: pos[1] = -getHeight() + mOffsetWidth; break; case STICK_TO_MIDDLE: // Calculate slope m to get direction of swiping and apply the same vector until the end of the // animation float m = 1; // If no veocity nor translation (difficult to get) the target is random if (xValue == 0 && yValue == 0) { m = mRandom != null ? (float) Math.tan(mRandom.nextFloat() * Math.PI - Math.PI / 2) : 1; } else if (xValue == 0) { // Avoid division by 0 (Get the max value of the tan which is equivalent) m = (float) Math.tan(Math.PI / 2); >>>>>>> switch (mScreenSide) { case STICK_TO_RIGHT: pos[0] = -getWidth() + mOffsetWidth; break; case STICK_TO_LEFT: pos[0] = getWidth() - mOffsetWidth; break; case STICK_TO_TOP: pos[1] = getHeight() - mOffsetWidth; break; case STICK_TO_BOTTOM: pos[1] = -getHeight() + mOffsetWidth; break; case STICK_TO_MIDDLE: // Calculate slope m to get direction of swiping and apply the same vector until the end of the // animation float m = 1; // If no veocity nor translation (difficult to get) the target is random if (xValue == 0 && yValue == 0) { m = mRandom != null ? (float) Math.tan(mRandom.nextFloat() * Math.PI - Math.PI / 2) : 1; } else if (xValue == 0) { // Avoid division by 0 (Get the max value of the tan which is equivalent) m = (float) Math.tan(Math.PI / 2);
<<<<<<< ViewCompat.postInvalidateOnAnimation(this); ======= postInvalidateOnAnimation(); super.fling(velocityY); >>>>>>> ViewCompat.postInvalidateOnAnimation(this); super.fling(velocityY);
<<<<<<< } public Bucket createShadow() throws IOException { return currentBucket.createShadow(); } public void removeFrom(ObjectContainer container) { currentBucket.removeFrom(container); container.delete(this); } public void storeTo(ObjectContainer container) { currentBucket.storeTo(container); container.set(this); } } private class RAMBucket extends ArrayBucket { public RAMBucket(long size) { super("RAMBucket", size); _hasTaken(size); } @Override public void free() { super.free(); _hasFreed(size()); ======= if(isRAMBucket()) { _hasFreed(currentSize); synchronized(ramBucketQueue) { ramBucketQueue.remove(this); } } >>>>>>> if(isRAMBucket()) { _hasFreed(currentSize); synchronized(ramBucketQueue) { ramBucketQueue.remove(this); } } } public Bucket createShadow() throws IOException { return currentBucket.createShadow(); } public void removeFrom(ObjectContainer container) { currentBucket.removeFrom(container); container.delete(this); } public void storeTo(ObjectContainer container) { currentBucket.storeTo(container); container.set(this);
<<<<<<< new URI("http://127.0.0.1:8888/"), null,null); ======= new URI("http://127.0.0.1:8888/"), null, null); >>>>>>> new URI("http://127.0.0.1:8888/"), null, null, null);
<<<<<<< ======= private UserAlertManager alerts; >>>>>>> private UserAlertManager alerts; <<<<<<< HTMLNode pageNode = page.outer; HTMLNode contentNode = page.content; contentNode.addChild(new LongAlertElement(ctx,false)); writeHTMLReply(ctx, 200, "OK", pageNode.generate()); ======= HTMLNode pageNode = page.outer; HTMLNode contentNode = page.content; HTMLNode alertsNode = alerts.createAlerts(false); if (alertsNode.getFirstTag() == null) { alertsNode = new HTMLNode("div", "class", "infobox"); alertsNode.addChild("div", "class", "infobox-content").addChild("div", "No news is good news :)"); } contentNode.addChild(alertsNode); writeHTMLReply(ctx, 200, "OK", pageNode.generate()); >>>>>>> HTMLNode pageNode = page.outer; HTMLNode contentNode = page.content; contentNode.addChild(new LongAlertElement(ctx,false)); writeHTMLReply(ctx, 200, "OK", pageNode.generate());
<<<<<<< if(logMINOR) Logger.minor(this, "Sending auth packet (long) to "+replyTo+" - size "+data.length+" data length: "+output.length); ======= } private void sendPacket(byte[] data, Peer replyTo, PeerNode pn, int alreadyReportedBytes) throws LocalAddressException { if(pn.isIgnoreSource()) { Peer p = pn.getPeer(); if(p != null) replyTo = p; } sock.sendPacket(data, replyTo, pn.allowLocalAddresses()); pn.reportOutgoingBytes(data.length); node.outputThrottle.forceGrab(data.length - alreadyReportedBytes); >>>>>>> <<<<<<< public void sendHandshake(PeerNode pn) { int negType = pn.bestNegType(this); if(negType == -1) { if(pn.isRoutingCompatible()) Logger.error(this, "Could not negotiate with "+pn+" : no common negTypes available!: his negTypes: "+StringArray.toString(pn.negTypes)+" my negTypes: "+StringArray.toString(supportedNegTypes())+" despite being up to date!!"); else Logger.minor(this, "Could not negotiate with "+pn+" : no common negTypes available!: his negTypes: "+StringArray.toString(pn.negTypes)+" my negTypes: "+StringArray.toString(supportedNegTypes())+" (probably just too old)"); return; } if(logMINOR) Logger.minor(this, "Possibly sending handshake to "+pn+" negotiation type "+negType); DiffieHellmanContext ctx = null; Peer[] handshakeIPs; if(!pn.shouldSendHandshake()) { if(logMINOR) Logger.minor(this, "Not sending handshake to "+pn.getPeer()+" because pn.shouldSendHandshake() returned false"); return; } long firstTime = System.currentTimeMillis(); handshakeIPs = pn.getHandshakeIPs(); long secondTime = System.currentTimeMillis(); if((secondTime - firstTime) > 1000) Logger.error(this, "getHandshakeIPs() took more than a second to execute ("+(secondTime - firstTime)+") working on "+pn.userToString()); if(handshakeIPs.length == 0) { pn.couldNotSendHandshake(); long thirdTime = System.currentTimeMillis(); if((thirdTime - secondTime) > 1000) Logger.error(this, "couldNotSendHandshake() (after getHandshakeIPs()) took more than a second to execute ("+(thirdTime - secondTime)+") working on "+pn.userToString()); return; } else if(negType < 2){ long DHTime1 = System.currentTimeMillis(); ctx = DiffieHellman.generateContext(); long DHTime2 = System.currentTimeMillis(); if((DHTime2 - DHTime1) > 1000) Logger.error(this, "DHTime2 is more than a second after DHTime1 ("+(DHTime2 - DHTime1)+") working on "+pn.userToString()); pn.setKeyAgreementSchemeContext(ctx); long DHTime3 = System.currentTimeMillis(); if((DHTime3 - DHTime2) > 1000) Logger.error(this, "DHTime3 is more than a second after DHTime2 ("+(DHTime3 - DHTime2)+") working on "+pn.userToString()); } int sentCount = 0; long loopTime1 = System.currentTimeMillis(); for(int i=0;i<handshakeIPs.length;i++){ Peer peer = handshakeIPs[i]; FreenetInetAddress addr = peer.getFreenetAddress(); if(!crypto.allowConnection(pn, addr)) { if(logMINOR) Logger.minor(this, "Not sending handshake packet to "+peer+" for "+pn); } if(peer.getAddress(false) == null) { if(logMINOR) Logger.minor(this, "Not sending handshake to "+handshakeIPs[i]+" for "+pn.getPeer()+" because the DNS lookup failed or it's a currently unsupported IPv6 address"); continue; } if((!pn.allowLocalAddresses()) && (!peer.isRealInternetAddress(false, false))) { if(logMINOR) Logger.minor(this, "Not sending handshake to "+handshakeIPs[i]+" for "+pn.getPeer()+" because it's not a real Internet address and metadata.allowLocalAddresses is not true"); continue; } if(negType == 1) sendFirstHalfDHPacket(0, negType, ctx.getOurExponential(), pn, peer); else sendMessage1(pn, peer); pn.sentHandshake(); sentCount += 1; } long loopTime2 = System.currentTimeMillis(); if((loopTime2 - loopTime1) > 1000) Logger.normal(this, "loopTime2 is more than a second after loopTime1 ("+(loopTime2 - loopTime1)+") working on "+pn.userToString()); if(sentCount==0) { pn.couldNotSendHandshake(); } } /* (non-Javadoc) ======= public void sendHandshake(PeerNode pn) { int negType = pn.bestNegType(this); if(negType == -1) { if(pn.isRoutingCompatible()) Logger.error(this, "Could not negotiate with "+pn+" : no common negTypes available!: his negTypes: "+StringArray.toString(pn.negTypes)+" my negTypes: "+StringArray.toString(supportedNegTypes())+" despite being up to date!!"); else Logger.minor(this, "Could not negotiate with "+pn+" : no common negTypes available!: his negTypes: "+StringArray.toString(pn.negTypes)+" my negTypes: "+StringArray.toString(supportedNegTypes())+" (probably just too old)"); return; } if(logMINOR) Logger.minor(this, "Possibly sending handshake to "+pn+" negotiation type "+negType); DiffieHellmanContext ctx; Peer[] handshakeIPs; if(!pn.shouldSendHandshake()) { if(logMINOR) Logger.minor(this, "Not sending handshake to "+pn.getPeer()+" because pn.shouldSendHandshake() returned false"); return; } long firstTime = System.currentTimeMillis(); handshakeIPs = pn.getHandshakeIPs(); long secondTime = System.currentTimeMillis(); if((secondTime - firstTime) > 1000) Logger.error(this, "getHandshakeIPs() took more than a second to execute ("+(secondTime - firstTime)+") working on "+pn.userToString()); if(handshakeIPs.length == 0) { pn.couldNotSendHandshake(); long thirdTime = System.currentTimeMillis(); if((thirdTime - secondTime) > 1000) Logger.error(this, "couldNotSendHandshake() (after getHandshakeIPs()) took more than a second to execute ("+(thirdTime - secondTime)+") working on "+pn.userToString()); return; } else { long DHTime1 = System.currentTimeMillis(); ctx = DiffieHellman.generateContext(); long DHTime2 = System.currentTimeMillis(); if((DHTime2 - DHTime1) > 1000) Logger.error(this, "DHTime2 is more than a second after DHTime1 ("+(DHTime2 - DHTime1)+") working on "+pn.userToString()); pn.setKeyAgreementSchemeContext(ctx); long DHTime3 = System.currentTimeMillis(); if((DHTime3 - DHTime2) > 1000) Logger.error(this, "DHTime3 is more than a second after DHTime2 ("+(DHTime3 - DHTime2)+") working on "+pn.userToString()); } int sentCount = 0; long loopTime1 = System.currentTimeMillis(); for(int i=0;i<handshakeIPs.length;i++){ Peer peer = handshakeIPs[i]; FreenetInetAddress addr = peer.getFreenetAddress(); if(!crypto.allowConnection(pn, addr)) { if(logMINOR) Logger.minor(this, "Not sending handshake packet to "+peer+" for "+pn); } if(peer.getAddress(false) == null) { if(logMINOR) Logger.minor(this, "Not sending handshake to "+handshakeIPs[i]+" for "+pn.getPeer()+" because the DNS lookup failed or it's a currently unsupported IPv6 address"); continue; } if((!pn.allowLocalAddresses()) && (!peer.isRealInternetAddress(false, false))) { if(logMINOR) Logger.minor(this, "Not sending handshake to "+handshakeIPs[i]+" for "+pn.getPeer()+" because it's not a real Internet address and metadata.allowLocalAddresses is not true"); continue; } if(logMINOR) Logger.minor(this, "Sending handshake to "+peer+" for "+pn+" ("+i+" of "+handshakeIPs.length); sendFirstHalfDHPacket(0, negType, ctx.getOurExponential(), pn, peer); pn.sentHandshake(); sentCount += 1; } long loopTime2 = System.currentTimeMillis(); if((loopTime2 - loopTime1) > 1000) Logger.normal(this, "loopTime2 is more than a second after loopTime1 ("+(loopTime2 - loopTime1)+") working on "+pn.userToString()); if(sentCount==0) { pn.couldNotSendHandshake(); } } /* (non-Javadoc) >>>>>>> public void sendHandshake(PeerNode pn) { int negType = pn.bestNegType(this); if(negType == -1) { if(pn.isRoutingCompatible()) Logger.error(this, "Could not negotiate with "+pn+" : no common negTypes available!: his negTypes: "+StringArray.toString(pn.negTypes)+" my negTypes: "+StringArray.toString(supportedNegTypes())+" despite being up to date!!"); else Logger.minor(this, "Could not negotiate with "+pn+" : no common negTypes available!: his negTypes: "+StringArray.toString(pn.negTypes)+" my negTypes: "+StringArray.toString(supportedNegTypes())+" (probably just too old)"); return; } if(logMINOR) Logger.minor(this, "Possibly sending handshake to "+pn+" negotiation type "+negType); DiffieHellmanContext ctx = null; Peer[] handshakeIPs; if(!pn.shouldSendHandshake()) { if(logMINOR) Logger.minor(this, "Not sending handshake to "+pn.getPeer()+" because pn.shouldSendHandshake() returned false"); return; } long firstTime = System.currentTimeMillis(); handshakeIPs = pn.getHandshakeIPs(); long secondTime = System.currentTimeMillis(); if((secondTime - firstTime) > 1000) Logger.error(this, "getHandshakeIPs() took more than a second to execute ("+(secondTime - firstTime)+") working on "+pn.userToString()); if(handshakeIPs.length == 0) { pn.couldNotSendHandshake(); long thirdTime = System.currentTimeMillis(); if((thirdTime - secondTime) > 1000) Logger.error(this, "couldNotSendHandshake() (after getHandshakeIPs()) took more than a second to execute ("+(thirdTime - secondTime)+") working on "+pn.userToString()); return; } else if(negType < 2){ long DHTime1 = System.currentTimeMillis(); ctx = DiffieHellman.generateContext(); long DHTime2 = System.currentTimeMillis(); if((DHTime2 - DHTime1) > 1000) Logger.error(this, "DHTime2 is more than a second after DHTime1 ("+(DHTime2 - DHTime1)+") working on "+pn.userToString()); pn.setKeyAgreementSchemeContext(ctx); long DHTime3 = System.currentTimeMillis(); if((DHTime3 - DHTime2) > 1000) Logger.error(this, "DHTime3 is more than a second after DHTime2 ("+(DHTime3 - DHTime2)+") working on "+pn.userToString()); } int sentCount = 0; long loopTime1 = System.currentTimeMillis(); for(int i=0;i<handshakeIPs.length;i++){ Peer peer = handshakeIPs[i]; FreenetInetAddress addr = peer.getFreenetAddress(); if(!crypto.allowConnection(pn, addr)) { if(logMINOR) Logger.minor(this, "Not sending handshake packet to "+peer+" for "+pn); } if(peer.getAddress(false) == null) { if(logMINOR) Logger.minor(this, "Not sending handshake to "+handshakeIPs[i]+" for "+pn.getPeer()+" because the DNS lookup failed or it's a currently unsupported IPv6 address"); continue; } if((!pn.allowLocalAddresses()) && (!peer.isRealInternetAddress(false, false))) { if(logMINOR) Logger.minor(this, "Not sending handshake to "+handshakeIPs[i]+" for "+pn.getPeer()+" because it's not a real Internet address and metadata.allowLocalAddresses is not true"); continue; } if(negType == 1) sendFirstHalfDHPacket(0, negType, ctx.getOurExponential(), pn, peer); else sendMessage1(pn, peer); if(logMINOR) Logger.minor(this, "Sending handshake to "+peer+" for "+pn+" ("+i+" of "+handshakeIPs.length); pn.sentHandshake(); sentCount += 1; } long loopTime2 = System.currentTimeMillis(); if((loopTime2 - loopTime1) > 1000) Logger.normal(this, "loopTime2 is more than a second after loopTime1 ("+(loopTime2 - loopTime1)+") working on "+pn.userToString()); if(sentCount==0) { pn.couldNotSendHandshake(); } } /* (non-Javadoc)
<<<<<<< if(source instanceof SeedClientPeerNode) { short maxHTL = node.maxHTL(); if(htl != maxHTL) { Logger.error(this, "Announcement from seed client not at max HTL: "+htl+" for "+source); htl = maxHTL; } } AnnouncementCallback cb = null; if(logMINOR) { final String origin = source.toString()+" (htl "+htl+")"; // Log the progress of the announcement. // This is similar to Announcer's logging. cb = new AnnouncementCallback() { private int totalAdded; private int totalNotWanted; private boolean acceptedSomewhere; @Override public synchronized void acceptedSomewhere() { acceptedSomewhere = true; } @Override public void addedNode(PeerNode pn) { synchronized(this) { totalAdded++; } Logger.error(this, "Announcement from "+origin+" added node "+pn+" - THIS SHOULD NOT HAPPEN!"); return; } @Override public void bogusNoderef(String reason) { Logger.minor(this, "Announcement from "+origin+" got bogus noderef: "+reason, new Exception("debug")); } @Override public void completed() { synchronized(this) { Logger.minor(this, "Announcement from "+origin+" completed"); } int shallow=node.maxHTL()-(totalAdded+totalNotWanted); if(acceptedSomewhere) Logger.minor(this, "Announcement from "+origin+" completed ("+totalAdded+" added, "+totalNotWanted+" not wanted, "+shallow+" shallow)"); else Logger.minor(this, "Announcement from "+origin+" not accepted anywhere."); } @Override public void nodeFailed(PeerNode pn, String reason) { Logger.minor(this, "Announcement from "+origin+" failed: "+reason); } @Override public void noMoreNodes() { Logger.minor(this, "Announcement from "+origin+" ran out of nodes (route not found)"); } @Override public void nodeNotWanted() { synchronized(this) { totalNotWanted++; } Logger.minor(this, "Announcement from "+origin+" returned node not wanted for a total of "+totalNotWanted+" from this announcement)"); } @Override public void nodeNotAdded() { Logger.minor(this, "Announcement from "+origin+" : node not wanted (maybe already have it, opennet just turned off, etc)"); } @Override public void relayedNoderef() { synchronized(this) { totalAdded++; Logger.minor(this, "Announcement from "+origin+" accepted by a downstream node, relaying noderef for a total of "+totalAdded+" from this announcement)"); } } }; } AnnounceSender sender = new AnnounceSender(target, htl, uid, source, om, node, xferUID, noderefLength, paddedLength, cb); ======= AnnouncementCallback cb = null; if(logMINOR) { final String origin = source.toString()+" (htl "+htl+")"; // Log the progress of the announcement. // This is similar to Announcer's logging. cb = new AnnouncementCallback() { private int totalAdded; private int totalNotWanted; private boolean acceptedSomewhere; @Override public synchronized void acceptedSomewhere() { acceptedSomewhere = true; } @Override public void addedNode(PeerNode pn) { synchronized(this) { totalAdded++; } Logger.minor(this, "Announcement from "+origin+" added node "+pn+(pn instanceof SeedClientPeerNode ? " (seed server added the peer directly)" : "")); return; } @Override public void bogusNoderef(String reason) { Logger.minor(this, "Announcement from "+origin+" got bogus noderef: "+reason, new Exception("debug")); } @Override public void completed() { synchronized(this) { Logger.minor(this, "Announcement from "+origin+" completed"); } int shallow=node.maxHTL()-(totalAdded+totalNotWanted); if(acceptedSomewhere) Logger.minor(this, "Announcement from "+origin+" completed ("+totalAdded+" added, "+totalNotWanted+" not wanted, "+shallow+" shallow)"); else Logger.minor(this, "Announcement from "+origin+" not accepted anywhere."); } @Override public void nodeFailed(PeerNode pn, String reason) { Logger.minor(this, "Announcement from "+origin+" failed: "+reason); } @Override public void noMoreNodes() { Logger.minor(this, "Announcement from "+origin+" ran out of nodes (route not found)"); } @Override public void nodeNotWanted() { synchronized(this) { totalNotWanted++; } Logger.minor(this, "Announcement from "+origin+" returned node not wanted for a total of "+totalNotWanted+" from this announcement)"); } @Override public void nodeNotAdded() { Logger.minor(this, "Announcement from "+origin+" : node not wanted (maybe already have it, opennet just turned off, etc)"); } @Override public void relayedNoderef() { synchronized(this) { totalAdded++; Logger.minor(this, "Announcement from "+origin+" accepted by a downstream node, relaying noderef for a total of "+totalAdded+" from this announcement)"); } } }; } AnnounceSender sender = new AnnounceSender(target, htl, uid, source, om, node, xferUID, noderefLength, paddedLength, cb); >>>>>>> if(source instanceof SeedClientPeerNode) { short maxHTL = node.maxHTL(); if(htl != maxHTL) { Logger.error(this, "Announcement from seed client not at max HTL: "+htl+" for "+source); htl = maxHTL; } } AnnouncementCallback cb = null; if(logMINOR) { final String origin = source.toString()+" (htl "+htl+")"; // Log the progress of the announcement. // This is similar to Announcer's logging. cb = new AnnouncementCallback() { private int totalAdded; private int totalNotWanted; private boolean acceptedSomewhere; @Override public synchronized void acceptedSomewhere() { acceptedSomewhere = true; } @Override public void addedNode(PeerNode pn) { synchronized(this) { totalAdded++; } Logger.minor(this, "Announcement from "+origin+" added node "+pn+(pn instanceof SeedClientPeerNode ? " (seed server added the peer directly)" : "")); return; } @Override public void bogusNoderef(String reason) { Logger.minor(this, "Announcement from "+origin+" got bogus noderef: "+reason, new Exception("debug")); } @Override public void completed() { synchronized(this) { Logger.minor(this, "Announcement from "+origin+" completed"); } int shallow=node.maxHTL()-(totalAdded+totalNotWanted); if(acceptedSomewhere) Logger.minor(this, "Announcement from "+origin+" completed ("+totalAdded+" added, "+totalNotWanted+" not wanted, "+shallow+" shallow)"); else Logger.minor(this, "Announcement from "+origin+" not accepted anywhere."); } @Override public void nodeFailed(PeerNode pn, String reason) { Logger.minor(this, "Announcement from "+origin+" failed: "+reason); } @Override public void noMoreNodes() { Logger.minor(this, "Announcement from "+origin+" ran out of nodes (route not found)"); } @Override public void nodeNotWanted() { synchronized(this) { totalNotWanted++; } Logger.minor(this, "Announcement from "+origin+" returned node not wanted for a total of "+totalNotWanted+" from this announcement)"); } @Override public void nodeNotAdded() { Logger.minor(this, "Announcement from "+origin+" : node not wanted (maybe already have it, opennet just turned off, etc)"); } @Override public void relayedNoderef() { synchronized(this) { totalAdded++; Logger.minor(this, "Announcement from "+origin+" accepted by a downstream node, relaying noderef for a total of "+totalAdded+" from this announcement)"); } } }; } AnnounceSender sender = new AnnounceSender(target, htl, uid, source, om, node, xferUID, noderefLength, paddedLength, cb);
<<<<<<< import freenet.clients.http.updateableelements.AlertElement; import freenet.l10n.L10n; ======= import freenet.l10n.NodeL10n; >>>>>>> import freenet.clients.http.updateableelements.AlertElement; import freenet.l10n.L10n; import freenet.l10n.NodeL10n;
<<<<<<< if(name.equals(SendBookmarkMessage.NAME)) return new SendBookmarkMessage(fs); if(name.equals(SendURIMessage.NAME)) return new SendURIMessage(fs); if(name.equals(SendTextMessage.NAME)) return new SendTextMessage(fs); ======= if(name.equals(DisconnectMessage.NAME)) return new DisconnectMessage(fs); >>>>>>> if(name.equals(SendBookmarkMessage.NAME)) return new SendBookmarkMessage(fs); if(name.equals(SendURIMessage.NAME)) return new SendURIMessage(fs); if(name.equals(SendTextMessage.NAME)) return new SendTextMessage(fs); if(name.equals(DisconnectMessage.NAME)) return new DisconnectMessage(fs);
<<<<<<< assertThat(project.getKey()).isEqualTo(getSphereClientConfig().getProjectKey()); assertThat(project.getName()).isNotEmpty(); assertThat(project.getCountries()).isNotEmpty(); assertThat(project.getLanguages()).isNotEmpty(); assertThat(project.getCreatedAt()).isNotNull(); assertThat(project.getTrialUntil()).isNotNull(); ======= System.err.println(project); assertThat(project.getKey()).isEqualTo(projectKey()); assertThat(project.getName()).overridingErrorMessage("name").isNotEmpty(); assertThat(project.getCountries()).overridingErrorMessage("countries").isNotEmpty(); assertThat(project.getLanguages()).overridingErrorMessage("languages").isNotEmpty(); assertThat(project.getCreatedAt()).overridingErrorMessage("createdAt").isNotNull(); assertThat(project.getTrialUntil()).overridingErrorMessage("trialUntil").isNotNull(); >>>>>>> assertThat(project.getKey()).isEqualTo(getSphereClientConfig().getProjectKey()); assertThat(project.getName()).overridingErrorMessage("name").isNotEmpty(); assertThat(project.getCountries()).overridingErrorMessage("countries").isNotEmpty(); assertThat(project.getLanguages()).overridingErrorMessage("languages").isNotEmpty(); assertThat(project.getCreatedAt()).overridingErrorMessage("createdAt").isNotNull(); assertThat(project.getTrialUntil()).overridingErrorMessage("trialUntil").isNotNull();
<<<<<<< /** Only called for new format connections, for which we don't care about PacketTracker */ public void dumpTracker(SessionKey brokenKey) { synchronized(this) { if(currentTracker == brokenKey) { currentTracker = null; isConnected = false; } else if(previousTracker == brokenKey) previousTracker = null; else if(unverifiedTracker == brokenKey) unverifiedTracker = null; } // Update connected vs not connected status. isConnected(); setPeerNodeStatus(System.currentTimeMillis()); } ======= public void processDecryptedMessage(byte[] data, int offset, int length, int overhead) { Message m = node.usm.decodeSingleMessage(data, offset, length, this, overhead); if(m != null) { node.usm.checkFilters(m, crypto.socket); } } public void sendEncryptedPacket(byte[] data) throws LocalAddressException { crypto.socket.sendPacket(data, getPeer(), allowLocalAddresses()); } public int getMaxPacketSize() { return crypto.socket.getMaxPacketSize(); } public boolean shouldPadDataPackets() { return crypto.config.paddDataPackets(); } public void sentThrottledBytes(int count) { node.outputThrottle.forceGrab(count); } public void onNotificationOnlyPacketSent(int length) { node.nodeStats.reportNotificationOnlyPacketSent(length); } public void resentBytes(int length) { resendByteCounter.sentBytes(length); } // FIXME move this to PacketFormat eventually. public Random paddingGen() { return paddingGen; } >>>>>>> /** Only called for new format connections, for which we don't care about PacketTracker */ public void dumpTracker(SessionKey brokenKey) { synchronized(this) { if(currentTracker == brokenKey) { currentTracker = null; isConnected = false; } else if(previousTracker == brokenKey) previousTracker = null; else if(unverifiedTracker == brokenKey) unverifiedTracker = null; } // Update connected vs not connected status. isConnected(); setPeerNodeStatus(System.currentTimeMillis()); } public void processDecryptedMessage(byte[] data, int offset, int length, int overhead) { Message m = node.usm.decodeSingleMessage(data, offset, length, this, overhead); if(m != null) { node.usm.checkFilters(m, crypto.socket); } } public void sendEncryptedPacket(byte[] data) throws LocalAddressException { crypto.socket.sendPacket(data, getPeer(), allowLocalAddresses()); } public int getMaxPacketSize() { return crypto.socket.getMaxPacketSize(); } public boolean shouldPadDataPackets() { return crypto.config.paddDataPackets(); } public void sentThrottledBytes(int count) { node.outputThrottle.forceGrab(count); } public void onNotificationOnlyPacketSent(int length) { node.nodeStats.reportNotificationOnlyPacketSent(length); } public void resentBytes(int length) { resendByteCounter.sentBytes(length); } // FIXME move this to PacketFormat eventually. public Random paddingGen() { return paddingGen; }
<<<<<<< import freenet.client.filter.ContentFilter; import freenet.client.filter.UnsafeContentTypeException; import freenet.client.filter.ContentFilter.FilterOutput; ======= import freenet.client.filter.ContentFilter; import freenet.client.filter.UnsafeContentTypeException; import freenet.client.filter.ContentFilter.FilterStatus; >>>>>>> import freenet.client.filter.ContentFilter; import freenet.client.filter.UnsafeContentTypeException; import freenet.client.filter.ContentFilter.FilterStatus; <<<<<<< //Filter the data, if we are supposed to if(ctx.filterData){ if(logMINOR) Logger.minor(this, "Running content filter... Prefetch hook: "+ctx.prefetchHook+" tagReplacer: "+ctx.tagReplacer); try { String mimeType = ctx.overrideMIME != null ? ctx.overrideMIME: expectedMIME; if(mimeType.compareTo("application/xhtml+xml") == 0) mimeType = "text/html"; assert(result.asBucket() != returnBucket); FilterOutput filter = ContentFilter.filter(result.asBucket(), returnBucket, mimeType, uri.toURI("/"), ctx.prefetchHook, ctx.tagReplacer, ctx.charset); result = new FetchResult(result, filter.data); } catch (UnsafeContentTypeException e) { Logger.error(this, "Error filtering content: will not validate", e); onFailure(new FetchException(FetchException.CONTENT_VALIDATION_FAILED, expectedSize, e.getMessage(), e, ctx.overrideMIME != null ? ctx.overrideMIME : expectedMIME), state/*Not really the state's fault*/, container, context); return; } catch (URISyntaxException e) { // Impossible Logger.error(this, "URISyntaxException converting a FreenetURI to a URI!: "+e, e); onFailure(new FetchException(FetchException.INTERNAL_ERROR, e), state/*Not really the state's fault*/, container, context); return; } catch (IOException e) { Logger.error(this, "Error filtering content", e); onFailure(new FetchException(FetchException.BUCKET_ERROR, e), state/*Not really the state's fault*/, container, context); return; } } else { if(logMINOR) Logger.minor(this, "Ignoring content filter."); } if(returnBucket == null) if(logMINOR) Logger.minor(this, "Returnbucket is null"); ======= //Filter the data, if we are supposed to if(ctx.filterData){ if(logMINOR) Logger.minor(this, "Running content filter... Prefetch hook: "+ctx.prefetchHook+" tagReplacer: "+ctx.tagReplacer); InputStream input = null; OutputStream output = null; try { String mimeType = ctx.overrideMIME != null ? ctx.overrideMIME: expectedMIME; if(mimeType.compareTo("application/xhtml+xml") == 0) mimeType = "text/html"; Bucket filteredResult; if(returnBucket == null) filteredResult = context.getBucketFactory(persistent()).makeBucket(-1); else filteredResult = returnBucket; input = result.asBucket().getInputStream(); output = filteredResult.getOutputStream(); FilterStatus filterStatus = ContentFilter.filter(input, output, mimeType, uri.toURI("/"), ctx.prefetchHook, ctx.tagReplacer, ctx.charset); input.close(); output.close(); String detectedMIMEType = filterStatus.mimeType.concat(filterStatus.charset == null ? "" : "; charset="+filterStatus.charset); result = new FetchResult(new ClientMetadata(detectedMIMEType), result.asBucket()); } catch (UnsafeContentTypeException e) { Logger.error(this, "Error filtering content: will not validate", e); onFailure(new FetchException(FetchException.CONTENT_VALIDATION_FAILED, expectedSize, e.getMessage(), e, ctx.overrideMIME != null ? ctx.overrideMIME : expectedMIME), state/*Not really the state's fault*/, container, context); return; } catch (Exception e) { Logger.error(this, "Error filtering content", e); onFailure(new FetchException(FetchException.CONTENT_VALIDATION_FAILED), state/*Not really the state's fault*/, container, context); return; } finally { Closer.close(input); Closer.close(output); } } else { if(logMINOR) Logger.minor(this, "Ignoring content filter."); } if(returnBucket == null) if(logMINOR) Logger.minor(this, "Returnbucket is null"); >>>>>>> //Filter the data, if we are supposed to if(ctx.filterData){ if(logMINOR) Logger.minor(this, "Running content filter... Prefetch hook: "+ctx.prefetchHook+" tagReplacer: "+ctx.tagReplacer); InputStream input = null; OutputStream output = null; try { String mimeType = ctx.overrideMIME != null ? ctx.overrideMIME: expectedMIME; if(mimeType.compareTo("application/xhtml+xml") == 0) mimeType = "text/html"; assert(result.asBucket() != returnBucket); Bucket filteredResult; if(returnBucket == null) filteredResult = context.getBucketFactory(persistent()).makeBucket(-1); else filteredResult = returnBucket; input = result.asBucket().getInputStream(); output = filteredResult.getOutputStream(); FilterStatus filterStatus = ContentFilter.filter(input, output, mimeType, uri.toURI("/"), ctx.prefetchHook, ctx.tagReplacer, ctx.charset); input.close(); output.close(); String detectedMIMEType = filterStatus.mimeType.concat(filterStatus.charset == null ? "" : "; charset="+filterStatus.charset); result = new FetchResult(new ClientMetadata(detectedMIMEType), result.asBucket()); } catch (UnsafeContentTypeException e) { Logger.error(this, "Error filtering content: will not validate", e); onFailure(new FetchException(FetchException.CONTENT_VALIDATION_FAILED, expectedSize, e.getMessage(), e, ctx.overrideMIME != null ? ctx.overrideMIME : expectedMIME), state/*Not really the state's fault*/, container, context); return; } catch (URISyntaxException e) { // Impossible Logger.error(this, "URISyntaxException converting a FreenetURI to a URI!: "+e, e); onFailure(new FetchException(FetchException.INTERNAL_ERROR, e), state/*Not really the state's fault*/, container, context); return; } catch (IOException e) { Logger.error(this, "Error filtering content", e); onFailure(new FetchException(FetchException.BUCKET_ERROR, e), state/*Not really the state's fault*/, container, context); return; } finally { Closer.close(input); Closer.close(output); } } else { if(logMINOR) Logger.minor(this, "Ignoring content filter."); } if(returnBucket == null) if(logMINOR) Logger.minor(this, "Returnbucket is null");
<<<<<<< r = new BufferedReader(new InputStreamReader(bis, parseCharset), 4096); HTMLParseContext pc = new HTMLParseContext(r, w, null, new NullFilterCallback()); ======= try { r = new BufferedReader(new InputStreamReader(bis, parseCharset), 4096); } catch (UnsupportedEncodingException e) { strm.close(); throw e; } HTMLParseContext pc = new HTMLParseContext(r, w, null, new NullFilterCallback(), true); >>>>>>> r = new BufferedReader(new InputStreamReader(bis, parseCharset), 4096); HTMLParseContext pc = new HTMLParseContext(r, w, null, new NullFilterCallback(), true);
<<<<<<< import freenet.support.compress.Compressor; ======= import freenet.support.Logger.LogLevel; >>>>>>> import freenet.support.compress.Compressor; import freenet.support.Logger.LogLevel; <<<<<<< public void onSuccess(FetchResult result, List<? extends Compressor> decompressors, ClientGetState state, ObjectContainer container, ClientContext context) { if(Logger.shouldLog(Logger.MINOR, this)) ======= public void onSuccess(FetchResult result, ClientGetState state, ObjectContainer container, ClientContext context) { if(Logger.shouldLog(LogLevel.MINOR, this)) >>>>>>> public void onSuccess(FetchResult result, List<? extends Compressor> decompressors, ClientGetState state, ObjectContainer container, ClientContext context) { if(Logger.shouldLog(LogLevel.MINOR, this))
<<<<<<< public void onLostConnection(ObjectContainer container, ClientContext context) { ======= @Override public void onLostConnection() { >>>>>>> @Override public void onLostConnection(ObjectContainer container, ClientContext context) { <<<<<<< public void requestWasRemoved(ObjectContainer container) { ======= @Override public void requestWasRemoved() { >>>>>>> @Override public void requestWasRemoved(ObjectContainer container) { <<<<<<< public void sendPendingMessages(FCPConnectionOutputHandler handler, boolean includePersistentRequest, boolean includeData, boolean onlyData, ObjectContainer container) { ======= @Override public void sendPendingMessages(FCPConnectionOutputHandler handler, boolean includePersistentRequest, boolean includeData, boolean onlyData) { >>>>>>> @Override public void sendPendingMessages(FCPConnectionOutputHandler handler, boolean includePersistentRequest, boolean includeData, boolean onlyData, ObjectContainer container) { <<<<<<< public synchronized double getSuccessFraction(ObjectContainer container) { if(persistenceType == PERSIST_FOREVER && progressMessage != null) container.activate(progressMessage, 2); ======= @Override public synchronized double getSuccessFraction() { >>>>>>> @Override public synchronized double getSuccessFraction(ObjectContainer container) { if(persistenceType == PERSIST_FOREVER && progressMessage != null) container.activate(progressMessage, 2); <<<<<<< public synchronized double getTotalBlocks(ObjectContainer container) { if(persistenceType == PERSIST_FOREVER && progressMessage != null) container.activate(progressMessage, 2); ======= @Override public synchronized double getTotalBlocks() { >>>>>>> @Override public synchronized double getTotalBlocks(ObjectContainer container) { if(persistenceType == PERSIST_FOREVER && progressMessage != null) container.activate(progressMessage, 2); <<<<<<< public synchronized double getMinBlocks(ObjectContainer container) { if(persistenceType == PERSIST_FOREVER && progressMessage != null) container.activate(progressMessage, 2); ======= @Override public synchronized double getMinBlocks() { >>>>>>> @Override public synchronized double getMinBlocks(ObjectContainer container) { if(persistenceType == PERSIST_FOREVER && progressMessage != null) container.activate(progressMessage, 2); <<<<<<< public synchronized double getFailedBlocks(ObjectContainer container) { if(persistenceType == PERSIST_FOREVER && progressMessage != null) container.activate(progressMessage, 2); ======= @Override public synchronized double getFailedBlocks() { >>>>>>> @Override public synchronized double getFailedBlocks(ObjectContainer container) { if(persistenceType == PERSIST_FOREVER && progressMessage != null) container.activate(progressMessage, 2); <<<<<<< public synchronized double getFatalyFailedBlocks(ObjectContainer container) { if(persistenceType == PERSIST_FOREVER && progressMessage != null) container.activate(progressMessage, 2); ======= @Override public synchronized double getFatalyFailedBlocks() { >>>>>>> @Override public synchronized double getFatalyFailedBlocks(ObjectContainer container) { if(persistenceType == PERSIST_FOREVER && progressMessage != null) container.activate(progressMessage, 2); <<<<<<< public synchronized double getFetchedBlocks(ObjectContainer container) { if(persistenceType == PERSIST_FOREVER && progressMessage != null) container.activate(progressMessage, 2); ======= @Override public synchronized double getFetchedBlocks() { >>>>>>> @Override public synchronized double getFetchedBlocks(ObjectContainer container) { if(persistenceType == PERSIST_FOREVER && progressMessage != null) container.activate(progressMessage, 2); <<<<<<< public synchronized boolean isTotalFinalized(ObjectContainer container) { ======= @Override public synchronized boolean isTotalFinalized() { >>>>>>> @Override public synchronized boolean isTotalFinalized(ObjectContainer container) { <<<<<<< public synchronized String getFailureReason(ObjectContainer container) { ======= @Override public synchronized String getFailureReason() { >>>>>>> @Override public synchronized String getFailureReason(ObjectContainer container) {
<<<<<<< private final Set<FeedCallback> subscribers; /** Listeners that will be notified when the alerts list is changed*/ private final Set<UserEventListener> listeners; ======= private final Set<FCPConnectionHandler> subscribers; >>>>>>> /** Listeners that will be notified when the alerts list is changed*/ private final Set<UserEventListener> listeners; private final Set<FCPConnectionHandler> subscribers; <<<<<<< subscribers = new CopyOnWriteArraySet<FeedCallback>(); listeners = new CopyOnWriteArraySet<UserEventListener>(); ======= subscribers = new CopyOnWriteArraySet<FCPConnectionHandler>(); >>>>>>> listeners = new CopyOnWriteArraySet<UserEventListener>(); subscribers = new CopyOnWriteArraySet<FCPConnectionHandler>(); <<<<<<< ======= public HTMLNode createAlerts() { return createAlerts(true); } /** * Write the alerts as HTML. */ public HTMLNode createAlerts(boolean showOnlyErrors) { HTMLNode alertsNode = new HTMLNode("div"); UserAlert[] alerts = getAlerts(); int totalNumber = 0; for (int i = 0; i < alerts.length; i++) { UserAlert alert = alerts[i]; if(showOnlyErrors && alert.getPriorityClass() > alert.ERROR) continue; if (!alert.isValid()) continue; totalNumber++; alertsNode.addChild("a", "name", alert.anchor()); alertsNode.addChild(renderAlert(alert)); } if (totalNumber == 0) { return new HTMLNode("#", ""); } return alertsNode; } >>>>>>> <<<<<<< public static String l10n(String key) { return L10n.getString("UserAlertManager."+key); ======= public HTMLNode createSummary() { // This method is called by the toadlets when they want to show // a summary of alerts. With a status bar, we only show full errors here. return createAlerts(true); } /** * Write the alert summary as HTML to a StringBuilder */ public HTMLNode createSummary(boolean oneLine) { short highestLevel = 99; int numberOfCriticalError = 0; int numberOfError = 0; int numberOfWarning = 0; int numberOfMinor = 0; int totalNumber = 0; UserAlert[] alerts = getAlerts(); for (int i = 0; i < alerts.length; i++) { UserAlert alert = alerts[i]; if (!alert.isValid()) continue; short level = alert.getPriorityClass(); if (level < highestLevel) highestLevel = level; if (level <= UserAlert.CRITICAL_ERROR) numberOfCriticalError++; else if (level <= UserAlert.ERROR) numberOfError++; else if (level <= UserAlert.WARNING) numberOfWarning++; else if (level <= UserAlert.MINOR) numberOfMinor++; totalNumber++; } if(numberOfMinor == 0 && numberOfWarning == 0 && oneLine) return null; if (totalNumber == 0) return new HTMLNode("#", ""); boolean separatorNeeded = false; String separator = oneLine?", ":" | "; int messageTypes=0; StringBuilder alertSummaryString = new StringBuilder(1024); if (numberOfCriticalError != 0 && !oneLine) { alertSummaryString.append(l10n("criticalErrorCountLabel")).append(' ').append(numberOfCriticalError); separatorNeeded = true; messageTypes++; } if (numberOfError != 0 && !oneLine) { if (separatorNeeded) alertSummaryString.append(separator); alertSummaryString.append(l10n("errorCountLabel")).append(' ').append(numberOfError); separatorNeeded = true; messageTypes++; } if (numberOfWarning != 0) { if (separatorNeeded) alertSummaryString.append(separator); if(oneLine) { alertSummaryString.append(numberOfWarning).append(' ').append(l10n("warningCountLabel").replace(":", "")); } else { alertSummaryString.append(l10n("warningCountLabel")).append(' ').append(numberOfWarning); } separatorNeeded = true; messageTypes++; } if (numberOfMinor != 0) { if (separatorNeeded) alertSummaryString.append(separator); if(oneLine) { alertSummaryString.append(numberOfMinor).append(' ').append(l10n("minorCountLabel").replace(":", "")); } else { alertSummaryString.append(l10n("minorCountLabel")).append(' ').append(numberOfMinor); } separatorNeeded = true; messageTypes++; } if (messageTypes != 1 && !oneLine) { if (separatorNeeded) alertSummaryString.append(separator); alertSummaryString.append(l10n("totalLabel")).append(' ').append(totalNumber); } HTMLNode summaryBox = null; String classes = oneLine?"alerts-line contains-":"infobox infobox-"; if (highestLevel <= UserAlert.CRITICAL_ERROR && !oneLine) summaryBox = new HTMLNode("div", "class", classes + "error"); else if (highestLevel <= UserAlert.ERROR && !oneLine) summaryBox = new HTMLNode("div", "class", classes + "alert"); else if (highestLevel <= UserAlert.WARNING) summaryBox = new HTMLNode("div", "class", classes + "warning"); else if (highestLevel <= UserAlert.MINOR) summaryBox = new HTMLNode("div", "class", classes + "information"); summaryBox.addChild("div", "class", "infobox-header", l10n("alertsTitle")); HTMLNode summaryContent = summaryBox.addChild("div", "class", "infobox-content"); if(!oneLine) { summaryContent.addChild("#", alertSummaryString.toString() + separator); NodeL10n.getBase().addL10nSubstitution(summaryContent, "UserAlertManager.alertsOnAlertsPage", new String[] { "link", "/link" }, new String[] { "<a href=\"/alerts/\">", "</a>" }); } else { summaryContent.addChild("a", "href", "/alerts/", NodeL10n.getBase().getString("StatusBar.alerts") + " " + alertSummaryString.toString()); } summaryBox.addAttribute("id", "messages-summary-box"); return summaryBox; } private String l10n(String key) { return NodeL10n.getBase().getString("UserAlertManager."+key); >>>>>>> public static String l10n(String key) { return NodeL10n.getBase().getString("UserAlertManager."+key);
<<<<<<< import java.util.Random; import com.db4o.ObjectContainer; import com.db4o.ObjectSet; import com.db4o.query.Predicate; ======= import java.util.Random; >>>>>>> import java.util.Random; import com.db4o.ObjectContainer; import com.db4o.ObjectSet; import com.db4o.query.Predicate; <<<<<<< import java.io.FileFilter; ======= >>>>>>> <<<<<<< // Persisting requests in the database means we don't register() files... // So keep all the temp files for now. // FIXME: tidy up unwanted temp files. // Iterator i = originalFiles.iterator(); // while(i.hasNext()) { // File f = (File) (i.next()); // if(Logger.shouldLog(Logger.MINOR, this)) // Logger.minor(this, "Deleting old tempfile "+f); // f.delete(); // } ======= Iterator<File> i = originalFiles.iterator(); while(i.hasNext()) { File f = (i.next()); if(Logger.shouldLog(Logger.MINOR, this)) Logger.minor(this, "Deleting old tempfile "+f); f.delete(); } >>>>>>> // Persisting requests in the database means we don't register() files... // So keep all the temp files for now. // FIXME: tidy up unwanted temp files. // Iterator<File> i = originalFiles.iterator(); // while(i.hasNext()) { // File f = (File) (i.next()); // if(Logger.shouldLog(Logger.MINOR, this)) // Logger.minor(this, "Deleting old tempfile "+f); // f.delete(); // }
<<<<<<< public short getType() { return TYPE; } ======= /** * @return The key, hashed, converted to a double in the range * 0.0 to 1.0. */ public synchronized double toNormalizedDouble() { if(cachedNormalizedDouble > 0) return cachedNormalizedDouble; MessageDigest md; try { md = MessageDigest.getInstance("SHA-256"); } catch (NoSuchAlgorithmException e) { throw new Error(e); } md.update(routingKey); md.update((byte)(TYPE >> 8)); md.update((byte)TYPE); byte[] digest = md.digest(); long asLong = Math.abs(Fields.bytesToLong(digest)); // Math.abs can actually return negative... if(asLong == Long.MIN_VALUE) asLong = Long.MAX_VALUE; cachedNormalizedDouble = ((double)asLong)/((double)Long.MAX_VALUE); return cachedNormalizedDouble; } public byte[] getRoutingKey(){ return routingKey; } >>>>>>> public short getType() { return TYPE; } public byte[] getRoutingKey(){ return routingKey; }
<<<<<<< public void onSuccess(ClientKeyBlock block, boolean fromStore, Object token, ObjectContainer container, ClientContext context) { if(persistent) { container.activate(parent, 1); container.activate(ctx, 1); } ======= @Override public void onSuccess(ClientKeyBlock block, boolean fromStore, Object token, RequestScheduler sched) { this.sched = sched; >>>>>>> @Override public void onSuccess(ClientKeyBlock block, boolean fromStore, Object token, ObjectContainer container, ClientContext context) { if(persistent) { container.activate(parent, 1); container.activate(ctx, 1); } <<<<<<< protected void onSuccess(FetchResult result, ObjectContainer container, ClientContext context) { if(persistent) { container.activate(decompressors, 1); container.activate(parent, 1); container.activate(ctx, 1); container.activate(rcb, 1); } ======= @Override protected void onSuccess(FetchResult result, RequestScheduler sched) { this.sched = sched; unregister(false); >>>>>>> @Override protected void onSuccess(FetchResult result, ObjectContainer container, ClientContext context) { if(persistent) { container.activate(decompressors, 1); container.activate(parent, 1); container.activate(ctx, 1); container.activate(rcb, 1); }
<<<<<<< public synchronized boolean hasValidKeys(KeysFetchingLocally fetching, ObjectContainer container, ClientContext context) { ======= @Override public synchronized boolean hasValidKeys(KeysFetchingLocally fetching) { >>>>>>> @Override public synchronized boolean hasValidKeys(KeysFetchingLocally fetching, ObjectContainer container, ClientContext context) { <<<<<<< public RequestClient getClient() { ======= @Override public Object getClient() { >>>>>>> @Override public RequestClient getClient() { <<<<<<< public short getPriorityClass(ObjectContainer container) { ======= @Override public short getPriorityClass() { >>>>>>> @Override public short getPriorityClass(ObjectContainer container) { <<<<<<< public void internalError(Throwable t, RequestScheduler sched, ObjectContainer container, ClientContext context, boolean persistent) { ======= @Override public void internalError(Object keyNum, Throwable t, RequestScheduler sched) { >>>>>>> @Override public void internalError(Throwable t, RequestScheduler sched, ObjectContainer container, ClientContext context, boolean persistent) { <<<<<<< @Override public SendableRequestSender getSender(ObjectContainer container, ClientContext context) { return new SendableRequestSender() { public boolean send(NodeClientCore core, RequestScheduler sched, ClientContext context, ChosenBlock req) { Key key = (Key) req.token; // Have to cache it in order to propagate it; FIXME // Don't let a node force us to start a real request for a specific key. // We check the datastore, take up offers if any (on a short timeout), and then quit if we still haven't fetched the data. // Obviously this may have a marginal impact on load but it should only be marginal. core.asyncGet(key, true, true, new SimpleRequestSenderCompletionListener() { public void completed(boolean success) { // Ignore } }); return true; ======= @Override public boolean send(NodeClientCore node, RequestScheduler sched, Object keyNum) { Key key = (Key) keyNum; // Have to cache it in order to propagate it; FIXME // Don't let a node force us to start a real request for a specific key. // We check the datastore, take up offers if any (on a short timeout), and then quit if we still haven't fetched the data. // Obviously this may have a marginal impact on load but it should only be marginal. core.asyncGet(key, true, true, new SimpleRequestSenderCompletionListener() { public void completed(boolean success) { // Ignore >>>>>>> @Override public SendableRequestSender getSender(ObjectContainer container, ClientContext context) { return new SendableRequestSender() { public boolean send(NodeClientCore core, RequestScheduler sched, ClientContext context, ChosenBlock req) { Key key = (Key) req.token; // Have to cache it in order to propagate it; FIXME // Don't let a node force us to start a real request for a specific key. // We check the datastore, take up offers if any (on a short timeout), and then quit if we still haven't fetched the data. // Obviously this may have a marginal impact on load but it should only be marginal. core.asyncGet(key, true, true, new SimpleRequestSenderCompletionListener() { public void completed(boolean success) { // Ignore } }); return true; <<<<<<< public boolean isCancelled(ObjectContainer container) { ======= @Override public boolean isCancelled() { >>>>>>> @Override public boolean isCancelled(ObjectContainer container) { <<<<<<< public Key getNodeKey(Object token, ObjectContainer container) { ======= @Override public Key getNodeKey(Object token) { >>>>>>> @Override public Key getNodeKey(Object token, ObjectContainer container) {
<<<<<<< contentNode.addChild(new AlertElement(ctx)); ctx.getPageMaker().drawModeSelectionArray(core, container, contentNode, mode); ======= contentNode.addChild(core.alerts.createSummary()); >>>>>>> contentNode.addChild(new AlertElement(ctx));
<<<<<<< import freenet.support.DoublyLinkedList; ======= import freenet.io.comm.UdpSocketHandler; >>>>>>> import freenet.support.DoublyLinkedList; import freenet.io.comm.UdpSocketHandler;
<<<<<<< private int fetched = 0; ======= /** Stores the fetch context this class was created with*/ private FetchContext fctx; >>>>>>> private int fetched = 0; /** Stores the fetch context this class was created with*/ private FetchContext fctx; <<<<<<< public long lastTouched() { return lastTouched; } ======= public boolean fetchContextEquivalent(FetchContext context) { if(this.fctx.filterData != context.filterData) return false; if(this.fctx.maxOutputLength != context.maxOutputLength) return false; if(this.fctx.maxTempLength != context.maxTempLength) return false; if(this.fctx.charset == null && context.charset != null) return false; if(this.fctx.charset != null && !this.fctx.charset.equals(context.charset)) return false; if(this.fctx.overrideMIME == null && context.overrideMIME != null) return false; if(this.fctx.overrideMIME != null && !this.fctx.overrideMIME.equals(context.overrideMIME)) return false; return true; } >>>>>>> public long lastTouched() { return lastTouched; } public boolean fetchContextEquivalent(FetchContext context) { if(this.fctx.filterData != context.filterData) return false; if(this.fctx.maxOutputLength != context.maxOutputLength) return false; if(this.fctx.maxTempLength != context.maxTempLength) return false; if(this.fctx.charset == null && context.charset != null) return false; if(this.fctx.charset != null && !this.fctx.charset.equals(context.charset)) return false; if(this.fctx.overrideMIME == null && context.overrideMIME != null) return false; if(this.fctx.overrideMIME != null && !this.fctx.overrideMIME.equals(context.overrideMIME)) return false; return true; }
<<<<<<< public void notifyClients(ObjectContainer container, ClientContext context) { ======= @Override public void notifyClients() { >>>>>>> @Override public void notifyClients(ObjectContainer container, ClientContext context) { <<<<<<< public void onTransition(ClientGetState oldState, ClientGetState newState, ObjectContainer container) { ======= @Override public void onTransition(ClientGetState oldState, ClientGetState newState) { >>>>>>> @Override public void onTransition(ClientGetState oldState, ClientGetState newState, ObjectContainer container) {
<<<<<<< <h3 class=released-version id="v1_56_0">1.56.0 (18.12.2020)</h3> <ul> <li class=fixed-in-release>Support customer address by key selection for {@link AddShippingAddressId}, {@link io.sphere.sdk.customers.commands.updateactions.AddBillingAddressId}, {@link io.sphere.sdk.customers.commands.updateactions.RemoveBillingAddressId} and {@link io.sphere.sdk.customers.commands.updateactions.RemoveShippingAddressId}</li> </ul> <h3 class=released-version id="v1_55_0">1.55.0 (01.12.2020)</h3> ======= <h3 class=released-version id="v1_56_0">1.56.0 (04.12.2020)</h3> <ul> <li class=fixed-in-release>Fixed requests for resources by key with special characters by url encoding the key</li> </ul> <h3 class=released-version id="v1_55_0">1.55.0 (23.11.2020)</h3> >>>>>>> <h3 class=released-version id="v1_56_0">1.56.0 (04.12.2020)</h3> <ul> <li class=fixed-in-release>Fixed requests for resources by key with special characters by url encoding the key</li> <li class=fixed-in-release>Support customer address by key selection for {@link AddShippingAddressId}, {@link io.sphere.sdk.customers.commands.updateactions.AddBillingAddressId}, {@link io.sphere.sdk.customers.commands.updateactions.RemoveBillingAddressId} and {@link io.sphere.sdk.customers.commands.updateactions.RemoveShippingAddressId}</li> </ul> <h3 class=released-version id="v1_55_0">1.55.0 (23.11.2020)</h3>
<<<<<<< byte[] data; if(lastRequestData == null) data = null; else { try { data = BucketTools.toByteArray(lastRequestData); } catch (IOException e) { Logger.error(this, "Unable to turn lastRequestData into byte[]: caught I/O exception: "+e, e); data = null; } } for(int i=0;i<cb.length;i++) cb[i].onFoundEdition(ed, origUSK.copy(ed), null, context, lastWasMetadata, lastCompressionCodec, data); ======= >>>>>>> <<<<<<< private void cancelBefore(long curLatest, ClientContext context) { Vector v = null; ======= private void cancelBefore(long curLatest) { Vector<USKAttempt> v = null; >>>>>>> private void cancelBefore(long curLatest, ClientContext context) { Vector<USKAttempt> v = null; <<<<<<< USKAttempt att = (USKAttempt) v.get(i); att.cancel(null, context); ======= USKAttempt att = v.get(i); att.cancel(); >>>>>>> USKAttempt att = v.get(i); att.cancel(null, context);
<<<<<<< import java.util.Locale; import java.util.Random; import java.util.TimeZone; ======= >>>>>>> import java.util.Locale; import java.util.Random; import java.util.TimeZone; <<<<<<< Logger.error(t,"", t); sendError(sock.getOutputStream(), 500, "Internal Error", t.toString(), true, null); ======= String msg = "<html><head><title>"+NodeL10n.getBase().getString("Toadlet.internalErrorTitle")+ "</title></head><body><h1>"+NodeL10n.getBase().getString("Toadlet.internalErrorPleaseReport")+"</h1><pre>"; StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); t.printStackTrace(pw); pw.flush(); msg = msg + sw.toString() + "</pre></body></html>"; byte[] messageBytes = msg.getBytes("UTF-8"); sendReplyHeaders(sock.getOutputStream(), 500, "Internal failure", null, "text/html; charset=UTF-8", messageBytes.length, null, true); sock.getOutputStream().write(messageBytes); >>>>>>> String msg = "<html><head><title>"+NodeL10n.getBase().getString("Toadlet.internalErrorTitle")+ "</title></head><body><h1>"+NodeL10n.getBase().getString("Toadlet.internalErrorPleaseReport")+"</h1><pre>"; StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); t.printStackTrace(pw); pw.flush(); msg = msg + sw.toString() + "</pre></body></html>"; byte[] messageBytes = msg.getBytes("UTF-8"); sendReplyHeaders(sock.getOutputStream(), 500, "Internal failure", null, "text/html; charset=UTF-8", messageBytes.length, null, true); sock.getOutputStream().write(messageBytes);
<<<<<<< import java.util.LinkedList; ======= import java.util.List; import java.util.Random; >>>>>>> import java.util.LinkedList; import java.util.List; import java.util.Random;
<<<<<<< addOfficialPlugin("Freetalk", false, 3, true, new FreenetURI("CHK@5CDmM9m7sIIgy3W035sz8ZuU2-T7D0-Rp8Y-VAYHGGs,j4wc2XGj-s51zvIDk2oazqXLWZPKx-oA8w-D-xXYLJE,AAIC--8/Freetalk.jar"), false, true, false); addOfficialPlugin("WebOfTrust", false, 2, true, new FreenetURI("CHK@ZLNYg5W~K~zb~i3z6rA1ZRI3myKt1K9i-YXEoYuMNLo,c0OUv3Mb47nK3OGcQkgLOfXo2w-IENxNdcop4Ak5h8o,AAIC--8/WebOfTrust.jar"), false, true, false); ======= addOfficialPlugin("Freetalk", false, 2, true, new FreenetURI("CHK@yMk2YONFKscYPSghB~7FG6jj-3qtAde20T7GTEGzx94,eAGQrqT0EUeqHC3kmhZk8hdoaGkjGVcm69vfQYp~fFY,AAIC--8/Freetalk.jar"), false, false, false); addOfficialPlugin("WebOfTrust", false, 1, true, new FreenetURI("CHK@CRtw553rOsZViF52NaLZasHJ0hNtP42Q7gGODaJe4ck,1HSqw0QRCRycuyPENyCGrlHYL6ItmjpnNlqr5FidIXk,AAIC--8/WebOfTrust.jar"), false, false, false); >>>>>>> addOfficialPlugin("Freetalk", false, 3, true, new FreenetURI("CHK@5CDmM9m7sIIgy3W035sz8ZuU2-T7D0-Rp8Y-VAYHGGs,j4wc2XGj-s51zvIDk2oazqXLWZPKx-oA8w-D-xXYLJE,AAIC--8/Freetalk.jar"), false, false, false); addOfficialPlugin("WebOfTrust", false, 2, true, new FreenetURI("CHK@ZLNYg5W~K~zb~i3z6rA1ZRI3myKt1K9i-YXEoYuMNLo,c0OUv3Mb47nK3OGcQkgLOfXo2w-IENxNdcop4Ak5h8o,AAIC--8/WebOfTrust.jar"), false, false, false);
<<<<<<< public SplitFileFetcherSegment(short splitfileType, ClientCHK[] splitfileDataKeys, ClientCHK[] splitfileCheckKeys, SplitFileFetcher fetcher, ArchiveContext archiveContext, FetchContext fetchContext, long maxTempLength, int recursionLevel, ClientRequester requester, int segNum) throws MetadataParseException, FetchException { ======= public SplitFileFetcherSegment(short splitfileType, ClientCHK[] splitfileDataKeys, ClientCHK[] splitfileCheckKeys, SplitFileFetcher fetcher, ArchiveContext archiveContext, FetchContext fetchContext, long maxTempLength, int recursionLevel, boolean ignoreLastDataBlock) throws MetadataParseException, FetchException { >>>>>>> public SplitFileFetcherSegment(short splitfileType, ClientCHK[] splitfileDataKeys, ClientCHK[] splitfileCheckKeys, SplitFileFetcher fetcher, ArchiveContext archiveContext, FetchContext fetchContext, long maxTempLength, int recursionLevel, ClientRequester requester, int segNum, boolean ignoreLastDataBlock) throws MetadataParseException, FetchException { <<<<<<< public void onSuccess(Bucket data, int blockNo, ClientKeyBlock block, ObjectContainer container, ClientContext context, SplitFileFetcherSubSegment sub) { if(persistent) container.activate(this, 1); if(data == null) throw new NullPointerException(); ======= public void onSuccess(Bucket data, int blockNo, SplitFileFetcherSubSegment seg, ClientKeyBlock block) { if(data == null) throw new NullPointerException(); >>>>>>> public void onSuccess(Bucket data, int blockNo, ClientKeyBlock block, ObjectContainer container, ClientContext context, SplitFileFetcherSubSegment sub) { if(persistent) container.activate(this, 1); if(data == null) throw new NullPointerException(); <<<<<<< decodeNow = (!startedDecode) && (fetchedBlocks >= minFetched); ======= haveDataBlocks = fetchedDataBlocks == dataKeys.length; decodeNow = (fetchedBlocks >= minFetched || haveDataBlocks); >>>>>>> haveDataBlocks = fetchedDataBlocks == dataKeys.length; decodeNow = (!startedDecode) && (fetchedBlocks >= minFetched || haveDataBlocks); <<<<<<< if(persistent) container.activate(parentFetcher, 1); parentFetcher.removeMyPendingKeys(this, container, context); if(persistent) container.deactivate(parentFetcher, 1); removeSubSegments(container, context); decode(container, context); } if(persistent) { container.deactivate(parent, 1); ======= removeSubSegments(); if(haveDataBlocks) onDecodedSegment(); else decode(); >>>>>>> if(persistent) container.activate(parentFetcher, 1); parentFetcher.removeMyPendingKeys(this, container, context); if(persistent) container.deactivate(parentFetcher, 1); removeSubSegments(container, context); if(haveDataBlocks) onDecodedSegment(container, context, null, null, null, dataBuckets, checkBuckets); else decode(container, context); } if(persistent) { container.deactivate(parent, 1); <<<<<<< Bucket data = dataBlockStatus[i].getData(); ======= Bucket data = dataBuckets[i].getData(); if(data == null) throw new NullPointerException("Data bucket "+i+" of "+dataBuckets.length+" is null"); >>>>>>> Bucket data = dataBlockStatus[i].getData(); if(data == null) throw new NullPointerException("Data bucket "+i+" of "+dataBuckets.length+" is null"); <<<<<<< if(data == null) throw new NullPointerException(); if(persistent) container.activate(data, 1); BucketTools.copyTo(data, os, Long.MAX_VALUE); ======= if(data == null) throw new NullPointerException("Data bucket "+i+" of "+dataBuckets.length+" is null"); long copied = BucketTools.copyTo(data, os, Long.MAX_VALUE); osSize += copied; if(i != dataBuckets.length-1 && copied != 32768) Logger.error(this, "Copied only "+copied+" bytes from "+data+" (bucket "+i+")"); if(logMINOR) Logger.minor(this, "Copied "+copied+" bytes from bucket "+i); >>>>>>> if(data == null) throw new NullPointerException("Data bucket "+i+" of "+dataBuckets.length+" is null"); if(persistent) container.activate(data, 1); long copied = BucketTools.copyTo(data, os, Long.MAX_VALUE); osSize += copied; if(i != dataBuckets.length-1 && copied != 32768) Logger.error(this, "Copied only "+copied+" bytes from "+data+" (bucket "+i+")"); if(logMINOR) Logger.minor(this, "Copied "+copied+" bytes from bucket "+i); <<<<<<< SplitFileFetcherSubSegment seg = getSubSegment(0, container, false, null); if(persistent) container.activate(seg, 1); seg.addAll(dataRetries.length+checkRetries.length, true, container, context, false); if(logMINOR) Logger.minor(this, "scheduling "+seg+" : "+seg.blockNums); ======= SplitFileFetcherSubSegment seg = getSubSegment(0); for(int i=0;i<dataRetries.length+checkRetries.length;i++) { seg.add(i, true); } >>>>>>> SplitFileFetcherSubSegment seg = getSubSegment(0, container, false, null); if(persistent) container.activate(seg, 1); seg.addAll(dataRetries.length+checkRetries.length, true, container, context, false); if(logMINOR) Logger.minor(this, "scheduling "+seg+" : "+seg.blockNums);
<<<<<<< public void onlyFacetsAreFilteredByColor() throws Exception { final SearchDsl<ProductProjection> search = ProductProjectionSearch.of(STAGED) .plusFacet(MODEL.variants().attribute().ofText(SIZE).facet().allTerms()) .plusFilterFacet(MODEL.variants().attribute().ofText(COLOR).filter().is("blue")); final PagedSearchResult<ProductProjection> pagedSearchResult = execute(search); final TermFacetResult termFacetResult = (TermFacetResult) pagedSearchResult.getFacetsResults().get(SIZE_ATTRIBUTE_KEY); assertThat(termFacetResult.getTerms()).containsExactly(TermStats.of("XL", 1)); final HashSet<String> ids = new HashSet<>(toIds(pagedSearchResult.getResults())); assertThat(ids).contains(testProduct2.getId(), testProduct1.getId()); } @Test ======= >>>>>>> public void onlyFacetsAreFilteredByColor() throws Exception { final SearchDsl<ProductProjection> search = ProductProjectionSearch.of(STAGED) .plusFacet(MODEL.variants().attribute().ofText(SIZE).facet().allTerms()) .plusFilterFacet(MODEL.variants().attribute().ofText(COLOR).filter().is("blue")); final PagedSearchResult<ProductProjection> pagedSearchResult = execute(search); final TermFacetResult termFacetResult = (TermFacetResult) pagedSearchResult.getFacetsResults().get(SIZE_ATTRIBUTE_KEY); assertThat(termFacetResult.getTerms()).containsExactly(TermStats.of("XL", 1)); final HashSet<String> ids = new HashSet<>(toIds(pagedSearchResult.getResults())); assertThat(ids).contains(testProduct2.getId(), testProduct1.getId()); } @Test <<<<<<< private void testSorting(SearchSort<ProductProjection> sphereSort, List<String> expected) { final SearchDsl<ProductProjection> search = ProductProjectionSearch.of(STAGED) .withSort(sphereSort); final PagedSearchResult<ProductProjection> pagedSearchResult = execute(search); final List<String> filteredId = toIds(pagedSearchResult.getResults()).stream() .filter(id -> id.equals(testProduct1.getId()) || id.equals(testProduct2.getId())).collect(toList()); assertThat(filteredId).isEqualTo(expected); } protected static <T> T execute(final ClientRequest<T> clientRequest, final Predicate<T> isOk) { return execute(clientRequest, 12, isOk); ======= protected static <T> T execute(final SphereRequest<T> clientRequest, final Predicate<T> isOk) { return execute(clientRequest, 9, isOk); >>>>>>> private void testSorting(SearchSort<ProductProjection> sphereSort, List<String> expected) { final SearchDsl<ProductProjection> search = ProductProjectionSearch.of(STAGED) .withSort(sphereSort); final PagedSearchResult<ProductProjection> pagedSearchResult = execute(search); final List<String> filteredId = toIds(pagedSearchResult.getResults()).stream() .filter(id -> id.equals(testProduct1.getId()) || id.equals(testProduct2.getId())).collect(toList()); assertThat(filteredId).isEqualTo(expected); } protected static <T> T execute(final SphereRequest<T> clientRequest, final Predicate<T> isOk) { return execute(clientRequest, 9, isOk);
<<<<<<< cb.onEncode(pubUSK.copy(edition), this, container, context); parent.addMustSucceedBlocks(1, container); parent.completedBlock(true, container, context); cb.onSuccess(this, container, context); ======= cb.onEncode(pubUSK.copy(edition), this); parent.addMustSucceedBlocks(1); parent.completedBlock(true); cb.onSuccess(this); if(freeData) data.free(); >>>>>>> cb.onEncode(pubUSK.copy(edition), this, container, context); parent.addMustSucceedBlocks(1, container); parent.completedBlock(true, container, context); cb.onSuccess(this, container, context); if(freeData) data.free(); <<<<<<< ctx, this, isMetadata, sourceLength, token, getCHKOnly, false, true /* we don't use it */, tokenObject, container, context, parent.persistent()); ======= ctx, this, isMetadata, sourceLength, token, getCHKOnly, false, true /* we don't use it */, tokenObject, freeData); >>>>>>> ctx, this, isMetadata, sourceLength, token, getCHKOnly, false, true /* we don't use it */, tokenObject, container, context, parent.persistent(), freeData); <<<<<<< cb.onFailure(e, this, container, context); ======= cb.onFailure(e, this); synchronized(this) { finished = true; } if(freeData) data.free(); >>>>>>> cb.onFailure(e, this, container, context); synchronized(this) { finished = true; } if(freeData) data.free(); <<<<<<< boolean getCHKOnly, boolean addToParent, Object tokenObject, ObjectContainer container, ClientContext context) throws MalformedURLException { ======= boolean getCHKOnly, boolean addToParent, Object tokenObject, boolean freeData) throws MalformedURLException { >>>>>>> boolean getCHKOnly, boolean addToParent, Object tokenObject, ObjectContainer container, ClientContext context, boolean freeData) throws MalformedURLException { <<<<<<< cb.onFailure(new InsertException(InsertException.CANCELLED), this, container, context); ======= if(freeData) data.free(); cb.onFailure(new InsertException(InsertException.CANCELLED), this); >>>>>>> if(freeData) data.free(); cb.onFailure(new InsertException(InsertException.CANCELLED), this, container, context);
<<<<<<< <li class=new-in-release>{@link io.sphere.sdk.client.correlationid.CorrelationIdRequestDecorator} to attach a user-defined correlation id value as a header for the header with key "X-Correlation-ID" on CTP requests.</li> ======= <li class=new-in-release>Added new method {@link ParcelDraft#of(TrackingData, List)}</li> >>>>>>> <li class=new-in-release>Added new method {@link ParcelDraft#of(TrackingData, List)}</li> <li class=new-in-release>{@link io.sphere.sdk.client.correlationid.CorrelationIdRequestDecorator} to attach a user-defined correlation id value as a header for the header with key "X-Correlation-ID" on CTP requests.</li>
<<<<<<< /** Must be included as a hidden field in order for any dangerous HTTP operation to complete successfully. */ ======= public NodeRestartJobsQueue restartJobsQueue; /** * <p>Must be included as a hidden field in order for any dangerous HTTP operation to complete successfully.</p> * <p>The name of the variable is badly chosen: formPassword is an <a href="https://www.owasp.org/index.php/Cross-Site_Request_Forgery_%28CSRF%29"> * anti-CSRF token</a>. As for when to use one, two rules:</p> * <p>1) if you're changing server side state, you need a POST request</p> * <p>2) all POST requests need an anti-CSRF token (the exception being a login page, where credentials -that are unpredictable to an attacker- * are exchanged).</p> * <p>In practice this means that you must use POST whenever the request can change anything such as your database contents. Other words for this would * be requests which change your database or "write" requests. Read-only requests can be GET. * When processing the POST-request, you MUST validate that the received password matches this variable. If it does not, you must NOT process the request. * In particular, you must NOT modify anything.</p> * <p>To produce a form which already contains the password, use {@link PluginRespirator#addFormChild(freenet.support.HTMLNode, String, String)}.</p> * <p>To validate that the right password was received, use {@link WebInterfaceToadlet#isFormPassword(HTTPRequest)}.</p> */ >>>>>>> /** * <p>Must be included as a hidden field in order for any dangerous HTTP operation to complete successfully.</p> * <p>The name of the variable is badly chosen: formPassword is an <a href="https://www.owasp.org/index.php/Cross-Site_Request_Forgery_%28CSRF%29"> * anti-CSRF token</a>. As for when to use one, two rules:</p> * <p>1) if you're changing server side state, you need a POST request</p> * <p>2) all POST requests need an anti-CSRF token (the exception being a login page, where credentials -that are unpredictable to an attacker- * are exchanged).</p> * <p>In practice this means that you must use POST whenever the request can change anything such as your database contents. Other words for this would * be requests which change your database or "write" requests. Read-only requests can be GET. * When processing the POST-request, you MUST validate that the received password matches this variable. If it does not, you must NOT process the request. * In particular, you must NOT modify anything.</p> * <p>To produce a form which already contains the password, use {@link PluginRespirator#addFormChild(freenet.support.HTMLNode, String, String)}.</p> * <p>To validate that the right password was received, use {@link WebInterfaceToadlet#isFormPassword(HTTPRequest)}.</p> */
<<<<<<< public boolean hasValidKeys(KeysFetchingLocally fetching, ObjectContainer container, ClientContext context) { if(persistent) container.activate(key, 5); if(chosen) return false; ======= @Override public boolean hasValidKeys(KeysFetchingLocally fetching) { >>>>>>> @Override public boolean hasValidKeys(KeysFetchingLocally fetching, ObjectContainer container, ClientContext context) { if(persistent) container.activate(key, 5); if(chosen) return false; <<<<<<< public ClientKey getKey(Object token, ObjectContainer container) { if(persistent) container.activate(key, 5); ======= @Override public ClientKey getKey(Object token) { >>>>>>> @Override public ClientKey getKey(Object token, ObjectContainer container) { if(persistent) container.activate(key, 5); <<<<<<< public short getPriorityClass(ObjectContainer container) { if(persistent) container.activate(parent, 1); // Not much point deactivating it short retval = parent.getPriorityClass(); return retval; ======= @Override public short getPriorityClass() { return parent.getPriorityClass(); >>>>>>> @Override public short getPriorityClass(ObjectContainer container) { if(persistent) container.activate(parent, 1); // Not much point deactivating it short retval = parent.getPriorityClass(); return retval; <<<<<<< public synchronized boolean isCancelled(ObjectContainer container) { ======= @Override public synchronized boolean isCancelled() { >>>>>>> @Override public synchronized boolean isCancelled(ObjectContainer container) { <<<<<<< public RequestClient getClient() { ======= @Override public Object getClient() { >>>>>>> @Override public RequestClient getClient() { <<<<<<< public boolean dontCache(ObjectContainer container) { return !ctx.cacheLocalRequests; } ======= @Override >>>>>>> public boolean dontCache(ObjectContainer container) { return !ctx.cacheLocalRequests; } @Override <<<<<<< public void onGotKey(Key key, KeyBlock block, ObjectContainer container, ClientContext context) { if(persistent) { container.activate(this, 1); container.activate(key, 5); container.activate(this.key, 5); } ======= @Override public void onGotKey(Key key, KeyBlock block, RequestScheduler sched) { >>>>>>> public void onGotKey(Key key, KeyBlock block, ObjectContainer container, ClientContext context) { if(persistent) { container.activate(this, 1); container.activate(key, 5); container.activate(this.key, 5); } <<<<<<< public long getCooldownWakeup(Object token, ObjectContainer container) { ======= @Override public long getCooldownWakeup(Object token) { >>>>>>> @Override public long getCooldownWakeup(Object token, ObjectContainer container) { return cooldownWakeupTime; } @Override public long getCooldownWakeupByKey(Key key, ObjectContainer container) { <<<<<<< public synchronized void resetCooldownTimes(ObjectContainer container) { ======= @Override public synchronized void resetCooldownTimes() { >>>>>>> @Override public synchronized void resetCooldownTimes(ObjectContainer container) {
<<<<<<< public void onSuccess(FetchResult result, ClientGetter state, ObjectContainer container) { System.err.println("Got revocation certificate from "+source.userToString()); ======= public void onSuccess(FetchResult result, ClientGetter state) { System.err.println("Got revocation certificate from " + source.userToString()); >>>>>>> public void onSuccess(FetchResult result, ClientGetter state, ObjectContainer container) { System.err.println("Got revocation certificate from " + source.userToString()); <<<<<<< updateManager.node.clientCore.clientContext.start(cg); } catch (FetchException e1) { System.err.println("Failed to decode UOM blob: "+e1); ======= cg.start(); } catch(FetchException e1) { System.err.println("Failed to decode UOM blob: " + e1); >>>>>>> updateManager.node.clientCore.clientContext.start(cg); } catch(FetchException e1) { System.err.println("Failed to decode UOM blob: " + e1); <<<<<<< updateManager.node.clientCore.clientContext.start(putter, false); } catch (InsertException e1) { Logger.error(this, "Failed to start insert of revocation key binary blob: "+e1, e1); ======= putter.start(false); } catch(InsertException e1) { Logger.error(this, "Failed to start insert of revocation key binary blob: " + e1, e1); >>>>>>> updateManager.node.clientCore.clientContext.start(putter, false); } catch(InsertException e1) { Logger.error(this, "Failed to start insert of revocation key binary blob: " + e1, e1); <<<<<<< public void onSuccess(FetchResult result, ClientGetter state, ObjectContainer container) { System.err.println("Got main jar version "+version+" from "+source.userToString()); ======= public void onSuccess(FetchResult result, ClientGetter state) { System.err.println("Got main jar version " + version + " from " + source.userToString()); >>>>>>> public void onSuccess(FetchResult result, ClientGetter state, ObjectContainer container) { System.err.println("Got main jar version " + version + " from " + source.userToString()); <<<<<<< updateManager.node.clientCore.clientContext.start(cg); } catch (FetchException e1) { myCallback.onFailure(e1, cg, null); ======= cg.start(); } catch(FetchException e1) { myCallback.onFailure(e1, cg); >>>>>>> updateManager.node.clientCore.clientContext.start(cg); } catch(FetchException e1) { myCallback.onFailure(e1, cg, null); <<<<<<< if(!oldTempFilesPeerDir.exists()) { return false; } if(!oldTempFilesPeerDir.isDirectory()) { Logger.error(this, "Persistent temporary files location is not a directory: "+oldTempFilesPeerDir.getPath()); return false; } // FIXME remove... for Cooo System.gc(); System.runFinalization(); System.gc(); System.runFinalization(); Runtime r = Runtime.getRuntime(); long memoryInUse = r.totalMemory() - r.freeMemory(); System.err.println("Memory in use before listing temp files: "+memoryInUse); ======= if(!oldTempFilesPeerDir.exists()) return false; if(!oldTempFilesPeerDir.isDirectory()) { Logger.error(this, "Persistent temporary files location is not a directory: " + oldTempFilesPeerDir.getPath()); return false; } >>>>>>> if(!oldTempFilesPeerDir.exists()) return false; if(!oldTempFilesPeerDir.isDirectory()) { Logger.error(this, "Persistent temporary files location is not a directory: " + oldTempFilesPeerDir.getPath()); return false; }
<<<<<<< HashMap manifestElements, boolean wasDiskPut, FCPServer server) throws IdentifierCollisionException, MalformedURLException { ======= HashMap<String, Object> manifestElements, boolean wasDiskPut) throws IdentifierCollisionException, MalformedURLException { >>>>>>> HashMap<String, Object> manifestElements, boolean wasDiskPut, FCPServer server) throws IdentifierCollisionException, MalformedURLException { <<<<<<< void register(ObjectContainer container, boolean lazyResume, boolean noTags) throws IdentifierCollisionException { if(persistenceType != PERSIST_CONNECTION) client.register(this, false, container); if(persistenceType != PERSIST_CONNECTION && !noTags) { FCPMessage msg = persistentTagMessage(container); client.queueClientRequestMessage(msg, 0, container); } } private HashMap makeDiskDirManifest(File dir, String prefix, boolean allowUnreadableFiles) throws FileNotFoundException { ======= private HashMap<String, Object> makeDiskDirManifest(File dir, String prefix, boolean allowUnreadableFiles) throws FileNotFoundException { >>>>>>> void register(ObjectContainer container, boolean lazyResume, boolean noTags) throws IdentifierCollisionException { if(persistenceType != PERSIST_CONNECTION) client.register(this, false, container); if(persistenceType != PERSIST_CONNECTION && !noTags) { FCPMessage msg = persistentTagMessage(container); client.queueClientRequestMessage(msg, 0, container); } } private HashMap<String, Object> makeDiskDirManifest(File dir, String prefix, boolean allowUnreadableFiles) throws FileNotFoundException { <<<<<<< public void start(ObjectContainer container, ClientContext context) { ======= @Override public void start() { >>>>>>> @Override public void start(ObjectContainer container, ClientContext context) { <<<<<<< public void onLostConnection(ObjectContainer container, ClientContext context) { ======= @Override public void onLostConnection() { >>>>>>> @Override public void onLostConnection(ObjectContainer container, ClientContext context) { <<<<<<< freeData((HashMap)o, container); ======= freeData((HashMap<String, Object>) o); >>>>>>> freeData((HashMap<String, Object>) o, container); <<<<<<< protected FCPMessage persistentTagMessage(ObjectContainer container) { if(persistenceType == PERSIST_FOREVER) { container.activate(publicURI, 5); container.activate(ctx, 1); container.activate(manifestElements, 5); } ======= @Override protected FCPMessage persistentTagMessage() { >>>>>>> @Override protected FCPMessage persistentTagMessage(ObjectContainer container) { if(persistenceType == PERSIST_FOREVER) { container.activate(publicURI, 5); container.activate(ctx, 1); container.activate(manifestElements, 5); } <<<<<<< public boolean restart(ObjectContainer container, ClientContext context) { ======= @Override public boolean restart() { >>>>>>> @Override public boolean restart(ObjectContainer container, ClientContext context) {
<<<<<<< import freenet.node.Ticker; ======= import freenet.node.SecurityLevelListener; import freenet.node.SecurityLevels.PHYSICAL_THREAT_LEVEL; >>>>>>> import freenet.node.Ticker; import freenet.node.SecurityLevelListener; import freenet.node.SecurityLevels.PHYSICAL_THREAT_LEVEL;
<<<<<<< haveDataBlocks = fetchedDataBlocks == dataKeys.length; decodeNow = (!startedDecode) && (fetchedBlocks >= minFetched || haveDataBlocks); ======= boolean haveDataBlocks = fetchedDataBlocks == dataKeys.length; decodeNow = (fetchedBlocks >= minFetched || haveDataBlocks); >>>>>>> boolean haveDataBlocks = fetchedDataBlocks == dataKeys.length; decodeNow = (!startedDecode) && (fetchedBlocks >= minFetched || haveDataBlocks); <<<<<<< if(persistent) container.activate(parentFetcher, 1); parentFetcher.removeMyPendingKeys(this, container, context); if(persistent) container.deactivate(parentFetcher, 1); removeSubSegments(container, context); if(haveDataBlocks) onDecodedSegment(container, context, null, null, null, dataBuckets, checkBuckets); else decode(container, context); } if(persistent) { container.deactivate(parent, 1); ======= removeSubSegments(); decode(); } else if(allFailed) { fail(new FetchException(FetchException.SPLITFILE_ERROR, errors)); >>>>>>> if(persistent) container.activate(parentFetcher, 1); parentFetcher.removeMyPendingKeys(this, container, context); if(persistent) container.deactivate(parentFetcher, 1); removeSubSegments(container, context); decode(container, context); } else if(allFailed) { fail(new FetchException(FetchException.SPLITFILE_ERROR, errors), container, context, true); } if(persistent) { container.deactivate(parent, 1);
<<<<<<< boolean doOpennet = !(fromOfferedKey || isSSK); if(doOpennet) origTag.waitingForOpennet(next); try { //NOTE: because of the requesthandler implementation, this will block and wait // for downstream transfers on a CHK. The opennet stuff introduces // a delay of it's own if we don't get the expected message. fireRequestSenderFinished(code); if(doOpennet) { finishOpennet(next); } } finally { if(doOpennet) origTag.finishedWaitingForOpennet(next); } ======= try { //NOTE: because of the requesthandler implementation, this will block and wait // for downstream transfers on a CHK. The opennet stuff introduces // a delay of it's own if we don't get the expected message. fireRequestSenderFinished(code, fromOfferedKey); if(doOpennet) { finishOpennet(next); } } finally { if(doOpennet) origTag.finishedWaitingForOpennet(next); } >>>>>>> try { //NOTE: because of the requesthandler implementation, this will block and wait // for downstream transfers on a CHK. The opennet stuff introduces // a delay of it's own if we don't get the expected message. fireRequestSenderFinished(code, fromOfferedKey); if(doOpennet) { finishOpennet(next); } } finally { if(doOpennet) origTag.finishedWaitingForOpennet(next); } <<<<<<< <<<<<<< HEAD:src/freenet/node/RequestSender.java byte[] noderef = OpennetManager.waitForOpennetNoderef(false, next, uid, this, node); ======= byte[] noderef; noderef = OpennetManager.waitForOpennetNoderef(false, next, uid, this, node); >>>>>>> build01334:src/freenet/node/RequestSender.java ======= byte[] noderef = OpennetManager.waitForOpennetNoderef(false, next, uid, this, node); >>>>>>> byte[] noderef = OpennetManager.waitForOpennetNoderef(false, next, uid, this, node); <<<<<<< <<<<<<< HEAD:src/freenet/node/RequestSender.java Logger.error(this, "RequestSender timed out waiting for noderef from "+next+" for "+this); ======= >>>>>>> build01334:src/freenet/node/RequestSender.java ======= // Not an error since it can be caused downstream. origTag.reassignToSelf(); // Since we will tell downstream that we are finished. Logger.warning(this, "RequestSender timed out waiting for noderef from "+next+" for "+this); >>>>>>> Logger.error(this, "RequestSender timed out waiting for noderef from "+next+" for "+this); // Not an error since it can be caused downstream. origTag.reassignToSelf(); // Since we will tell downstream that we are finished. Logger.warning(this, "RequestSender timed out waiting for noderef from "+next+" for "+this); <<<<<<< <<<<<<< HEAD:src/freenet/node/RequestSender.java // We need to wait. try { OpennetManager.waitForOpennetNoderef(false, next, uid, this, node); } catch (WaitedTooLongForOpennetNoderefException e1) { Logger.error(this, "RequestSender FATAL TIMEOUT out waiting for noderef from "+next+" for "+this); // Fatal timeout. Urgh. next.fatalTimeout(); } ackOpennet(next); ======= ackOpennet(next); >>>>>>> build01334:src/freenet/node/RequestSender.java ======= // We need to wait. try { OpennetManager.waitForOpennetNoderef(false, next, uid, this, node); } catch (WaitedTooLongForOpennetNoderefException e1) { Logger.error(this, "RequestSender FATAL TIMEOUT out waiting for noderef from "+next+" for "+this); // Fatal timeout. Urgh. next.fatalTimeout(); } ackOpennet(next); >>>>>>> // We need to wait. try { OpennetManager.waitForOpennetNoderef(false, next, uid, this, node); } catch (WaitedTooLongForOpennetNoderefException e1) { Logger.error(this, "RequestSender FATAL TIMEOUT out waiting for noderef from "+next+" for "+this); // Fatal timeout. Urgh. next.fatalTimeout(); } ackOpennet(next);
<<<<<<< public short getPriorityClass(ObjectContainer container) { if(persistent) container.activate(parent, 1); return parent.getPriorityClass(); // Not much point deactivating ======= public boolean isInsert() { return true; } @Override public short getPriorityClass() { return parent.getPriorityClass(); >>>>>>> public short getPriorityClass(ObjectContainer container) { if(persistent) container.activate(parent, 1); return parent.getPriorityClass(); // Not much point deactivating <<<<<<< public void onFailure(LowLevelPutException e, Object keyNum, ObjectContainer container, ClientContext context) { if(persistent) container.activate(errors, 1); ======= @Override public void onFailure(LowLevelPutException e, Object keyNum) { >>>>>>> @Override public void onFailure(LowLevelPutException e, Object keyNum, ObjectContainer container, ClientContext context) { if(persistent) container.activate(errors, 1); <<<<<<< public void onSuccess(Object keyNum, ObjectContainer container, ClientContext context) { ======= @Override public void onSuccess(Object keyNum) { >>>>>>> @Override public void onSuccess(Object keyNum, ObjectContainer container, ClientContext context) { <<<<<<< public RequestClient getClient() { ======= @Override public Object getClient() { >>>>>>> @Override public RequestClient getClient() { <<<<<<< public synchronized Object[] sendableKeys(ObjectContainer container) { ======= @Override public synchronized Object[] sendableKeys() { >>>>>>> @Override public synchronized Object[] sendableKeys(ObjectContainer container) {
<<<<<<< new String[] { "onfocus", "onblur" })); allowedTagsVerifiers.put( "audio", // currently just minimal support new MediaTagVerifier( "audio", new String[] { // allowed tags "preload", "controls"}, emptyStringArray, // uris new String[] { "src" }, // inline uris emptyStringArray)); ======= new String[] { "onfocus", "onblur" }, emptyStringArray)); >>>>>>> new String[] { "onfocus", "onblur" }, emptyStringArray)); allowedTagsVerifiers.put( "audio", // currently just minimal support new MediaTagVerifier( "audio", new String[] { // allowed tags "preload", "controls"}, emptyStringArray, // uris new String[] { "src" }, // inline uris emptyStringArray)); <<<<<<< protected final HashSet<String> parsedAttrs; private final HashSet<String> uriAttrs; private final HashSet<String> inlineURIAttrs; ======= final HashSet<String> parsedAttrs; final HashSet<String> uriAttrs; final HashSet<String> inlineURIAttrs; final HashSet<String> booleanAttrs; >>>>>>> protected final HashSet<String> parsedAttrs; private final HashSet<String> uriAttrs; private final HashSet<String> inlineURIAttrs; final HashSet<String> booleanAttrs; <<<<<<< String[] inlineURIAttrs) { super(tag, allowedAttrs, uriAttrs, inlineURIAttrs); allowedHTMLTags.add(tag); ======= String[] inlineURIAttrs, String[] booleanAttrs) { super(tag, allowedAttrs, uriAttrs, inlineURIAttrs, booleanAttrs); >>>>>>> String[] inlineURIAttrs, String[] booleanAttrs) { super(tag, allowedAttrs, uriAttrs, inlineURIAttrs, booleanAttrs); allowedHTMLTags.add(tag); <<<<<<< BaseHrefTagVerifier(String tag, String[] allowedAttrs, String[] uriAttrs) { super(tag, allowedAttrs, uriAttrs, null); ======= BaseHrefTagVerifier(String string, String[] strings, String[] strings2) { super(string, strings, strings2, null, null); >>>>>>> BaseHrefTagVerifier(String tag, String[] allowedAttrs, String[] uriAttrs) { super(tag, allowedAttrs, uriAttrs, null, emptyStringArray);
<<<<<<< public void onSuccess(Object keyNum, ObjectContainer container, ClientContext context) { ======= @Override public void onSuccess(Object keyNum) { >>>>>>> @Override public void onSuccess(Object keyNum, ObjectContainer container, ClientContext context) { <<<<<<< public void onFailure(LowLevelPutException e, Object keyNum, ObjectContainer container, ClientContext context) { ======= @Override public void onFailure(LowLevelPutException e, Object keyNum) { >>>>>>> @Override public void onFailure(LowLevelPutException e, Object keyNum, ObjectContainer container, ClientContext context) { <<<<<<< public short getPriorityClass(ObjectContainer container) { ======= @Override public short getPriorityClass() { >>>>>>> @Override public short getPriorityClass(ObjectContainer container) { <<<<<<< @Override public SendableRequestSender getSender(ObjectContainer container, ClientContext context) { return new SendableRequestSender() { public boolean send(NodeClientCore core, RequestScheduler sched, ClientContext context, ChosenBlock req) { // Ignore keyNum, key, since this is a single block boolean logMINOR = Logger.shouldLog(Logger.MINOR, this); try { if(logMINOR) Logger.minor(this, "Starting request: "+this); core.realPut(block, shouldCache()); } catch (LowLevelPutException e) { onFailure(e, req.token, null, context); if(logMINOR) Logger.minor(this, "Request failed: "+this+" for "+e); return true; } finally { finished = true; } if(logMINOR) Logger.minor(this, "Request succeeded: "+this); onSuccess(req.token, null, context); return true; } }; } public RequestClient getClient() { ======= @Override public boolean send(NodeClientCore core, RequestScheduler sched, Object keyNum) { // Ignore keyNum, key, since this is a single block boolean logMINOR = Logger.shouldLog(Logger.MINOR, this); try { if(logMINOR) Logger.minor(this, "Starting request: "+this); core.realPut(block, shouldCache()); } catch (LowLevelPutException e) { onFailure(e, keyNum); if(logMINOR) Logger.minor(this, "Request failed: "+this+" for "+e); return true; } finally { finished = true; } if(logMINOR) Logger.minor(this, "Request succeeded: "+this); onSuccess(keyNum); return true; } @Override public Object getClient() { >>>>>>> @Override public SendableRequestSender getSender(ObjectContainer container, ClientContext context) { return new SendableRequestSender() { public boolean send(NodeClientCore core, RequestScheduler sched, ClientContext context, ChosenBlock req) { // Ignore keyNum, key, since this is a single block boolean logMINOR = Logger.shouldLog(Logger.MINOR, this); try { if(logMINOR) Logger.minor(this, "Starting request: "+this); core.realPut(block, shouldCache()); } catch (LowLevelPutException e) { onFailure(e, req.token, null, context); if(logMINOR) Logger.minor(this, "Request failed: "+this+" for "+e); return true; } finally { finished = true; } if(logMINOR) Logger.minor(this, "Request succeeded: "+this); onSuccess(req.token, null, context); return true; } }; } @Override public RequestClient getClient() { <<<<<<< public boolean isCancelled(ObjectContainer container) { ======= @Override public boolean isCancelled() { >>>>>>> @Override public boolean isCancelled(ObjectContainer container) {
<<<<<<< /** Found the latest edition. * @param l The edition number. * @param key The key. */ void onFoundEdition(long l, USK key, ObjectContainer container, ClientContext context, boolean metadata, short codec, byte[] data); ======= /** * Found the latest edition. * * @param l * The edition number. * @param key * A copy of the key with new edition set */ void onFoundEdition(long l, USK key); >>>>>>> /** * Found the latest edition. * * @param l * The edition number. * @param key * A copy of the key with new edition set */ void onFoundEdition(long l, USK key, ObjectContainer container, ClientContext context, boolean metadata, short codec, byte[] data);
<<<<<<< public Object chooseKey(KeysFetchingLocally keys, ObjectContainer container, ClientContext context) { ======= @Override public Object chooseKey(KeysFetchingLocally keys) { >>>>>>> @Override public Object chooseKey(KeysFetchingLocally keys, ObjectContainer container, ClientContext context) { <<<<<<< public ClientKey getKey(Object token, ObjectContainer container) { if(persistent) { container.activate(this, 1); container.activate(segment, 1); } ======= @Override public ClientKey getKey(Object token) { >>>>>>> @Override public ClientKey getKey(Object token, ObjectContainer container) { if(persistent) { container.activate(this, 1); container.activate(segment, 1); } <<<<<<< public Object[] allKeys(ObjectContainer container) { if(persistent) { container.activate(this, 1); container.activate(segment, 1); } ======= @Override public Object[] allKeys() { >>>>>>> @Override public Object[] allKeys(ObjectContainer container) { if(persistent) { container.activate(this, 1); container.activate(segment, 1); } <<<<<<< public Object[] sendableKeys(ObjectContainer container) { if(persistent) { container.activate(this, 1); container.activate(blockNums, 1); } cleanBlockNums(); ======= @Override public Object[] sendableKeys() { >>>>>>> @Override public Object[] sendableKeys(ObjectContainer container) { if(persistent) { container.activate(this, 1); container.activate(blockNums, 1); } cleanBlockNums(); <<<<<<< public boolean hasValidKeys(KeysFetchingLocally keys, ObjectContainer container, ClientContext context) { if(persistent) { container.activate(this, 1); container.activate(blockNums, 1); container.activate(segment, 1); } boolean hasSet = false; boolean retval = false; ======= @Override public boolean hasValidKeys(KeysFetchingLocally keys) { >>>>>>> @Override public boolean hasValidKeys(KeysFetchingLocally keys, ObjectContainer container, ClientContext context) { if(persistent) { container.activate(this, 1); container.activate(blockNums, 1); container.activate(segment, 1); } boolean hasSet = false; boolean retval = false; <<<<<<< private FetchException translateException(LowLevelGetException e) { ======= @Override public void onFailure(LowLevelGetException e, Object token, RequestScheduler sched) { if(logMINOR) Logger.minor(this, "onFailure("+e+" , "+token); >>>>>>> private FetchException translateException(LowLevelGetException e) { <<<<<<< public void onSuccess(ClientKeyBlock block, boolean fromStore, Object token, ObjectContainer container, ClientContext context) { if(persistent) { container.activate(this, 1); container.activate(segment, 1); container.activate(blockNums, 1); } Bucket data = extract(block, token, container, context); ======= @Override public void onSuccess(ClientKeyBlock block, boolean fromStore, Object token, RequestScheduler sched) { Bucket data = extract(block, token, sched); >>>>>>> @Override public void onSuccess(ClientKeyBlock block, boolean fromStore, Object token, ObjectContainer container, ClientContext context) { if(persistent) { container.activate(this, 1); container.activate(segment, 1); container.activate(blockNums, 1); } Bucket data = extract(block, token, container, context); <<<<<<< public RequestClient getClient() { return parent.getClient(); ======= @Override public Object getClient() { return segment.parentFetcher.parent.getClient(); >>>>>>> @Override public RequestClient getClient() { return parent.getClient(); <<<<<<< public short getPriorityClass(ObjectContainer container) { if(persistent) container.activate(parent, 1); return parent.priorityClass; ======= @Override public short getPriorityClass() { return segment.parentFetcher.parent.priorityClass; >>>>>>> @Override public short getPriorityClass(ObjectContainer container) { if(persistent) container.activate(parent, 1); return parent.priorityClass; <<<<<<< public boolean isCancelled(ObjectContainer container) { if(persistent) { container.activate(parent, 1); } ======= @Override public boolean isCancelled() { >>>>>>> @Override public boolean isCancelled(ObjectContainer container) { if(persistent) { container.activate(parent, 1); } <<<<<<< public void onGotKey(Key key, KeyBlock block, ObjectContainer container, ClientContext context) { if(persistent) { container.activate(this, 1); container.activate(segment, 1); container.activate(blockNums, 1); } ======= @Override public void onGotKey(Key key, KeyBlock block, RequestScheduler sched) { >>>>>>> public void onGotKey(Key key, KeyBlock block, ObjectContainer container, ClientContext context) { if(persistent) { container.activate(this, 1); container.activate(segment, 1); container.activate(blockNums, 1); }
<<<<<<< ======= import io.sphere.sdk.producttypes.queries.ProductTypeQueryModel; import io.sphere.sdk.suppliers.TShirtProductTypeDraftSupplier; import io.sphere.sdk.attributes.*; >>>>>>> import io.sphere.sdk.producttypes.queries.ProductTypeQueryModel; import io.sphere.sdk.suppliers.TShirtProductTypeDraftSupplier; import io.sphere.sdk.attributes.*;
<<<<<<< if(Arrays.equals((negType > 8 ? SHA256.digest(buf) : buf), nonceInitiator)) ======= if(MessageDigest.isEqual(nonceInitiator, buf)) >>>>>>> if(MessageDigest.isEqual(nonceInitiator, (negType > 8 ? SHA256.digest(buf) : buf))) <<<<<<< ======= } else if(!MessageDigest.isEqual(myNi, nonceInitiator)) { if(shouldLogErrorInHandshake(t1)) { Logger.normal(this, "Ignoring old JFK(2) (different nonce to the one we sent - either a timing artefact or an attempt to change the nonce)"); } return; >>>>>>>
<<<<<<< private final ArrayList queue; private ClientContext context; ======= private final ArrayList<SoftReference<SingleBlockInserter>> queue; >>>>>>> private final ArrayList<SoftReference<SingleBlockInserter>> queue; private ClientContext context; <<<<<<< if(sbi.persistent()) { queuePersistent(sbi, container, context); runPersistentQueue(context); } else { SoftReference ref = new SoftReference(sbi); synchronized(this) { queue.add(ref); Logger.minor(this, "Queueing encode of "+sbi); notifyAll(); } ======= SoftReference<SingleBlockInserter> ref = new SoftReference<SingleBlockInserter>(sbi); synchronized(this) { queue.add(ref); Logger.minor(this, "Queueing encode of "+sbi); notifyAll(); >>>>>>> if(sbi.persistent()) { queuePersistent(sbi, container, context); runPersistentQueue(context); } else { SoftReference<SingleBlockInserter> ref = new SoftReference<SingleBlockInserter>(sbi); synchronized(this) { queue.add(ref); Logger.minor(this, "Queueing encode of "+sbi); notifyAll(); }
<<<<<<< @Nullable private final PaymentInfo paymentInfo; ======= @Nullable private final Reference<State> state; >>>>>>> @Nullable private final Reference<State> state; @Nullable private final PaymentInfo paymentInfo; <<<<<<< protected OrderImpl(final String id, final Long version, final ZonedDateTime createdAt, final ZonedDateTime lastModifiedAt, final Address billingAddress, final CountryCode country, final String customerEmail, final Reference<CustomerGroup> customerGroup, final String customerId, final List<CustomLineItem> customLineItems, final InventoryMode inventoryMode, final Long lastMessageSequenceNumber, final List<LineItem> lineItems, @Nullable final String orderNumber, final OrderState orderState, final List<ReturnInfo> returnInfo, @Nullable final ShipmentState shipmentState, final Address shippingAddress, @Nullable final OrderShippingInfo shippingInfo, final Set<SyncInfo> syncInfo, final TaxedPrice taxedPrice, final MonetaryAmount totalPrice, @Nullable final PaymentState paymentState, @Nullable final ZonedDateTime completedAt, final List<DiscountCodeInfo> discountCodes, @Nullable final Reference<Cart> cart, @Nullable final CustomFields custom, @Nullable final PaymentInfo paymentInfo) { ======= protected OrderImpl(final String id, final Long version, final ZonedDateTime createdAt, final ZonedDateTime lastModifiedAt, final Address billingAddress, final CountryCode country, final String customerEmail, final Reference<CustomerGroup> customerGroup, final String customerId, final List<CustomLineItem> customLineItems, final InventoryMode inventoryMode, final Long lastMessageSequenceNumber, final List<LineItem> lineItems, @Nullable final String orderNumber, final OrderState orderState, final List<ReturnInfo> returnInfo, @Nullable final ShipmentState shipmentState, final Address shippingAddress, @Nullable final OrderShippingInfo shippingInfo, final Set<SyncInfo> syncInfo, final TaxedPrice taxedPrice, final MonetaryAmount totalPrice, @Nullable final PaymentState paymentState, @Nullable final ZonedDateTime completedAt, final List<DiscountCodeInfo> discountCodes, @Nullable final Reference<Cart> cart, final CustomFields custom, final Reference<State> state) { >>>>>>> protected OrderImpl(final String id, final Long version, final ZonedDateTime createdAt, final ZonedDateTime lastModifiedAt, final Address billingAddress, final CountryCode country, final String customerEmail, final Reference<CustomerGroup> customerGroup, final String customerId, final List<CustomLineItem> customLineItems, final InventoryMode inventoryMode, final Long lastMessageSequenceNumber, final List<LineItem> lineItems, @Nullable final String orderNumber, final OrderState orderState, final List<ReturnInfo> returnInfo, @Nullable final ShipmentState shipmentState, final Address shippingAddress, @Nullable final OrderShippingInfo shippingInfo, final Set<SyncInfo> syncInfo, final TaxedPrice taxedPrice, final MonetaryAmount totalPrice, @Nullable final PaymentState paymentState, @Nullable final ZonedDateTime completedAt, final List<DiscountCodeInfo> discountCodes, @Nullable final Reference<Cart> cart, final CustomFields custom, final Reference<State> state, @Nullable final PaymentInfo paymentInfo) { <<<<<<< this.paymentInfo = paymentInfo; ======= this.state = state; >>>>>>> this.state = state; this.paymentInfo = paymentInfo; <<<<<<< @Override @Nullable public PaymentInfo getPaymentInfo() { return paymentInfo; } ======= @Override @Nullable public Reference<State> getState() { return state; } >>>>>>> @Override @Nullable public Reference<State> getState() { return state; } @Override @Nullable public PaymentInfo getPaymentInfo() { return paymentInfo; }
<<<<<<< import java.util.Optional; ======= import java.util.LinkedHashSet; import java.util.List; >>>>>>> import java.util.Optional; import java.util.LinkedHashSet; import java.util.List; <<<<<<< @Nullable private Reference<State> state; ======= @Nullable private CategoryOrderHints categoryOrderHints; >>>>>>> @Nullable private Reference<State> state; @Nullable private CategoryOrderHints categoryOrderHints; <<<<<<< public T state(@Nullable final Referenceable<State> state) { this.state = Optional.ofNullable(state).map(Referenceable::toReference).orElse(null); return getThis(); } @Nullable public Reference<State> getState() { return state; } ======= @Nullable public CategoryOrderHints getCategoryOrderHints() { return categoryOrderHints; } >>>>>>> public T state(@Nullable final Referenceable<State> state) { this.state = Optional.ofNullable(state).map(Referenceable::toReference).orElse(null); return getThis(); } @Nullable public Reference<State> getState() { return state; } @Nullable public CategoryOrderHints getCategoryOrderHints() { return categoryOrderHints; }
<<<<<<< public void onMajorProgress(ObjectContainer container) { if(persistent()) container.activate(client, 1); client.onMajorProgress(container); ======= @Override public void onMajorProgress() { client.onMajorProgress(); >>>>>>> @Override public void onMajorProgress(ObjectContainer container) { if(persistent()) container.activate(client, 1); client.onMajorProgress(container); <<<<<<< public void cancel(ObjectContainer container, ClientContext context) { ======= @Override public void cancel() { >>>>>>> public void onEncode(BaseClientKey key, ClientPutState state, ObjectContainer container, ClientContext context) { if(persistent()) container.activate(client, 1); synchronized(this) { this.uri = key.getURI(); if(targetFilename != null) uri = uri.pushMetaString(targetFilename); } if(persistent()) container.set(this); client.onGeneratedURI(uri, this, container); } @Override public void cancel(ObjectContainer container, ClientContext context) { <<<<<<< public void notifyClients(ObjectContainer container, ClientContext context) { if(persistent()) container.activate(ctx, 2); ctx.eventProducer.produceEvent(new SplitfileProgressEvent(this.totalBlocks, this.successfulBlocks, this.failedBlocks, this.fatallyFailedBlocks, this.minSuccessBlocks, this.blockSetFinalized), container, context); ======= @Override public void notifyClients() { ctx.eventProducer.produceEvent(new SplitfileProgressEvent(this.totalBlocks, this.successfulBlocks, this.failedBlocks, this.fatallyFailedBlocks, this.minSuccessBlocks, this.blockSetFinalized)); >>>>>>> @Override public void notifyClients(ObjectContainer container, ClientContext context) { if(persistent()) container.activate(ctx, 2); ctx.eventProducer.produceEvent(new SplitfileProgressEvent(this.totalBlocks, this.successfulBlocks, this.failedBlocks, this.fatallyFailedBlocks, this.minSuccessBlocks, this.blockSetFinalized), container, context); <<<<<<< public void onTransition(ClientGetState oldState, ClientGetState newState, ObjectContainer container) { ======= @Override public void onTransition(ClientGetState oldState, ClientGetState newState) { >>>>>>> @Override public void onTransition(ClientGetState oldState, ClientGetState newState, ObjectContainer container) {
<<<<<<< Logger.error(this, "Waited too long: "+TimeUtil.formatTime(e.delta)+" to allocate a packet number to send to "+toSendPacket+" : "+("(new packet format)")+" (version "+toSendPacket.getVersionNumber()+") - DISCONNECTING!"); toSendPacket.forceDisconnect(true); ======= Logger.error(this, "Waited too long: "+TimeUtil.formatTime(e.delta)+" to allocate a packet number to send to "+toSendPacket+" on "+e.tracker+" : "+(toSendPacket.isOldFNP() ? "(old packet format)" : "(new packet format)")+" (version "+toSendPacket.getVersionNumber()+") - DISCONNECTING!"); toSendPacket.forceDisconnect(); >>>>>>> Logger.error(this, "Waited too long: "+TimeUtil.formatTime(e.delta)+" to allocate a packet number to send to "+toSendPacket+" : "+("(new packet format)")+" (version "+toSendPacket.getVersionNumber()+") - DISCONNECTING!"); toSendPacket.forceDisconnect(); <<<<<<< Logger.error(this, "Waited too long: "+TimeUtil.formatTime(e.delta)+" to allocate a packet number to send to "+toSendAckOnly+" : "+("(new packet format)")+" (version "+toSendAckOnly.getVersionNumber()+") - DISCONNECTING!"); toSendAckOnly.forceDisconnect(true); ======= Logger.error(this, "Waited too long: "+TimeUtil.formatTime(e.delta)+" to allocate a packet number to send to "+toSendAckOnly+" on "+e.tracker+" : "+(toSendAckOnly.isOldFNP() ? "(old packet format)" : "(new packet format)")+" (version "+toSendAckOnly.getVersionNumber()+") - DISCONNECTING!"); toSendAckOnly.forceDisconnect(); >>>>>>> Logger.error(this, "Waited too long: "+TimeUtil.formatTime(e.delta)+" to allocate a packet number to send to "+toSendAckOnly+" : "+("(new packet format)")+" (version "+toSendAckOnly.getVersionNumber()+") - DISCONNECTING!"); toSendAckOnly.forceDisconnect();
<<<<<<< import freenet.clients.http.updateableelements.AlertElement; import freenet.l10n.L10n; ======= import freenet.l10n.NodeL10n; >>>>>>> import freenet.clients.http.updateableelements.AlertElement; import freenet.l10n.L10n; import freenet.l10n.NodeL10n;
<<<<<<< final boolean forever = (persistenceType == ClientRequest.PERSIST_FOREVER); if(forever) { runningPersistentRequests = container.ext().collections().newLinkedList(); ((Db4oList)runningPersistentRequests).activationDepth(1); completedUnackedRequests = container.ext().collections().newLinkedList(); ((Db4oList)completedUnackedRequests).activationDepth(1); clientRequestsByIdentifier = container.ext().collections().newHashMap(10); ((Db4oMap)clientRequestsByIdentifier).activationDepth(1); } else { runningPersistentRequests = new Vector(); completedUnackedRequests = new Vector(); clientRequestsByIdentifier = new HashMap(); } ======= this.runningPersistentRequests = new HashSet<ClientRequest>(); this.completedUnackedRequests = new Vector<ClientRequest>(); this.clientRequestsByIdentifier = new HashMap<String, ClientRequest>(); this.server = server; this.core = server.core; this.client = core.makeClient((short)0); >>>>>>> final boolean forever = (persistenceType == ClientRequest.PERSIST_FOREVER); if(forever) { runningPersistentRequests = container.ext().collections().newLinkedList(); ((Db4oList)runningPersistentRequests).activationDepth(1); completedUnackedRequests = container.ext().collections().newLinkedList(); ((Db4oList)completedUnackedRequests).activationDepth(1); clientRequestsByIdentifier = container.ext().collections().newHashMap(10); ((Db4oMap)clientRequestsByIdentifier).activationDepth(1); } else { runningPersistentRequests = new Vector(); completedUnackedRequests = new Vector(); clientRequestsByIdentifier = new HashMap(); } <<<<<<< this.persistenceType = persistenceType; assert(persistenceType == ClientRequest.PERSIST_FOREVER || persistenceType == ClientRequest.PERSIST_REBOOT); ======= defaultFetchContext = client.getFetchContext(); defaultInsertContext = client.getInsertContext(false); clientsWatching = new LinkedList<FCPClient>(); >>>>>>> this.persistenceType = persistenceType; assert(persistenceType == ClientRequest.PERSIST_FOREVER || persistenceType == ClientRequest.PERSIST_REBOOT); <<<<<<< toStart = new LinkedList(); lowLevelClient = new RequestClient() { public boolean persistent() { return forever; } }; ======= toStart = new LinkedList<ClientRequest>(); lowLevelClient = this; >>>>>>> toStart = new LinkedList<ClientRequest>(); lowLevelClient = new RequestClient() { public boolean persistent() { return forever; } }; <<<<<<< private final List completedUnackedRequests; ======= private final Vector<ClientRequest> completedUnackedRequests; >>>>>>> private final List completedUnackedRequests; <<<<<<< private final Map clientRequestsByIdentifier; ======= private final HashMap<String, ClientRequest> clientRequestsByIdentifier; /** Client (one FCPClient = one HighLevelSimpleClient = one round-robin slot) */ private final HighLevelSimpleClient client; public final FetchContext defaultFetchContext; public final InsertContext defaultInsertContext; public final NodeClientCore core; >>>>>>> private final Map<String, ClientRequest> clientRequestsByIdentifier; <<<<<<< /** FCPClients watching us. Lazy init, sync on clientsWatchingLock */ private transient LinkedList clientsWatching; private final NullObject clientsWatchingLock = new NullObject(); private final LinkedList toStart; final RequestClient lowLevelClient; private transient RequestCompletionCallback completionCallback; /** Connection mode */ final short persistenceType; ======= /** FCPClients watching us */ // FIXME how do we lazily init this without synchronization problems? // We obviously can't synchronize on it when it hasn't been constructed yet... final LinkedList<FCPClient> clientsWatching; private final LinkedList<ClientRequest> toStart; /** Low-level client object, for freenet.client.async. Normally == this. */ final Object lowLevelClient; private RequestCompletionCallback completionCallback; >>>>>>> /** FCPClients watching us. Lazy init, sync on clientsWatchingLock */ private transient LinkedList clientsWatching; private final NullObject clientsWatchingLock = new NullObject(); private final LinkedList<ClientRequest> toStart; final RequestClient lowLevelClient; private transient RequestCompletionCallback completionCallback; /** Connection mode */ final short persistenceType; <<<<<<< synchronized(clientsWatchingLock) { if(clientsWatching != null) clients = (FCPClient[]) clientsWatching.toArray(new FCPClient[clientsWatching.size()]); else clients = null; } if(clients != null) for(int i=0;i<clients.length;i++) { if(persistenceType == ClientRequest.PERSIST_FOREVER) container.activate(clients[i], 1); if(clients[i].persistenceType != persistenceType) continue; clients[i].queueClientRequestMessage(msg, verbosityLevel, true, container); if(persistenceType == ClientRequest.PERSIST_FOREVER) container.deactivate(clients[i], 1); ======= synchronized(clientsWatching) { clients = clientsWatching.toArray(new FCPClient[clientsWatching.size()]); >>>>>>> synchronized(clientsWatchingLock) { if(clientsWatching != null) clients = (FCPClient[]) clientsWatching.toArray(new FCPClient[clientsWatching.size()]); else clients = null; } if(clients != null) for(int i=0;i<clients.length;i++) { if(persistenceType == ClientRequest.PERSIST_FOREVER) container.activate(clients[i], 1); if(clients[i].persistenceType != persistenceType) continue; clients[i].queueClientRequestMessage(msg, verbosityLevel, true, container); if(persistenceType == ClientRequest.PERSIST_FOREVER) container.deactivate(clients[i], 1); <<<<<<< public synchronized ClientRequest getRequest(String identifier, ObjectContainer container) { assert((persistenceType == ClientRequest.PERSIST_FOREVER) == (container != null)); ClientRequest req = (ClientRequest) clientRequestsByIdentifier.get(identifier); if(persistenceType == ClientRequest.PERSIST_FOREVER) container.activate(req, 1); return req; ======= public synchronized ClientRequest getRequest(String identifier) { return clientRequestsByIdentifier.get(identifier); >>>>>>> public synchronized ClientRequest getRequest(String identifier, ObjectContainer container) { assert((persistenceType == ClientRequest.PERSIST_FOREVER) == (container != null)); ClientRequest req = (ClientRequest) clientRequestsByIdentifier.get(identifier); if(persistenceType == ClientRequest.PERSIST_FOREVER) container.activate(req, 1); return req; <<<<<<< reqs = (ClientRequest[]) toStart.toArray(new ClientRequest[toStart.size()]); toStart.clear(); } for(int i=0;i<reqs.length;i++) { final ClientRequest req = reqs[i]; runner.queue(new DBJob() { public void run(ObjectContainer container, ClientContext context) { container.activate(req, 1); req.start(container, context); container.deactivate(req, 1); } }, NativeThread.HIGH_PRIORITY + reqs[i].getPriority(), false); ======= reqs = toStart.toArray(new ClientRequest[toStart.size()]); >>>>>>> reqs = (ClientRequest[]) toStart.toArray(new ClientRequest[toStart.size()]); toStart.clear(); } for(int i=0;i<reqs.length;i++) { final ClientRequest req = reqs[i]; runner.queue(new DBJob() { public void run(ObjectContainer container, ClientContext context) { container.activate(req, 1); req.start(container, context); container.deactivate(req, 1); } }, NativeThread.HIGH_PRIORITY + reqs[i].getPriority(), false);
<<<<<<< nodeConfig.register("maxRAMBucketSize", "128KiB", sortOrder++, true, false, "NodeClientCore.maxRAMBucketSize", "NodeClientCore.maxRAMBucketSizeLong", new LongCallback() { ======= @Override >>>>>>> nodeConfig.register("maxRAMBucketSize", "128KiB", sortOrder++, true, false, "NodeClientCore.maxRAMBucketSize", "NodeClientCore.maxRAMBucketSizeLong", new LongCallback() { @Override
<<<<<<< import freenet.clients.http.updateableelements.AlertElement; import freenet.l10n.L10n; ======= import freenet.l10n.NodeL10n; >>>>>>> import freenet.clients.http.updateableelements.AlertElement; import freenet.l10n.L10n; import freenet.l10n.NodeL10n;
<<<<<<< parent.failedBlock(container, context); if(persistent) container.activate(cb, 1); cb.onFailure(e, this, container, context); ======= parent.failedBlock(); cb.onFailure(e, this); if(freeData) sourceData.free(); >>>>>>> parent.failedBlock(container, context); if(persistent) container.activate(cb, 1); cb.onFailure(e, this, container, context); if(freeData) sourceData.free(); <<<<<<< if(persistent) { container.activate(cb, 1); container.store(this); } parent.completedBlock(false, container, context); if(logMINOR) Logger.minor(this, "Calling onSuccess for "+cb); cb.onSuccess(this, container, context); if(persistent) container.deactivate(cb, 1); ======= if(freeData) sourceData.free(); parent.completedBlock(false); cb.onSuccess(this); >>>>>>> if(persistent) { container.activate(cb, 1); container.store(this); container.activate(sourceData, 1); } if(freeData) sourceData.free(); // FIXME removeFrom()?? parent.completedBlock(false, container, context); if(logMINOR) Logger.minor(this, "Calling onSuccess for "+cb); cb.onSuccess(this, container, context); if(persistent) container.deactivate(cb, 1); <<<<<<< if(persistent) { container.store(this); container.activate(cb, 1); } super.unregister(container, context); cb.onFailure(new InsertException(InsertException.CANCELLED), this, container, context); if(persistent) container.deactivate(cb, 1); ======= if(freeData) sourceData.free(); super.unregister(false); cb.onFailure(new InsertException(InsertException.CANCELLED), this); >>>>>>> if(persistent) { container.store(this); container.activate(cb, 1); container.activate(sourceData, 1); } if(freeData) sourceData.free(); super.unregister(container, context); cb.onFailure(new InsertException(InsertException.CANCELLED), this, container, context); if(persistent) container.deactivate(cb, 1);
<<<<<<< } else if (type.equals(double[].class)) { // & 0xFF for unsigned byte. Can be up to 255, no negatives. double[] array = new double[dis.readByte() & 0xFF]; for (int i = 0; i < array.length; i++) array[i] = dis.readDouble(); return array; } else if (type.equals(float[].class)) { final short length = dis.readShort(); if (length < 0 || length > MAX_ARRAY_LENGTH/4) { throw new IOException("Invalid flat array length: " + length); } float[] array = new float[length]; for (int i = 0; i < array.length; i++) array[i] = dis.readFloat(); return array; ======= } else if (type.equals(double[].class)) { // & 0xFF for unsigned byte. double[] array = new double[dis.readByte() & 0xFF]; for (int i = 0; i < array.length; i++) array[i] = dis.readDouble(); return array; } else if (type.equals(float[].class)) { float[] array = new float[dis.readShort()]; for (int i = 0; i < array.length; i++) array[i] = dis.readFloat(); return array; >>>>>>> } else if (type.equals(double[].class)) { // & 0xFF for unsigned byte. Can be up to 255, no negatives. double[] array = new double[dis.readByte() & 0xFF]; for (int i = 0; i < array.length; i++) array[i] = dis.readDouble(); return array; } else if (type.equals(float[].class)) { final short length = dis.readShort(); if (length < 0 || length > MAX_ARRAY_LENGTH/4) { throw new IOException("Invalid flat array length: " + length); } float[] array = new float[length]; for (int i = 0; i < array.length; i++) array[i] = dis.readFloat(); return array; <<<<<<< dos.writeDouble((Double) object); } else if (type.equals(Float.class)) { dos.writeFloat((Float)object); ======= dos.writeDouble(((Double) object).doubleValue()); } else if (type.equals(Float.class)) { dos.writeFloat((Float)object); >>>>>>> dos.writeDouble((Double) object); } else if (type.equals(Float.class)) { dos.writeFloat((Float)object); <<<<<<< dos.write((Byte) object); } else if (type.equals(double[].class)) { // writeByte() takes the eight lower-order bits - length capped to 255. dos.writeByte(((double[])object).length); for (double element : (double[])object) dos.writeDouble(element); } else if (type.equals(float[].class)) { dos.writeShort(((float[])object).length); for (float element : (float[])object) dos.writeFloat(element); ======= dos.write(((Byte) object).byteValue()); } else if (type.equals(double[].class)) { // writeByte() takes the eight lower-order bits - length capped to 255. final double[] array = (double[])object; if (array.length > 255) { throw new IllegalArgumentException("Cannot serialize an array of more than 255 doubles; attempted to " + "serialize " + array.length + "."); } dos.writeByte(array.length); for (double element : array) dos.writeDouble(element); } else if (type.equals(float[].class)) { dos.writeShort(((float[])object).length); for (float element : (float[])object) dos.writeFloat(element); >>>>>>> dos.write((Byte) object); } else if (type.equals(double[].class)) { // writeByte() takes the eight lower-order bits - length capped to 255. final double[] array = (double[])object; if (array.length > 255) { throw new IllegalArgumentException("Cannot serialize an array of more than 255 doubles; attempted to " + "serialize " + array.length + "."); } dos.writeByte(array.length); for (double element : array) dos.writeDouble(element); } else if (type.equals(float[].class)) { dos.writeShort(((float[])object).length); for (float element : (float[])object) dos.writeFloat(element);
<<<<<<< ======= @Nullable Boolean isFuzzy(); List<FacetExpression<T>> facets(); List<FilterExpression<T>> resultFilters(); List<FilterExpression<T>> queryFilters(); List<FilterExpression<T>> facetFilters(); List<SearchSort<T>> sort(); >>>>>>> @Nullable Boolean isFuzzy();
<<<<<<< contentNode.addChild(new AlertElement(ctx)); HTMLNode infoboxContent = pageMaker.getInfobox("infobox-information", L10n.getString("QueueToadlet.globalQueueIsEmpty"), contentNode, "queue-empty", true); infoboxContent.addChild("#", L10n.getString("QueueToadlet.noTaskOnGlobalQueue")); ======= contentNode.addChild(core.alerts.createSummary()); HTMLNode infoboxContent = pageMaker.getInfobox("infobox-information", NodeL10n.getBase().getString("QueueToadlet.globalQueueIsEmpty"), contentNode, "queue-empty", true); infoboxContent.addChild("#", NodeL10n.getBase().getString("QueueToadlet.noTaskOnGlobalQueue")); >>>>>>> contentNode.addChild(new AlertElement(ctx)); HTMLNode infoboxContent = pageMaker.getInfobox("infobox-information", NodeL10n.getBase().getString("QueueToadlet.globalQueueIsEmpty"), contentNode, "queue-empty", true); infoboxContent.addChild("#", NodeL10n.getBase().getString("QueueToadlet.noTaskOnGlobalQueue")); <<<<<<< contentNode.addChild(new AlertElement(ctx)); pageMaker.drawModeSelectionArray(core, this.container, contentNode, mode); ======= contentNode.addChild(core.alerts.createSummary()); >>>>>>> contentNode.addChild(new AlertElement(ctx)); <<<<<<< ======= private HTMLNode createReasonCell(String failureReason) { HTMLNode reasonCell = new HTMLNode("td", "class", "request-reason"); if (failureReason == null) { reasonCell.addChild("span", "class", "failure_reason_unknown", NodeL10n.getBase().getString("QueueToadlet.unknown")); } else { reasonCell.addChild("span", "class", "failure_reason_is", failureReason); } return reasonCell; } private HTMLNode createProgressCell(boolean started, COMPRESS_STATE compressing, int fetched, int failed, int fatallyFailed, int min, int total, boolean finalized, boolean upload) { HTMLNode progressCell = new HTMLNode("td", "class", "request-progress"); if (!started) { progressCell.addChild("#", NodeL10n.getBase().getString("QueueToadlet.starting")); return progressCell; } boolean advancedMode = core.isAdvancedModeEnabled(); if(compressing == COMPRESS_STATE.WAITING && advancedMode) { progressCell.addChild("#", NodeL10n.getBase().getString("QueueToadlet.awaitingCompression")); return progressCell; } if(compressing != COMPRESS_STATE.WORKING) { progressCell.addChild("#", NodeL10n.getBase().getString("QueueToadlet.compressing")); return progressCell; } //double frac = p.getSuccessFraction(); if (!advancedMode || total < min /* FIXME why? */) { total = min; } if ((fetched < 0) || (total <= 0)) { progressCell.addChild("span", "class", "progress_fraction_unknown", NodeL10n.getBase().getString("QueueToadlet.unknown")); } else { int fetchedPercent = (int) (fetched / (double) total * 100); int failedPercent = (int) (failed / (double) total * 100); int fatallyFailedPercent = (int) (fatallyFailed / (double) total * 100); int minPercent = (int) (min / (double) total * 100); HTMLNode progressBar = progressCell.addChild("div", "class", "progressbar"); progressBar.addChild("div", new String[] { "class", "style" }, new String[] { "progressbar-done", "width: " + fetchedPercent + "%;" }); if (failed > 0) progressBar.addChild("div", new String[] { "class", "style" }, new String[] { "progressbar-failed", "width: " + failedPercent + "%;" }); if (fatallyFailed > 0) progressBar.addChild("div", new String[] { "class", "style" }, new String[] { "progressbar-failed2", "width: " + fatallyFailedPercent + "%;" }); if ((fetched + failed + fatallyFailed) < min) progressBar.addChild("div", new String[] { "class", "style" }, new String[] { "progressbar-min", "width: " + (minPercent - fetchedPercent) + "%;" }); NumberFormat nf = NumberFormat.getInstance(); nf.setMaximumFractionDigits(1); String prefix = '('+Integer.toString(fetched) + "/ " + Integer.toString(min)+"): "; if (finalized) { progressBar.addChild("div", new String[] { "class", "title" }, new String[] { "progress_fraction_finalized", prefix + NodeL10n.getBase().getString("QueueToadlet.progressbarAccurate") }, nf.format((int) ((fetched / (double) min) * 1000) / 10.0) + '%'); } else { String text = nf.format((int) ((fetched / (double) min) * 1000) / 10.0)+ '%'; if(!finalized) text = "" + fetched + " ("+text+"??)"; progressBar.addChild("div", new String[] { "class", "title" }, new String[] { "progress_fraction_not_finalized", prefix + NodeL10n.getBase().getString(upload ? "QueueToadlet.uploadProgressbarNotAccurate" : "QueueToadlet.progressbarNotAccurate") }, text); } } return progressCell; } private HTMLNode createNumberCell(int numberOfFiles) { HTMLNode numberCell = new HTMLNode("td", "class", "request-files"); numberCell.addChild("span", "class", "number_of_files", String.valueOf(numberOfFiles)); return numberCell; } private HTMLNode createFilenameCell(File filename) { HTMLNode filenameCell = new HTMLNode("td", "class", "request-filename"); if (filename != null) { filenameCell.addChild("span", "class", "filename_is", filename.toString()); } else { filenameCell.addChild("span", "class", "filename_none", NodeL10n.getBase().getString("QueueToadlet.none")); } return filenameCell; } private HTMLNode createPriorityCell(PageMaker pageMaker, String identifier, short priorityClass, ToadletContext ctx, String[] priorityClasses, boolean advancedModeEnabled) { HTMLNode priorityCell = new HTMLNode("td", "class", "request-priority nowrap"); HTMLNode priorityForm = ctx.addFormChild(priorityCell, path(), "queueChangePriorityCell-" + identifier.hashCode()); priorityForm.addChild("input", new String[] { "type", "name", "value" }, new String[] { "hidden", "identifier", identifier }); HTMLNode prioritySelect = priorityForm.addChild("select", "name", "priority"); for (int p = 0; p < RequestStarter.NUMBER_OF_PRIORITY_CLASSES; p++) { if(p <= RequestStarter.INTERACTIVE_PRIORITY_CLASS && !advancedModeEnabled) continue; if (p == priorityClass) { prioritySelect.addChild("option", new String[] { "value", "selected" }, new String[] { String.valueOf(p), "selected" }, priorityClasses[p]); } else { prioritySelect.addChild("option", "value", String.valueOf(p), priorityClasses[p]); } } priorityForm.addChild("input", new String[] { "type", "name", "value" }, new String[] { "submit", "change_priority", NodeL10n.getBase().getString("QueueToadlet.change") }); return priorityCell; } private HTMLNode createRecommendCell(PageMaker pageMaker, FreenetURI URI, ToadletContext ctx) { HTMLNode recommendNode = new HTMLNode("td", "class", "request-delete"); HTMLNode shareForm = ctx.addFormChild(recommendNode, path(), "recommendForm"); shareForm.addChild("input", new String[] {"type", "name", "value"}, new String[] {"hidden", "URI", URI.toString() }); shareForm.addChild("input", new String[] { "type", "name", "value" }, new String[] { "submit", "recommend_request", NodeL10n.getBase().getString("QueueToadlet.recommendToFriends") }); return recommendNode; } private HTMLNode createDeleteCell(PageMaker pageMaker, String identifier, ClientRequest clientRequest, ToadletContext ctx, ObjectContainer container) { HTMLNode deleteNode = new HTMLNode("td", "class", "request-delete"); HTMLNode deleteForm = ctx.addFormChild(deleteNode, path(), "queueDeleteForm-" + identifier.hashCode()); deleteForm.addChild("input", new String[] { "type", "name", "value" }, new String[] { "hidden", "identifier", identifier }); if((clientRequest instanceof ClientGet) && !((ClientGet)clientRequest).isToDisk()) { deleteForm.addChild("input", new String[] { "type", "name", "value" }, new String[] { "submit", "delete_request", NodeL10n.getBase().getString("QueueToadlet.deleteFileFromTemp") }); FreenetURI uri = ((ClientGet)clientRequest).getURI(container); deleteForm.addChild("input", new String[] { "type", "name", "value" }, new String[] { "hidden", "key", uri.toString(false, false) }); deleteForm.addChild("input", new String[] { "type", "name", "value" }, new String[] { "hidden", "size", SizeUtil.formatSize(((ClientGet)clientRequest).getDataSize(container)) }); deleteForm.addChild("input", new String[] { "type", "name", "value" }, new String[] { "hidden", "filename", uri.getPreferredFilename() }); if(((ClientGet)clientRequest).isTotalFinalized(container)) deleteForm.addChild("input", new String[] { "type", "name", "value" }, new String[] { "hidden", "finalized", "true" }); } else deleteForm.addChild("input", new String[] { "type", "name", "value" }, new String[] { "submit", "remove_request", NodeL10n.getBase().getString("QueueToadlet.remove") }); // If it's failed, offer to restart it if(clientRequest.hasFinished() && !clientRequest.hasSucceeded() && clientRequest.canRestart()) { HTMLNode retryForm = ctx.addFormChild(deleteNode, path(), "queueRestartForm-" + identifier.hashCode()); String restartName = NodeL10n.getBase().getString(clientRequest instanceof ClientGet && ((ClientGet)clientRequest).hasPermRedirect() ? "QueueToadlet.follow" : "QueueToadlet.restart"); retryForm.addChild("input", new String[] { "type", "name", "value" }, new String[] { "hidden", "identifier", identifier }); retryForm.addChild("input", new String[] { "type", "name", "value" }, new String[] { "submit", "restart_request", restartName }); } return deleteNode; } >>>>>>> private HTMLNode createReasonCell(String failureReason) { HTMLNode reasonCell = new HTMLNode("td", "class", "request-reason"); if (failureReason == null) { reasonCell.addChild("span", "class", "failure_reason_unknown", NodeL10n.getBase().getString("QueueToadlet.unknown")); } else { reasonCell.addChild("span", "class", "failure_reason_is", failureReason); } return reasonCell; }
<<<<<<< Logger.error(this, "Timeout awaiting reply to offer request on "+this+" to "+pn); // FIXME bug #4613 consider two-stage timeout. pn.fatalTimeout(); ======= origTag.removeFetchingOfferedKeyFrom(pn); >>>>>>> Logger.error(this, "Timeout awaiting reply to offer request on "+this+" to "+pn); // FIXME bug #4613 consider two-stage timeout. pn.fatalTimeout(); origTag.removeFetchingOfferedKeyFrom(pn); <<<<<<< Logger.error(this, "Timeout awaiting reply to offer request on "+this+" to "+pn); // FIXME bug #4613 consider two-stage timeout. pn.fatalTimeout(); ======= origTag.removeFetchingOfferedKeyFrom(pn); >>>>>>> Logger.error(this, "Timeout awaiting reply to offer request on "+this+" to "+pn); // FIXME bug #4613 consider two-stage timeout. pn.fatalTimeout(); origTag.removeFetchingOfferedKeyFrom(pn); <<<<<<< BlockReceiver br = new BlockReceiver(node.usm, pn, uid, prb, this, node.getTicker(), true, realTimeFlag, myTimeoutHandler); ======= BlockReceiver br = new BlockReceiver(node.usm, pn, uid, prb, this, node.getTicker(), true, realTimeFlag); >>>>>>> BlockReceiver br = new BlockReceiver(node.usm, pn, uid, prb, this, node.getTicker(), true, realTimeFlag, myTimeoutHandler); <<<<<<< handleAcceptedRejectedTimeout(next, origTag); ======= // It could still be running. So the timeout is fatal to the node. Logger.error(this, "Timeout awaiting Accepted/Rejected "+this+" to "+next); //next.fatalTimeout(); next.noLongerRoutingTo(origTag, false); >>>>>>> handleAcceptedRejectedTimeout(next, origTag); <<<<<<< final BlockReceiver br = new BlockReceiver(node.usm, next, uid, prb, this, node.getTicker(), true, realTimeFlag, myTimeoutHandler); ======= final BlockReceiver br = new BlockReceiver(node.usm, next, uid, prb, this, node.getTicker(), true, realTimeFlag); >>>>>>> final BlockReceiver br = new BlockReceiver(node.usm, next, uid, prb, this, node.getTicker(), true, realTimeFlag, myTimeoutHandler); <<<<<<< long deadline = now + (realTimeFlag ? 1200 * 1000 : 300 * 1000); ======= long deadline = now + (realTimeFlag ? 300 * 1000 : 1260 * 1000); >>>>>>> long deadline = now + (realTimeFlag ? 300 * 1000 : 1260 * 1000); <<<<<<< origTag.removeRoutingTo(next); ======= >>>>>>>
<<<<<<< bucket = BucketTools.makeImmutableBucket(context.getBucketFactory(persistent()), baseMetadata.writeToByteArray()); ======= bucket = BucketTools.makeImmutableBucket(ctx.bf, baseMetadata.writeToByteArray()); if(logMINOR) Logger.minor(this, "Metadata bucket is "+bucket.size()+" bytes long"); >>>>>>> bucket = BucketTools.makeImmutableBucket(context.getBucketFactory(persistent()), baseMetadata.writeToByteArray()); if(logMINOR) Logger.minor(this, "Metadata bucket is "+bucket.size()+" bytes long"); <<<<<<< Logger.minor(this, "Putting directory: "+name); namesToByteArrays((HashMap)o, subMap, container); ======= if(logMINOR) Logger.minor(this, "Putting hashmap into base metadata: "+name); namesToByteArrays((HashMap)o, subMap); >>>>>>> if(logMINOR) Logger.minor(this, "Putting hashmap into base metadata: "+name); Logger.minor(this, "Putting directory: "+name); namesToByteArrays((HashMap)o, subMap, container);
<<<<<<< import io.sphere.sdk.annotations.ResourceValue; ======= import io.sphere.sdk.annotations.HasByIdGetEndpoint; import io.sphere.sdk.annotations.HasQueryEndpoint; import io.sphere.sdk.annotations.ResourceInfo; >>>>>>> import io.sphere.sdk.annotations.*; <<<<<<< @ResourceValue ======= @HasQueryEndpoint(additionalContentsQueryInterface = "\n" + " default ShippingMethodQuery byName(final String name) {\n" + " return withPredicates(ShippingMethodQueryModel.of().name().is(name));\n" + " }\n" + "\n" + " default ShippingMethodQuery byTaxCategory(final io.sphere.sdk.models.Referenceable<io.sphere.sdk.taxcategories.TaxCategory> taxCategory) {\n" + " return withPredicates(m -> m.taxCategory().is(taxCategory));\n" + " }\n" + "\n" + " default ShippingMethodQuery byIsDefault() {\n" + " return withPredicates(m -> m.isDefault().is(true));\n" + " }") @ResourceInfo(pluralName = "shipping methods", pathElement = "shipping-methods") @HasByIdGetEndpoint(javadocSummary = "Fetches a shipping method by ID.", includeExamples = "io.sphere.sdk.shippingmethods.queries.ShippingMethodByIdGetIntegrationTest#execution()") >>>>>>> @ResourceValue @HasQueryEndpoint(additionalContentsQueryInterface = "\n" + " default ShippingMethodQuery byName(final String name) {\n" + " return withPredicates(ShippingMethodQueryModel.of().name().is(name));\n" + " }\n" + "\n" + " default ShippingMethodQuery byTaxCategory(final io.sphere.sdk.models.Referenceable<io.sphere.sdk.taxcategories.TaxCategory> taxCategory) {\n" + " return withPredicates(m -> m.taxCategory().is(taxCategory));\n" + " }\n" + "\n" + " default ShippingMethodQuery byIsDefault() {\n" + " return withPredicates(m -> m.isDefault().is(true));\n" + " }") @ResourceInfo(pluralName = "shipping methods", pathElement = "shipping-methods") @HasByIdGetEndpoint(javadocSummary = "Fetches a shipping method by ID.", includeExamples = "io.sphere.sdk.shippingmethods.queries.ShippingMethodByIdGetIntegrationTest#execution()")
<<<<<<< // 10% of memory above 64MB, with a minimum of 1MB. defaultRamBucketPoolSize = Math.min(Integer.MAX_VALUE, (int)((maxMemory - 64) / 10)); if(defaultRamBucketPoolSize <= 0) defaultRamBucketPoolSize = 1; ======= maxMemory /= (1024 * 1024); if(maxMemory <= 0) // Still bogus defaultRamBucketPoolSize = 10; else { // 10% of memory above 64MB, with a minimum of 1MB. defaultRamBucketPoolSize = (int)Math.min(Integer.MAX_VALUE, ((maxMemory - 64) / 10)); if(defaultRamBucketPoolSize <= 0) defaultRamBucketPoolSize = 1; } >>>>>>> // 10% of memory above 64MB, with a minimum of 1MB. defaultRamBucketPoolSize = (int)Math.min(Integer.MAX_VALUE, ((maxMemory - 64) / 10)); if(defaultRamBucketPoolSize <= 0) defaultRamBucketPoolSize = 1;
<<<<<<< @Override ======= final public static byte[] BZ_HEADER = "BZ".getBytes(); >>>>>>> final public static byte[] BZ_HEADER = "BZ".getBytes(); @Override <<<<<<< @Override ======= >>>>>>> @Override
<<<<<<< final HashResult[] hashes; ======= public final long topSize; public final long topCompressedSize; >>>>>>> final HashResult[] hashes; public final long topSize; public final long topCompressedSize; <<<<<<< public SplitFileInserter(BaseClientPutter put, PutCompletionCallback cb, Bucket data, COMPRESSOR_TYPE bestCodec, long decompressedLength, ClientMetadata clientMetadata, InsertContext ctx, boolean getCHKOnly, boolean isMetadata, Object token, ARCHIVE_TYPE archiveType, boolean freeData, boolean persistent, ObjectContainer container, ClientContext context, HashResult[] hashes) throws InsertException { ======= public SplitFileInserter(BaseClientPutter put, PutCompletionCallback cb, Bucket data, COMPRESSOR_TYPE bestCodec, long decompressedLength, ClientMetadata clientMetadata, InsertContext ctx, boolean getCHKOnly, boolean isMetadata, Object token, ARCHIVE_TYPE archiveType, boolean freeData, boolean persistent, ObjectContainer container, ClientContext context, long origTopSize, long origTopCompressedSize) throws InsertException { >>>>>>> public SplitFileInserter(BaseClientPutter put, PutCompletionCallback cb, Bucket data, COMPRESSOR_TYPE bestCodec, long decompressedLength, ClientMetadata clientMetadata, InsertContext ctx, boolean getCHKOnly, boolean isMetadata, Object token, ARCHIVE_TYPE archiveType, boolean freeData, boolean persistent, ObjectContainer container, ClientContext context, HashResult[] hashes, long origTopSize, long origTopCompressedSize) throws InsertException { <<<<<<< this.hashes = hashes; ======= this.topSize = origTopSize; this.topCompressedSize = origTopCompressedSize; >>>>>>> this.hashes = hashes; this.topSize = origTopSize; this.topCompressedSize = origTopCompressedSize; <<<<<<< this.hashes = null; ======= this.deductBlocksFromSegments = 0; >>>>>>> this.hashes = null; this.deductBlocksFromSegments = 0;
<<<<<<< public class NodeUpdater implements ClientCallback, USKCallback, RequestClient { ======= public class NodeUpdater implements ClientCallback, USKCallback { >>>>>>> public class NodeUpdater implements ClientCallback, USKCallback, RequestClient { <<<<<<< USK myUsk=USK.create(URI.setSuggestedEdition(currentVersion)); core.uskManager.subscribe(myUsk, this, true, this); }catch(MalformedURLException e){ Logger.error(this,"The auto-update URI isn't valid and can't be used"); ======= USK myUsk = USK.create(URI.setSuggestedEdition(currentVersion)); ctx.uskManager.subscribe(myUsk, this, true, this); } catch(MalformedURLException e) { Logger.error(this, "The auto-update URI isn't valid and can't be used"); >>>>>>> USK myUsk = USK.create(URI.setSuggestedEdition(currentVersion)); core.uskManager.subscribe(myUsk, this, true, this); } catch(MalformedURLException e) { Logger.error(this, "The auto-update URI isn't valid and can't be used"); <<<<<<< public void onFoundEdition(long l, USK key, ObjectContainer container, ClientContext context, boolean wasMetadata, short codec, byte[] data) { ======= public void onFoundEdition(long l, USK key) { >>>>>>> public void onFoundEdition(long l, USK key, ObjectContainer container, ClientContext context, boolean wasMetadata, short codec, byte[] data) { <<<<<<< public void run() { maybeUpdate(); } }, 60 * 1000); // leave some time in case we get later editions ======= public void run() { maybeUpdate(); } }, 60 * 1000); // leave some time in case we get later editions // LOCKING: Always take the NodeUpdater lock *BEFORE* the NodeUpdateManager lock if(found > currentVersion) >>>>>>> public void run() { maybeUpdate(); } }, 60 * 1000); // leave some time in case we get later editions // LOCKING: Always take the NodeUpdater lock *BEFORE* the NodeUpdateManager lock if(found > currentVersion) <<<<<<< node.clientCore.clientContext.start(toStart); } catch (FetchException e) { Logger.error(this, "Error while starting the fetching: "+e, e); ======= toStart.start(); } catch(FetchException e) { Logger.error(this, "Error while starting the fetching: " + e, e); >>>>>>> node.clientCore.clientContext.start(toStart); } catch(FetchException e) { Logger.error(this, "Error while starting the fetching: " + e, e); <<<<<<< public void onSuccess(FetchResult result, ClientGetter state, ObjectContainer container) { ======= public void onSuccess(FetchResult result, ClientGetter state) { >>>>>>> public void onSuccess(FetchResult result, ClientGetter state, ObjectContainer container) { <<<<<<< USK myUsk=USK.create(URI.setSuggestedEdition(currentVersion)); core.uskManager.unsubscribe(myUsk, this, true); ======= USK myUsk = USK.create(URI.setSuggestedEdition(currentVersion)); ctx.uskManager.unsubscribe(myUsk, this, true); >>>>>>> USK myUsk = USK.create(URI.setSuggestedEdition(currentVersion)); core.uskManager.unsubscribe(myUsk, this, true); <<<<<<< c.cancel(null, core.clientContext); }catch(Exception e){ ======= c.cancel(); } catch(Exception e) { >>>>>>> c.cancel(null, core.clientContext); } catch(Exception e) { <<<<<<< public void onMajorProgress(ObjectContainer container) { ======= public void onMajorProgress() { >>>>>>> public void onMajorProgress(ObjectContainer container) { <<<<<<< public void onFetchable(BaseClientPutter state, ObjectContainer container) { ======= public void onFetchable(BaseClientPutter state) { >>>>>>> public void onFetchable(BaseClientPutter state, ObjectContainer container) {
<<<<<<< private static final String CSS_STRING_NEWLINES = "<style>* { content: \"this string does not terminate\n}\nbody {\nbackground: url(http://www.google.co.uk/intl/en_uk/images/logo.gif); }\n\" }</style>"; private static final String CSS_STRING_NEWLINESC = "<style>* {}\nbody {}\n</style>"; private static final String HTML_STYLESHEET_MAYBECHARSET = "<link rel=\"stylesheet\" href=\"test.css\">"; private static final String HTML_STYLESHEET_MAYBECHARSETC = "<link rel=\"stylesheet\" type=\"text/css\" href=\"test.css?type=text/css&amp;maybecharset=iso-8859-1\">"; private static final String HTML_STYLESHEET_CHARSET = "<link rel=\"stylesheet\" charset=\"utf-8\" href=\"test.css\">"; private static final String HTML_STYLESHEET_CHARSETC = "<link charset=\"utf-8\" rel=\"stylesheet\" type=\"text/css\" href=\"test.css?type=text/css%3b%20charset=utf-8\">"; private static final String HTML_STYLESHEET_CHARSET_BAD = "<link rel=\"stylesheet\" charset=\"utf-8&max-size=4194304\" href=\"test.css\">"; private static final String HTML_STYLESHEET_CHARSET_BADC = "<link charset=\"utf-8\" rel=\"stylesheet\" type=\"text/css\" href=\"test.css?type=text/css%3b%20charset=utf-8\">"; private static final String HTML_STYLESHEET_CHARSET_BAD1 = "<link rel=\"stylesheet\" type=\"text/css; charset=utf-8&max-size=4194304\" href=\"test.css\">"; private static final String HTML_STYLESHEET_CHARSET_BAD1C = "<link charset=\"utf-8\" rel=\"stylesheet\" type=\"text/css\" href=\"test.css?type=text/css%3b%20charset=utf-8\">"; ======= //private static final String CSS_STRING_NEWLINES = "<style>* { content: \"this string does not terminate\n}\nbody {\nbackground: url(http://www.google.co.uk/intl/en_uk/images/logo.gif); }\n\" }</style>"; //private static final String CSS_STRING_NEWLINESC = "<style>* {}\nbody {}\n</style>"; private static final String HTML_STYLESHEET_MAYBECHARSET = "<link rel=\"stylesheet\" href=\"test.css\">"; private static final String HTML_STYLESHEET_MAYBECHARSETC = "<link rel=\"stylesheet\" href=\"test.css?type=text/css&amp;maybecharset=ISO-8859-1\">"; private static final String HTML_STYLESHEET_CHARSET_BAD = "<link rel=\"stylesheet\" charset=\"utf-8&max-size=4194304\" href=\"test.css\">"; private static final String HTML_STYLESHEET_CHARSET_BADC = "<link rel=\"stylesheet\" type=\"text/css\" href=\"test.css?type=text/css\">"; private static final String HTML_STYLESHEET_CHARSET_BAD1 = "<link rel=\"stylesheet\" type=\"text/css; charset=utf-8&max-size=4194304\" href=\"test.css\">"; private static final String HTML_STYLESHEET_CHARSET_BAD1C = "<link rel=\"stylesheet\" type=\"text/css\" href=\"test.css?type=text/css\">"; private static final String FRAME_SRC_CHARSET = "<frame src=\"test.html?type=text/html; charset=UTF-8\">"; private static final String FRAME_SRC_CHARSETC = "<frame src=\"test.html?type=text/html%3b%20charset=UTF-8\">"; private static final String FRAME_SRC_CHARSET_BAD = "<frame src=\"test.html?type=text/html; charset=UTF-8&max-size=4194304\">"; private static final String FRAME_SRC_CHARSET_BADC = "<frame src=\"test.html?type=text/html%3b%20charset=UTF-8\">"; private static final String FRAME_SRC_CHARSET_BAD1 = "<frame src=\"test.html?type=text/html; charset=UTF-8%26max-size=4194304\">"; private static final String FRAME_SRC_CHARSET_BAD1C = "<frame src=\"test.html?type=text/html\">"; >>>>>>> private static final String CSS_STRING_NEWLINES = "<style>* { content: \"this string does not terminate\n}\nbody {\nbackground: url(http://www.google.co.uk/intl/en_uk/images/logo.gif); }\n\" }</style>"; private static final String CSS_STRING_NEWLINESC = "<style>* {}\nbody {}\n</style>"; private static final String HTML_STYLESHEET_MAYBECHARSET = "<link rel=\"stylesheet\" href=\"test.css\">"; private static final String HTML_STYLESHEET_MAYBECHARSETC = "<link rel=\"stylesheet\" type=\"text/css\" href=\"test.css?type=text/css&amp;maybecharset=iso-8859-1\">"; private static final String HTML_STYLESHEET_CHARSET = "<link rel=\"stylesheet\" charset=\"utf-8\" href=\"test.css\">"; private static final String HTML_STYLESHEET_CHARSETC = "<link charset=\"utf-8\" rel=\"stylesheet\" type=\"text/css\" href=\"test.css?type=text/css%3b%20charset=utf-8\">"; private static final String HTML_STYLESHEET_CHARSET_BAD = "<link rel=\"stylesheet\" charset=\"utf-8&max-size=4194304\" href=\"test.css\">"; private static final String HTML_STYLESHEET_CHARSET_BADC = "<link rel=\"stylesheet\" type=\"text/css\" href=\"test.css?type=text/css\">"; private static final String HTML_STYLESHEET_CHARSET_BAD1 = "<link rel=\"stylesheet\" type=\"text/css; charset=utf-8&max-size=4194304\" href=\"test.css\">"; private static final String HTML_STYLESHEET_CHARSET_BAD1C = "<link rel=\"stylesheet\" type=\"text/css\" href=\"test.css?type=text/css\">"; private static final String FRAME_SRC_CHARSET = "<frame src=\"test.html?type=text/html; charset=UTF-8\">"; private static final String FRAME_SRC_CHARSETC = "<frame src=\"test.html?type=text/html%3b%20charset=UTF-8\">"; private static final String FRAME_SRC_CHARSET_BAD = "<frame src=\"test.html?type=text/html; charset=UTF-8&max-size=4194304\">"; private static final String FRAME_SRC_CHARSET_BADC = "<frame src=\"test.html?type=text/html%3b%20charset=UTF-8\">"; private static final String FRAME_SRC_CHARSET_BAD1 = "<frame src=\"test.html?type=text/html; charset=UTF-8%26max-size=4194304\">"; private static final String FRAME_SRC_CHARSET_BAD1C = "<frame src=\"test.html?type=text/html\">"; <<<<<<< assertEquals(CSS_STRING_NEWLINESC,HTMLFilter(CSS_STRING_NEWLINES)); //assertEquals(HTML_STYLESHEET_MAYBECHARSETC, HTMLFilter(HTML_STYLESHEET_MAYBECHARSET, true)); //assertEquals(HTML_STYLESHEET_CHARSETC, HTMLFilter(HTML_STYLESHEET_CHARSET, true)); assertEquals(HTML_STYLESHEET_CHARSET_BADC, HTMLFilter(HTML_STYLESHEET_CHARSET_BAD, true)); assertEquals(HTML_STYLESHEET_CHARSET_BAD1C, HTMLFilter(HTML_STYLESHEET_CHARSET_BAD1, true)); ======= // assertEquals(CSS_STRING_NEWLINESC,HTMLFilter(CSS_STRING_NEWLINES)); //assertEquals(HTML_STYLESHEET_MAYBECHARSETC, HTMLFilter(HTML_STYLESHEET_MAYBECHARSET, true)); //assertEquals(HTML_STYLESHEET_CHARSETC, HTMLFilter(HTML_STYLESHEET_CHARSET, true)); assertEquals(HTML_STYLESHEET_CHARSET_BADC, HTMLFilter(HTML_STYLESHEET_CHARSET_BAD, true)); assertEquals(HTML_STYLESHEET_CHARSET_BAD1C, HTMLFilter(HTML_STYLESHEET_CHARSET_BAD1, true)); assertEquals(FRAME_SRC_CHARSETC, HTMLFilter(FRAME_SRC_CHARSET, true)); assertEquals(FRAME_SRC_CHARSET_BADC, HTMLFilter(FRAME_SRC_CHARSET_BAD, true)); assertEquals(FRAME_SRC_CHARSET_BAD1C, HTMLFilter(FRAME_SRC_CHARSET_BAD1, true)); >>>>>>> assertEquals(CSS_STRING_NEWLINESC,HTMLFilter(CSS_STRING_NEWLINES)); //assertEquals(HTML_STYLESHEET_MAYBECHARSETC, HTMLFilter(HTML_STYLESHEET_MAYBECHARSET, true)); //assertEquals(HTML_STYLESHEET_CHARSETC, HTMLFilter(HTML_STYLESHEET_CHARSET, true)); assertEquals(HTML_STYLESHEET_CHARSET_BADC, HTMLFilter(HTML_STYLESHEET_CHARSET_BAD, true)); assertEquals(HTML_STYLESHEET_CHARSET_BAD1C, HTMLFilter(HTML_STYLESHEET_CHARSET_BAD1, true)); assertEquals(FRAME_SRC_CHARSETC, HTMLFilter(FRAME_SRC_CHARSET, true)); assertEquals(FRAME_SRC_CHARSET_BADC, HTMLFilter(FRAME_SRC_CHARSET_BAD, true)); assertEquals(FRAME_SRC_CHARSET_BAD1C, HTMLFilter(FRAME_SRC_CHARSET_BAD1, true));
<<<<<<< NewPacketFormat npf = new NewPacketFormat(null, 0, 0, NEW_FORMAT); PeerMessageQueue pmq = new PeerMessageQueue(new NullBasePeerNode()); ======= NewPacketFormat npf = new NewPacketFormat(null, 0, 0); PeerMessageQueue pmq = new PeerMessageQueue(); >>>>>>> NewPacketFormat npf = new NewPacketFormat(null, 0, 0); PeerMessageQueue pmq = new PeerMessageQueue(new NullBasePeerNode()); <<<<<<< BasePeerNode pn = new NullBasePeerNode(); NewPacketFormat npf = new NewPacketFormat(pn, 0, 0, NEW_FORMAT); PeerMessageQueue pmq = new PeerMessageQueue(pn); ======= NewPacketFormat npf = new NewPacketFormat(null, 0, 0); PeerMessageQueue pmq = new PeerMessageQueue(); >>>>>>> BasePeerNode pn = new NullBasePeerNode(); NewPacketFormat npf = new NewPacketFormat(pn, 0, 0); PeerMessageQueue pmq = new PeerMessageQueue(pn); <<<<<<< NewPacketFormat sender = new NewPacketFormat(senderNode, 0, 0, NEW_FORMAT); PeerMessageQueue senderQueue = new PeerMessageQueue(new NullBasePeerNode()); NullBasePeerNode receiverNode = new NullBasePeerNode(); NewPacketFormat receiver = new NewPacketFormat(receiverNode, 0, 0, NEW_FORMAT); PeerMessageQueue receiverQueue = new PeerMessageQueue(receiverNode); ======= NewPacketFormat sender = new NewPacketFormat(senderNode, 0, 0); PeerMessageQueue senderQueue = new PeerMessageQueue(); NewPacketFormat receiver = new NewPacketFormat(null, 0, 0); PeerMessageQueue receiverQueue = new PeerMessageQueue(); >>>>>>> NewPacketFormat sender = new NewPacketFormat(senderNode, 0, 0); PeerMessageQueue senderQueue = new PeerMessageQueue(new NullBasePeerNode()); // FIXME senderNode NullBasePeerNode receiverNode = new NullBasePeerNode(); NewPacketFormat receiver = new NewPacketFormat(receiverNode, 0, 0); PeerMessageQueue receiverQueue = new PeerMessageQueue(receiverNode); <<<<<<< NullBasePeerNode senderNode = new NullBasePeerNode(); NewPacketFormat sender = new NewPacketFormat(senderNode, 0, 0, NEW_FORMAT); PeerMessageQueue senderQueue = new PeerMessageQueue(senderNode); NullBasePeerNode receiverNode = new NullBasePeerNode(); NewPacketFormat receiver = new NewPacketFormat(receiverNode, 0, 0, NEW_FORMAT); ======= NewPacketFormat sender = new NewPacketFormat(null, 0, 0); PeerMessageQueue senderQueue = new PeerMessageQueue(); NewPacketFormat receiver = new NewPacketFormat(null, 0, 0); >>>>>>> NullBasePeerNode senderNode = new NullBasePeerNode(); NewPacketFormat sender = new NewPacketFormat(senderNode, 0, 0); PeerMessageQueue senderQueue = new PeerMessageQueue(senderNode); NullBasePeerNode receiverNode = new NullBasePeerNode(); NewPacketFormat receiver = new NewPacketFormat(receiverNode, 0, 0); <<<<<<< NullBasePeerNode senderNode = new NullBasePeerNode(); NewPacketFormat sender = new NewPacketFormat(senderNode, 0, 0, NEW_FORMAT); PeerMessageQueue senderQueue = new PeerMessageQueue(senderNode); NullBasePeerNode receiverNode = new NullBasePeerNode(); NewPacketFormat receiver = new NewPacketFormat(receiverNode, 0, 0, NEW_FORMAT); ======= NewPacketFormat sender = new NewPacketFormat(null, 0, 0); PeerMessageQueue senderQueue = new PeerMessageQueue(); NewPacketFormat receiver = new NewPacketFormat(null, 0, 0); >>>>>>> NullBasePeerNode senderNode = new NullBasePeerNode(); NewPacketFormat sender = new NewPacketFormat(senderNode, 0, 0); PeerMessageQueue senderQueue = new PeerMessageQueue(senderNode); NullBasePeerNode receiverNode = new NullBasePeerNode(); NewPacketFormat receiver = new NewPacketFormat(receiverNode, 0, 0); <<<<<<< NullBasePeerNode senderNode = new NullBasePeerNode(); NewPacketFormat sender = new NewPacketFormat(senderNode, 0, 0, NEW_FORMAT); PeerMessageQueue senderQueue = new PeerMessageQueue(senderNode); NullBasePeerNode receiverNode = new NullBasePeerNode(); NewPacketFormat receiver = new NewPacketFormat(receiverNode, 0, 0, NEW_FORMAT); ======= NewPacketFormat sender = new NewPacketFormat(null, 0, 0); PeerMessageQueue senderQueue = new PeerMessageQueue(); NewPacketFormat receiver = new NewPacketFormat(null, 0, 0); >>>>>>> NullBasePeerNode senderNode = new NullBasePeerNode(); NewPacketFormat sender = new NewPacketFormat(senderNode, 0, 0); PeerMessageQueue senderQueue = new PeerMessageQueue(senderNode); NullBasePeerNode receiverNode = new NullBasePeerNode(); NewPacketFormat receiver = new NewPacketFormat(receiverNode, 0, 0);
<<<<<<< @Deprecated public ClientGetter fetch(FreenetURI uri, long maxSize, RequestClient clientContext, ClientCallback callback, FetchContext fctx) throws FetchException { return fetch(uri, maxSize, clientContext, (ClientGetCallback)callback, fctx); } ======= >>>>>>> <<<<<<< /** * @deprecated Use {@link #addEventHook(ClientEventListener)} instead */ public void addGlobalHook(ClientEventListener listener) { addEventHook(listener); } ======= >>>>>>> <<<<<<< public void prefetch(FreenetURI uri, long timeout, long maxSize, Set<String> allowedTypes) { ======= public void prefetch(FreenetURI uri, long timeout, long maxSize, Set allowedTypes) { >>>>>>> public void prefetch(FreenetURI uri, long timeout, long maxSize, Set<String> allowedTypes) { <<<<<<< public void prefetch(FreenetURI uri, long timeout, long maxSize, Set<String> allowedTypes, short prio) { ======= public void prefetch(FreenetURI uri, long timeout, long maxSize, Set allowedTypes, short prio) { >>>>>>> public void prefetch(FreenetURI uri, long timeout, long maxSize, Set<String> allowedTypes, short prio) {
<<<<<<< public void run(final FCPConnectionHandler handler, Node node) ======= @Override public void run(FCPConnectionHandler handler, Node node) >>>>>>> @Override public void run(final FCPConnectionHandler handler, Node node)
<<<<<<< public void handleGet(URI uri, final HTTPRequest request, final ToadletContext ctx) ======= @Override public void handleGet(URI uri, final HTTPRequest request, ToadletContext ctx) >>>>>>> @Override public void handleGet(URI uri, final HTTPRequest request, final ToadletContext ctx)
<<<<<<< /** * Must be called just after construction, but within a transaction. * @throws IdentifierCollisionException If the identifier is already in use. */ void register(ObjectContainer container, boolean lazyResume, boolean noTags) throws IdentifierCollisionException { if(persistenceType != PERSIST_CONNECTION) try { client.register(this, lazyResume, container); } catch (IdentifierCollisionException e) { returnBucket.free(); throw e; } if(persistenceType != PERSIST_CONNECTION && !noTags) { FCPMessage msg = persistentTagMessage(container); client.queueClientRequestMessage(msg, 0, container); } } public void start(ObjectContainer container, ClientContext context) { ======= @Override public void start() { >>>>>>> /** * Must be called just after construction, but within a transaction. * @throws IdentifierCollisionException If the identifier is already in use. */ void register(ObjectContainer container, boolean lazyResume, boolean noTags) throws IdentifierCollisionException { if(persistenceType != PERSIST_CONNECTION) try { client.register(this, lazyResume, container); } catch (IdentifierCollisionException e) { returnBucket.free(); throw e; } if(persistenceType != PERSIST_CONNECTION && !noTags) { FCPMessage msg = persistentTagMessage(container); client.queueClientRequestMessage(msg, 0, container); } } @Override public void start(ObjectContainer container, ClientContext context) { <<<<<<< public void onLostConnection(ObjectContainer container, ClientContext context) { ======= @Override public void onLostConnection() { >>>>>>> @Override public void onLostConnection(ObjectContainer container, ClientContext context) { <<<<<<< public void sendPendingMessages(FCPConnectionOutputHandler handler, boolean includePersistentRequest, boolean includeData, boolean onlyData, ObjectContainer container) { ======= @Override public void sendPendingMessages(FCPConnectionOutputHandler handler, boolean includePersistentRequest, boolean includeData, boolean onlyData) { >>>>>>> @Override public void sendPendingMessages(FCPConnectionOutputHandler handler, boolean includePersistentRequest, boolean includeData, boolean onlyData, ObjectContainer container) { <<<<<<< protected FCPMessage persistentTagMessage(ObjectContainer container) { if(persistenceType == PERSIST_FOREVER) { container.activate(uri, 5); container.activate(fctx, 1); container.activate(client, 1); container.activate(targetFile, 5); container.activate(tempFile, 5); } ======= @Override protected FCPMessage persistentTagMessage() { >>>>>>> @Override protected FCPMessage persistentTagMessage(ObjectContainer container) { if(persistenceType == PERSIST_FOREVER) { container.activate(uri, 5); container.activate(fctx, 1); container.activate(client, 1); container.activate(targetFile, 5); container.activate(tempFile, 5); } <<<<<<< public void requestWasRemoved(ObjectContainer container) { ======= @Override public void requestWasRemoved() { >>>>>>> @Override public void requestWasRemoved(ObjectContainer container) { <<<<<<< protected void freeData(ObjectContainer container) { Bucket data; synchronized(this) { data = returnBucket; returnBucket = null; } if(data != null) { if(persistenceType == PERSIST_FOREVER) container.activate(data, 5); data.free(); if(persistenceType == PERSIST_FOREVER) data.removeFrom(container); } ======= @Override protected void freeData() { if(returnBucket != null) returnBucket.free(); >>>>>>> @Override protected void freeData(ObjectContainer container) { Bucket data; synchronized(this) { data = returnBucket; returnBucket = null; } if(data != null) { if(persistenceType == PERSIST_FOREVER) container.activate(data, 5); data.free(); if(persistenceType == PERSIST_FOREVER) data.removeFrom(container); } <<<<<<< public double getSuccessFraction(ObjectContainer container) { if(persistenceType == PERSIST_FOREVER && progressPending != null) container.activate(progressPending, 2); ======= @Override public double getSuccessFraction() { >>>>>>> @Override public double getSuccessFraction(ObjectContainer container) { if(persistenceType == PERSIST_FOREVER && progressPending != null) container.activate(progressPending, 2); <<<<<<< public double getTotalBlocks(ObjectContainer container) { if(persistenceType == PERSIST_FOREVER && progressPending != null) container.activate(progressPending, 2); ======= @Override public double getTotalBlocks() { >>>>>>> @Override public double getTotalBlocks(ObjectContainer container) { if(persistenceType == PERSIST_FOREVER && progressPending != null) container.activate(progressPending, 2); <<<<<<< public double getMinBlocks(ObjectContainer container) { if(persistenceType == PERSIST_FOREVER && progressPending != null) container.activate(progressPending, 2); ======= @Override public double getMinBlocks() { >>>>>>> @Override public double getMinBlocks(ObjectContainer container) { if(persistenceType == PERSIST_FOREVER && progressPending != null) container.activate(progressPending, 2); <<<<<<< public double getFailedBlocks(ObjectContainer container) { if(persistenceType == PERSIST_FOREVER && progressPending != null) container.activate(progressPending, 2); ======= @Override public double getFailedBlocks() { >>>>>>> @Override public double getFailedBlocks(ObjectContainer container) { if(persistenceType == PERSIST_FOREVER && progressPending != null) container.activate(progressPending, 2); <<<<<<< public double getFatalyFailedBlocks(ObjectContainer container) { if(persistenceType == PERSIST_FOREVER && progressPending != null) container.activate(progressPending, 2); ======= @Override public double getFatalyFailedBlocks() { >>>>>>> @Override public double getFatalyFailedBlocks(ObjectContainer container) { if(persistenceType == PERSIST_FOREVER && progressPending != null) container.activate(progressPending, 2); <<<<<<< public double getFetchedBlocks(ObjectContainer container) { if(persistenceType == PERSIST_FOREVER && progressPending != null) container.activate(progressPending, 2); ======= @Override public double getFetchedBlocks() { >>>>>>> @Override public double getFetchedBlocks(ObjectContainer container) { if(persistenceType == PERSIST_FOREVER && progressPending != null) container.activate(progressPending, 2); <<<<<<< public String getFailureReason(ObjectContainer container) { ======= @Override public String getFailureReason() { >>>>>>> @Override public String getFailureReason(ObjectContainer container) { <<<<<<< public boolean isTotalFinalized(ObjectContainer container) { ======= @Override public boolean isTotalFinalized() { >>>>>>> @Override public boolean isTotalFinalized(ObjectContainer container) { <<<<<<< public boolean restart(ObjectContainer container, ClientContext context) { ======= @Override public boolean restart() { >>>>>>> @Override public boolean restart(ObjectContainer container, ClientContext context) {
<<<<<<< @SuppressWarnings("unused") private Object mappedFieldOfTypeObject; @SuppressWarnings("unused") private String mappedFieldOfTypeString; private Field mappedField; ======= private Object mappedFieldValue; >>>>>>> @SuppressWarnings("unused") private Object mappedFieldOfTypeObject; @SuppressWarnings("unused") private String mappedFieldOfTypeString; private Field mappedField; <<<<<<< this.mappedFieldOfTypeObject = ((Optional) this.mappedFieldOfTypeObject).orElse(null); ======= this.mappedFieldValue = ((Optional<?>) this.mappedFieldValue).orElse(null); >>>>>>> this.mappedFieldOfTypeObject = ((Optional<?>) this.mappedFieldOfTypeObject).orElse(null); <<<<<<< assertThat(this.mappedFieldOfTypeObject).isInstanceOf(Optional.class); assertThat(((Optional) this.mappedFieldOfTypeObject).orElse(null)).isEqualTo(expected); ======= assertThat(this.mappedFieldValue).isInstanceOf(Optional.class); assertThat(((Optional<?>) this.mappedFieldValue).orElse(null)).isEqualTo(expected); >>>>>>> assertThat(this.mappedFieldOfTypeObject).isInstanceOf(Optional.class); assertThat(((Optional<?>) this.mappedFieldOfTypeObject).orElse(null)).isEqualTo(expected); <<<<<<< assertThat(((Optional) this.mappedFieldOfTypeObject).isPresent()).isTrue(); ======= assertThat(((Optional<?>) this.mappedFieldValue).isPresent()).isTrue(); >>>>>>> assertThat(((Optional<?>) this.mappedFieldOfTypeObject).isPresent()).isTrue(); <<<<<<< assertThat(((Optional) this.mappedFieldOfTypeObject).isPresent()).isFalse(); ======= assertThat(((Optional<?>) this.mappedFieldValue).isPresent()).isFalse(); >>>>>>> assertThat(((Optional<?>) this.mappedFieldOfTypeObject).isPresent()).isFalse(); <<<<<<< assertThat(this.mappedFieldOfTypeObject).isInstanceOf(Optional.class); ((Optional) this.mappedFieldOfTypeObject).get(); ======= assertThat(this.mappedFieldValue).isInstanceOf(Optional.class); ((Optional<?>) this.mappedFieldValue).get(); >>>>>>> assertThat(this.mappedFieldOfTypeObject).isInstanceOf(Optional.class); ((Optional<?>) this.mappedFieldOfTypeObject).get(); <<<<<<< assertThat(this.mappedFieldOfTypeObject).isInstanceOf(Collection.class); assertThat((Collection) this.mappedFieldOfTypeObject).containsOnly(this.targetValue); ======= assertThat(this.mappedFieldValue).isInstanceOf(Collection.class); assertThat((Collection<?>) this.mappedFieldValue).containsOnly(this.targetValue); >>>>>>> assertThat(this.mappedFieldOfTypeObject).isInstanceOf(Collection.class); assertThat((Collection<?>) this.mappedFieldOfTypeObject).containsOnly(this.targetValue); <<<<<<< assertThat(this.mappedFieldOfTypeObject).isInstanceOf(Collection.class); assertThat((Collection) this.mappedFieldOfTypeObject).isEmpty(); ======= assertThat(this.mappedFieldValue).isInstanceOf(Collection.class); assertThat((Collection<?>) this.mappedFieldValue).isEmpty(); >>>>>>> assertThat(this.mappedFieldOfTypeObject).isInstanceOf(Collection.class); assertThat((Collection<?>) this.mappedFieldOfTypeObject).isEmpty();
<<<<<<< import io.neba.core.util.ResolvedModelSource; ======= import io.neba.core.util.ResolvedModel; import org.apache.sling.api.SlingHttpServletRequest; >>>>>>> import io.neba.core.util.ResolvedModelSource; import org.apache.sling.api.SlingHttpServletRequest;
<<<<<<< import android.content.Context; ======= import com.instacart.library.truetime.TrueLog; import com.instacart.library.truetime.SntpClient; >>>>>>> import com.instacart.library.truetime.TrueLog; import com.instacart.library.truetime.SntpClient; import android.content.Context; <<<<<<< initialize(ntpHost); ======= SntpClient sntpClient = new SntpClient(); TrueLog.i(TAG, "---- Querying host : " + ntpHost); sntpClient.requestTime(ntpHost, udpSocketTimeoutInMillis); setSntpClient(sntpClient); >>>>>>> initialize(ntpHost);
<<<<<<< switch (Integer.parseInt(AppSettings.getSharedPreferences(this) .getString("widget_theme", "3"))) { ======= switch (Integer.parseInt(getSharedPreferences("com.klinker.android.twitter_world_preferences", Context.MODE_WORLD_READABLE + Context.MODE_WORLD_WRITEABLE) .getString("widget_theme", "4"))) { >>>>>>> switch (Integer.parseInt(AppSettings.getSharedPreferences(this) .getString("widget_theme", "4"))) { <<<<<<< SharedPreferences sharedPrefs = AppSettings.getSharedPreferences(this); int currentAccount = sharedPrefs.getInt("current_account", 1); ======= SharedPreferences sharedPrefs = getSharedPreferences("com.klinker.android.twitter_world_preferences", Context.MODE_WORLD_READABLE + Context.MODE_WORLD_WRITEABLE); int currentAccount = AppSettings.getInstance(this).widgetAccountNum; >>>>>>> SharedPreferences sharedPrefs = AppSettings.getSharedPreferences(this); int currentAccount = AppSettings.getInstance(this).widgetAccountNum;
<<<<<<< switch (Integer.parseInt(AppSettings.getSharedPreferences(this) .getString("widget_theme", "3"))) { ======= switch (Integer.parseInt(getSharedPreferences("com.klinker.android.twitter_world_preferences", Context.MODE_WORLD_READABLE + Context.MODE_WORLD_WRITEABLE) .getString("widget_theme", "4"))) { >>>>>>> switch (Integer.parseInt(AppSettings.getSharedPreferences(this) .getString("widget_theme", "4"))) {
<<<<<<< HttpEntity entity = response.getEntity(); InputStream is = entity.getContent(); BufferedReader reader = new BufferedReader(new InputStreamReader(is, format)); StringBuilder sb = new StringBuilder(); ======= >>>>>>>
<<<<<<< public void onHandleIntent(Intent intent) { sharedPrefs = AppSettings.getSharedPreferences(this); ======= public void handleIntent(Intent intent) { sharedPrefs = getSharedPreferences("com.klinker.android.twitter_world_preferences", Context.MODE_WORLD_READABLE + Context.MODE_WORLD_WRITEABLE); >>>>>>> public void handleIntent(Intent intent) { sharedPrefs = AppSettings.getSharedPreferences(this);
<<<<<<< SharedPreferences sharedPrefs = AppSettings.getSharedPreferences(context); ======= final SharedPreferences sharedPrefs = context.getSharedPreferences("com.klinker.android.twitter_world_preferences", Context.MODE_WORLD_READABLE + Context.MODE_WORLD_WRITEABLE); >>>>>>> final SharedPreferences sharedPrefs = AppSettings.getSharedPreferences(context);
<<<<<<< public InteractionsDataSource interactions; public FavoriteUsersDataSource favs; ======= >>>>>>> <<<<<<< if (MainActivity.homeDataSource == null) { MainActivity.homeDataSource = new HomeDataSource(this); MainActivity.homeDataSource.open(); } favs = new FavoriteUsersDataSource(this); favs.open(); if (MainActivity.mentionsDataSource == null) { MainActivity.mentionsDataSource = new MentionsDataSource(this); MainActivity.mentionsDataSource.open(); } ======= >>>>>>> <<<<<<< try { interactions.close(); } catch (Exception e) { } try { favs.close(); } catch (Exception e) { } ======= >>>>>>> <<<<<<< try { interactions.close(); } catch (Exception e) { } ======= >>>>>>> <<<<<<< if (MainActivity.mentionsDataSource == null) { MainActivity.mentionsDataSource = new MentionsDataSource(mContext); MainActivity.mentionsDataSource.open(); } if (!MainActivity.mentionsDataSource.tweetExists(status.getId(), sharedPreferences.getInt("current_account", 1))) { try { MainActivity.mentionsDataSource.createTweet(status, sharedPreferences.getInt("current_account", 1)); } catch (Exception e) { MainActivity.mentionsDataSource = new MentionsDataSource(mContext); MainActivity.mentionsDataSource.open(); MainActivity.mentionsDataSource.createTweet(status, sharedPreferences.getInt("current_account", 1)); } ======= MentionsDataSource mentions = MentionsDataSource.getInstance(mContext); if (!mentions.tweetExists(status.getId(), sharedPreferences.getInt("current_account", 1))) { mentions.createTweet(status, sharedPreferences.getInt("current_account", 1)); >>>>>>> MentionsDataSource mentions = MentionsDataSource.getInstance(mContext); if (!mentions.tweetExists(status.getId(), sharedPreferences.getInt("current_account", 1))) { mentions.createTweet(status, sharedPreferences.getInt("current_account", 1)); <<<<<<< try { MainActivity.homeDataSource.deleteTweet(statusDeletionNotice.getStatusId()); sharedPreferences.edit().putBoolean("refresh_me", true).commit(); } catch (Exception e) { MainActivity.homeDataSource = new HomeDataSource(mContext); MainActivity.homeDataSource.open(); MainActivity.homeDataSource.deleteTweet(statusDeletionNotice.getStatusId()); sharedPreferences.edit().putBoolean("refresh_me", true).commit(); } ======= HomeDataSource.getInstance(mContext) .deleteTweet(statusDeletionNotice.getStatusId()); sharedPreferences.edit().putBoolean("refresh_me", true).commit(); >>>>>>> /*HomeDataSource.getInstance(mContext) .deleteTweet(statusDeletionNotice.getStatusId()); sharedPreferences.edit().putBoolean("refresh_me", true).commit();*/
<<<<<<< ======= import sernet.hui.common.VeriniceContext; import sernet.springclient.RightsServiceClient; import sernet.verinice.bp.rcp.BaseProtectionView; >>>>>>> import sernet.hui.common.VeriniceContext; import sernet.springclient.RightsServiceClient; import sernet.verinice.bp.rcp.BaseProtectionView; <<<<<<< ======= private OpenViewAction openTemplateViewAction; private OpenViewAction openBpViewAction; >>>>>>> private OpenViewAction openBpViewAction; <<<<<<< ======= this.openTemplateViewAction = getRightsService().isEnabled(ActionRightIDs.TEMPLATES) ? new OpenViewAction(window, Messages.ApplicationActionBarAdvisor_44, TemplateView.ID, ImageCache.TEMPLATES, ActionRightIDs.TEMPLATES) : null; this.openBpViewAction = new OpenViewAction(window, Messages.ApplicationActionBarAdvisor_45, BaseProtectionView.ID, ImageCache.VIEW_BASE_PROTECTION, ActionRightIDs.BASEPROTECTIONVIEW); >>>>>>> this.openBpViewAction = new OpenViewAction(window, Messages.ApplicationActionBarAdvisor_45, BaseProtectionView.ID, ImageCache.VIEW_BASE_PROTECTION, ActionRightIDs.BASEPROTECTIONVIEW); <<<<<<< viewsMenu.add(this.openValidationViewAction); viewsMenu.add(this.openSearchViewAction); viewsMenu.add(this.openGSToolMappingViewAction); ======= viewsMenu.add(this.openValidationViewAction); viewsMenu.add(this.openSearchViewAction); viewsMenu.add(new Separator()); viewsMenu.add(this.openAccountViewAction); viewsMenu.add(this.openGroupViewAction); viewsMenu.add(this.openTaskViewAction); viewsMenu.add(this.openReportdepositViewAction); viewsMenu.add(new Separator()); if (getRightsService().isEnabled(ActionRightIDs.TEMPLATES)) { viewsMenu.add(this.openTemplateViewAction); } viewsMenu.add(new Separator()); >>>>>>> viewsMenu.add(this.openValidationViewAction); viewsMenu.add(this.openSearchViewAction); viewsMenu.add(new Separator()); viewsMenu.add(this.openAccountViewAction); viewsMenu.add(this.openGroupViewAction); viewsMenu.add(this.openTaskViewAction); viewsMenu.add(this.openReportdepositViewAction); viewsMenu.add(new Separator()); viewsMenu.add(new Separator());
<<<<<<< private final IReevaluator protectionRequirementsProvider = new Reevaluator(this); private final ILinkChangeListener linkChangeListener = new AbstractLinkChangeListener() { private static final long serialVersionUID = -3220319074711927103L; @Override public void determineValue(CascadingTransaction ta) throws TransactionAbortedException { if (!isDeductiveImplementationEnabled(BpRequirement.this) || ta.hasBeenVisited(BpRequirement.this)) { return; } for (CnALink cnALink : BpRequirement.this.getLinksUp()) { CnATreeElement dependant = cnALink.getDependant(); if (dependant instanceof Safeguard) { setImplementationStausToRequirement((Safeguard) dependant, BpRequirement.this); } } } }; protected BpRequirement() {} ======= public static final String REL_BP_REQUIREMENT_BP_ITNETWORK = "rel_bp_requirement_bp_itnetwork"; //$NON-NLS-1$ public static final String REL_BP_REQUIREMENT_BP_BUSINESSPROCESS = "rel_bp_requirement_bp_businessprocess"; //$NON-NLS-1$ public static final String REL_BP_REQUIREMENT_BP_APPLICATION = "rel_bp_requirement_bp_application"; //$NON-NLS-1$ public static final String REL_BP_REQUIREMENT_BP_ITSYSTEM = "rel_bp_requirement_bp_itsystem"; //$NON-NLS-1$ public static final String REL_BP_REQUIREMENT_BP_ICSSYSTEM = "rel_bp_requirement_bp_icssystem"; //$NON-NLS-1$ public static final String REL_BP_REQUIREMENT_BP_DEVICE = "rel_bp_requirement_bp_device"; //$NON-NLS-1$ public static final String REL_BP_REQUIREMENT_BP_NETWORK = "rel_bp_requirement_bp_network"; //$NON-NLS-1$ public static final String REL_BP_REQUIREMENT_BP_ROOM = "rel_bp_requirement_bp_room"; //$NON-NLS-1$ protected BpRequirement() { } >>>>>>> public static final String REL_BP_REQUIREMENT_BP_ITNETWORK = "rel_bp_requirement_bp_itnetwork"; //$NON-NLS-1$ public static final String REL_BP_REQUIREMENT_BP_BUSINESSPROCESS = "rel_bp_requirement_bp_businessprocess"; //$NON-NLS-1$ public static final String REL_BP_REQUIREMENT_BP_APPLICATION = "rel_bp_requirement_bp_application"; //$NON-NLS-1$ public static final String REL_BP_REQUIREMENT_BP_ITSYSTEM = "rel_bp_requirement_bp_itsystem"; //$NON-NLS-1$ public static final String REL_BP_REQUIREMENT_BP_ICSSYSTEM = "rel_bp_requirement_bp_icssystem"; //$NON-NLS-1$ public static final String REL_BP_REQUIREMENT_BP_DEVICE = "rel_bp_requirement_bp_device"; //$NON-NLS-1$ public static final String REL_BP_REQUIREMENT_BP_NETWORK = "rel_bp_requirement_bp_network"; //$NON-NLS-1$ public static final String REL_BP_REQUIREMENT_BP_ROOM = "rel_bp_requirement_bp_room"; //$NON-NLS-1$ private final IReevaluator protectionRequirementsProvider = new Reevaluator(this); private final ILinkChangeListener linkChangeListener = new AbstractLinkChangeListener() { private static final long serialVersionUID = -3220319074711927103L; @Override public void determineValue(CascadingTransaction ta) throws TransactionAbortedException { if (!isDeductiveImplementationEnabled(BpRequirement.this) || ta.hasBeenVisited(BpRequirement.this)) { return; } for (CnALink cnALink : BpRequirement.this.getLinksUp()) { CnATreeElement dependant = cnALink.getDependant(); if (dependant instanceof Safeguard) { setImplementationStausToRequirement((Safeguard) dependant, BpRequirement.this); } } } }; protected BpRequirement() {} <<<<<<< @Override ======= >>>>>>> @Override
<<<<<<< ======= >>>>>>> <<<<<<< private final IReevaluator protectionRequirementsProvider = new Reevaluator(this); private final ILinkChangeListener linkChangeListener = new AbstractLinkChangeListener() { private static final long serialVersionUID = 9205866080876674150L; @Override public void determineValue(CascadingTransaction ta) throws TransactionAbortedException { if (ta.hasBeenVisited(Safeguard.this)) { return; } for (CnALink cnALink : Safeguard.this.getLinksUp()) { CnATreeElement dependant = cnALink.getDependant(); if (dependant instanceof BpRequirement) { setImplementationStausToRequirement(Safeguard.this, (BpRequirement) dependant); } } } }; protected Safeguard() {} @Override public ILinkChangeListener getLinkChangeListener() { return linkChangeListener; } @Override public IReevaluator getProtectionRequirementsProvider() { return protectionRequirementsProvider; } ======= protected Safeguard() { } >>>>>>> private final IReevaluator protectionRequirementsProvider = new Reevaluator(this); private final ILinkChangeListener linkChangeListener = new AbstractLinkChangeListener() { private static final long serialVersionUID = 9205866080876674150L; @Override public void determineValue(CascadingTransaction ta) throws TransactionAbortedException { if (ta.hasBeenVisited(Safeguard.this)) { return; } for (CnALink cnALink : Safeguard.this.getLinksUp()) { CnATreeElement dependant = cnALink.getDependant(); if (dependant instanceof BpRequirement) { setImplementationStausToRequirement(Safeguard.this, (BpRequirement) dependant); } } } }; protected Safeguard() {} @Override public ILinkChangeListener getLinkChangeListener() { return linkChangeListener; } @Override public IReevaluator getProtectionRequirementsProvider() { return protectionRequirementsProvider; } <<<<<<< @Override ======= >>>>>>> @Override
<<<<<<< import com.google.common.collect.ListMultimap; import com.google.common.collect.UnmodifiableIterator; import com.google.common.io.ByteStreams; ======= >>>>>>> <<<<<<< ======= private final ByteArrayOutputStream output = new ByteArrayOutputStream(); >>>>>>> <<<<<<< ======= ByteArrayOutputStream getOutput() { return output; } >>>>>>>
<<<<<<< /** The default simple receiver endpoint */ protected String simpleReceiverEndPoint = "receivers/simple"; ======= /** The default password endpoint, can change over splunk versions */ protected String passwordEndPoint = "admin/passwords"; /** The version of this splunk instance, once logged in */ public String version = null; >>>>>>> /** The default simple receiver endpoint */ protected String simpleReceiverEndPoint = "receivers/simple"; /** The default password endpoint, can change over splunk versions */ protected String passwordEndPoint = "admin/passwords"; /** The version of this splunk instance, once logged in */ public String version = null;
<<<<<<< ======= } catch (XMLStreamException e) { // Because we cannot stuff trailing information into the stream, // we expect an XMLStreamingException that contains our // corresponding end-of-document </doc> that we injected into the // front of the stream. Any other exception we rethrow. if (!(e.getMessage().contains("</doc>") || e.getMessage().contains("XML document structures must start and end within the same entity.") || e.getMessage().contains("was expecting a close tag for element <doc>"))) { throw e; } } >>>>>>> } catch (XMLStreamException e) { // Because we cannot stuff trailing information into the stream, // we expect an XMLStreamingException that contains our // corresponding end-of-document </doc> that we injected into the // front of the stream. Any other exception we rethrow. if (!(e.getMessage().contains("</doc>") || e.getMessage().contains( "XML document structures must start and end within the same entity."))) { throw e; } }
<<<<<<< /** * Provides filters for scoped prices. * * <p>Simple example:</p> * {@include.example io.sphere.sdk.products.search.ScopedPriceSearchIntegrationTest#filterByValueCentAmountAndCountry()} * * <p>Example with a discount:</p> * {@include.example io.sphere.sdk.products.search.ScopedPriceSearchIntegrationTest#discounts()} * * @return objects helping to create filters for scoped prices */ public ScopedPriceFilterSearchModel<ProductProjection> scopedPrice() { return new ScopedPriceFilterSearchModel<>(this, "scopedPrice"); } ======= public ExistsAndMissingFilterSearchModelSupport<ProductProjection> prices() { return existsAndMissingFilterSearchModelSupport("prices"); } public TermFilterSearchModel<ProductProjection, String> sku() { return stringSearchModel("sku").filtered(); } >>>>>>> /** * Provides filters for scoped prices. * * <p>Simple example:</p> * {@include.example io.sphere.sdk.products.search.ScopedPriceSearchIntegrationTest#filterByValueCentAmountAndCountry()} * * <p>Example with a discount:</p> * {@include.example io.sphere.sdk.products.search.ScopedPriceSearchIntegrationTest#discounts()} * * @return objects helping to create filters for scoped prices */ public ScopedPriceFilterSearchModel<ProductProjection> scopedPrice() { return new ScopedPriceFilterSearchModel<>(this, "scopedPrice"); } public ExistsAndMissingFilterSearchModelSupport<ProductProjection> prices() { return existsAndMissingFilterSearchModelSupport("prices"); } public TermFilterSearchModel<ProductProjection, String> sku() { return stringSearchModel("sku").filtered(); }
<<<<<<< ======= } catch (XMLStreamException e) { // Because we cannot stuff trailing information into the stream, // we expect an XMLStreamingException that contains our // corresponding end-of-document </doc> that we injected into the // front of the stream. Any other exception we rethrow. if (!(e.getMessage().contains("</doc>") || e.getMessage().contains("XML document structures must start and end within the same entity.") || e.getMessage().contains("was expecting a close tag for element <doc>"))) { throw e; } } >>>>>>>
<<<<<<< protected static String locateSystemLog() { final String filename; String osName = service.getInfo().getOsName(); if (osName.equals("Windows")) filename = "C:\\Windows\\WindowsUpdate.log"; else if (osName.equals("Linux")) filename = "/var/log/syslog"; else if (osName.equals("Darwin")) { filename = "/var/log/system.log"; } else { throw new RuntimeException("OS: " + osName + " not supported"); } return filename; } ======= protected static void assertEquals(String[] a1, String[] a2) { assertEquals(Arrays.asList(a1), Arrays.asList(a2)); } >>>>>>> protected static void assertEquals(String[] a1, String[] a2) { assertEquals(Arrays.asList(a1), Arrays.asList(a2)); } protected static String locateSystemLog() { final String filename; String osName = service.getInfo().getOsName(); if (osName.equals("Windows")) filename = "C:\\Windows\\WindowsUpdate.log"; else if (osName.equals("Linux")) filename = "/var/log/syslog"; else if (osName.equals("Darwin")) { filename = "/var/log/system.log"; } else { throw new RuntimeException("OS: " + osName + " not supported"); } return filename; }
<<<<<<< private View mChild, mHistoryView; private View mChildren[] = new View[0]; ======= private View children[]; >>>>>>> private View mChildren[] = new View[0];
<<<<<<< SinkListener sinkListener) throws ConnectionUnavailableException { ======= SinkListener sinkListener, DynamicOptions dynamicOptions) { >>>>>>> SinkListener sinkListener) { <<<<<<< SinkListener sinkListener) throws ConnectionUnavailableException { ======= SinkListener sinkListener, DynamicOptions dynamicOptions) { >>>>>>> SinkListener sinkListener) { <<<<<<< sinkListener.publish(sb.toString()); ======= sinkListener.publishEvents(sb.toString(), dynamicOptions); >>>>>>> sinkListener.publishEvents(sb.toString()); <<<<<<< sinkListener.publish(sb.toString()); ======= sinkListener.publishEvents(sb.toString(), dynamicOptions); >>>>>>> sinkListener.publishEvents(sb.toString());