Merge remote-tracking branch 'beak/next' into next
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 21 Dec 2012 06:30:45 +0000 (07:30 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 21 Dec 2012 06:30:45 +0000 (07:30 +0100)
pom.xml
src/main/java/net/pterodactylus/sone/core/Core.java
src/main/java/net/pterodactylus/sone/web/EditProfilePage.java
src/main/resources/templates/editProfile.html

diff --git a/pom.xml b/pom.xml
index 3b894ae..0e2cc60 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -7,7 +7,7 @@
                <dependency>
                        <groupId>net.pterodactylus</groupId>
                        <artifactId>utils</artifactId>
-                       <version>0.12.2</version>
+                       <version>0.12.3-SNAPSHOT</version>
                </dependency>
                <dependency>
                        <groupId>junit</groupId>
index 37c026f..5843b30 100644 (file)
@@ -59,6 +59,7 @@ import net.pterodactylus.util.config.ConfigurationException;
 import net.pterodactylus.util.logging.Logging;
 import net.pterodactylus.util.number.Numbers;
 import net.pterodactylus.util.service.AbstractService;
+import net.pterodactylus.util.thread.NamedThreadFactory;
 import net.pterodactylus.util.thread.Ticker;
 import net.pterodactylus.util.validation.EqualityValidator;
 import net.pterodactylus.util.validation.IntegerRangeValidator;
@@ -108,7 +109,7 @@ public class Core extends AbstractService implements IdentityListener, UpdateLis
        private final ImageInserter imageInserter;
 
        /** Sone downloader thread-pool. */
-       private final ExecutorService soneDownloaders = Executors.newFixedThreadPool(10);
+       private final ExecutorService soneDownloaders = Executors.newFixedThreadPool(10, new NamedThreadFactory("Sone Downloader %2$d"));
 
        /** The update checker. */
        private final UpdateChecker updateChecker;
@@ -2414,7 +2415,7 @@ public class Core extends AbstractService implements IdentityListener, UpdateLis
         */
        @Override
        public void identityUpdated(OwnIdentity ownIdentity, final Identity identity) {
-               new Thread(new Runnable() {
+               soneDownloaders.execute(new Runnable() {
 
                        @Override
                        @SuppressWarnings("synthetic-access")
@@ -2425,7 +2426,7 @@ public class Core extends AbstractService implements IdentityListener, UpdateLis
                                soneDownloader.addSone(sone);
                                soneDownloader.fetchSone(sone);
                        }
-               }).start();
+               });
        }
 
        /**
index a1b759b..51a72b8 100644 (file)
@@ -77,7 +77,7 @@ public class EditProfilePage extends SoneTemplatePage {
                                birthDay = Numbers.safeParseInteger(request.getHttpRequest().getPartAsStringFailsafe("birth-day", 256).trim());
                                birthMonth = Numbers.safeParseInteger(request.getHttpRequest().getPartAsStringFailsafe("birth-month", 256).trim());
                                birthYear = Numbers.safeParseInteger(request.getHttpRequest().getPartAsStringFailsafe("birth-year", 256).trim());
-                               avatarId = request.getHttpRequest().getPartAsStringFailsafe("avatar-id", 36);
+                               avatarId = request.getHttpRequest().getPartAsStringFailsafe("avatarId", 36);
                                profile.setFirstName(firstName.length() > 0 ? firstName : null);
                                profile.setMiddleName(middleName.length() > 0 ? middleName : null);
                                profile.setLastName(lastName.length() > 0 ? lastName : null);
@@ -139,7 +139,7 @@ public class EditProfilePage extends SoneTemplatePage {
                templateContext.set("birthDay", birthDay);
                templateContext.set("birthMonth", birthMonth);
                templateContext.set("birthYear", birthYear);
-               templateContext.set("avatar-id", avatarId);
+               templateContext.set("avatarId", avatarId);
                templateContext.set("fields", fields);
        }
 
index f0b8b56..ddc08a9 100644 (file)
 
                <ul id="avatar-selection">
                        <li id="no-avatar">
-                               <input type="radio" name="avatar-id" value="none"<%ifnull avatar-id> checked="checked"<%/if>/>
+                               <input type="radio" name="avatarId" value="none"<%ifnull avatarId> checked="checked"<%/if>/>
                                <%= Page.EditProfile.Avatar.Delete|l10n|html>
                        </li>
                        <%foreach currentSone.allImages image>
                                <li>
-                                       <input type="radio" name="avatar-id" value="<%image.id|html>"<%if avatar-id|match key=image.id> checked="checked"<%/if>/>
+                                       <input type="radio" name="avatarId" value="<%image.id|html>"<%if avatarId|match value=image.id> checked="checked"<%/if>/>
                                        <div class="post-avatar"><% image|image-link max-width==48 max-height==48 mode==enlarge title=image.title></div>
                                </li>
                        <%/foreach>