Fix expansion detail display on phones

Fix expansion detail display on phones

--- android/app/src/main/java/com/funnyhatsoftware/spacedock/activity/DetailsActivity.java
+++ android/app/src/main/java/com/funnyhatsoftware/spacedock/activity/DetailsActivity.java
@@ -5,6 +5,7 @@
 import android.support.v4.app.Fragment;

 import com.funnyhatsoftware.spacedock.fragment.DetailsFragment;
+import com.funnyhatsoftware.spacedock.holder.ExpansionHolder;

 public class DetailsActivity extends SinglePaneActivity {
     private static final String EXTRA_TYPE = "browsetype";
@@ -13,6 +14,10 @@
     public static Intent getIntent(Context context, String itemType, String itemId) {
         if (itemType == null || itemId == null) {
             throw new IllegalArgumentException();
+        }
+
+        if (itemType.equals(ExpansionHolder.TYPE_STRING)) {
+            return ExpansionDetailsActivity.getIntent(context, itemId);
         }

         Intent intent = new Intent(context, DetailsActivity.class);

<|original_code|>
package com.funnyhatsoftware.spacedock.activity;

import android.content.Context;
import android.content.Intent;
import android.support.v4.app.Fragment;

import com.funnyhatsoftware.spacedock.fragment.DetailsFragment;

public class DetailsActivity extends SinglePaneActivity {
    private static final String EXTRA_TYPE = "browsetype";
    private static final String EXTRA_ITEM = "displayitem";

    public static Intent getIntent(Context context, String itemType, String itemId) {
        if (itemType == null || itemId == null) {
            throw new IllegalArgumentException();
        }

        Intent intent = new Intent(context, DetailsActivity.class);
        intent.putExtra(EXTRA_TYPE, itemType);
        intent.putExtra(EXTRA_ITEM, itemId);
        return intent;
    }

    public Fragment getFragment() {
        String itemType = getIntent().getStringExtra(EXTRA_TYPE);
        String itemId = getIntent().getStringExtra(EXTRA_ITEM);
        return DetailsFragment.newInstance(itemType, itemId);
    }
}

<|edits_diff|>
--- android/app/src/main/java/com/funnyhatsoftware/spacedock/activity/DetailsActivity.java
+++ android/app/src/main/java/com/funnyhatsoftware/spacedock/activity/DetailsActivity.java
@@ -5,6 +5,7 @@
 import android.support.v4.app.Fragment;

 import com.funnyhatsoftware.spacedock.fragment.DetailsFragment;
+import com.funnyhatsoftware.spacedock.holder.ExpansionHolder;

 public class DetailsActivity extends SinglePaneActivity {
     private static final String EXTRA_TYPE = "browsetype";
<|current_version|>
package com.funnyhatsoftware.spacedock.activity;

import android.content.Context;
import android.content.Intent;
import android.support.v4.app.Fragment;

import com.funnyhatsoftware.spacedock.fragment.DetailsFragment;
import com.funnyhatsoftware.spacedock.holder.ExpansionHolder;

public class DetailsActivity extends SinglePaneActivity {
    private static final String EXTRA_TYPE = "browsetype";
    private static final String EXTRA_ITEM = "displayitem";

    public static Intent getIntent(Context context, String itemType, String itemId) {
        if (itemType == null || itemId == null) {
            throw new IllegalArgumentException();
        }

        Intent intent = new Intent(context, DetailsActivity.class);
        intent.putExtra(EXTRA_TYPE, itemType);
        intent.putExtra(EXTRA_ITEM, itemId);
        return intent;
    }

    public Fragment getFragment() {
        String itemType = getIntent().getStringExtra(EXTRA_TYPE);
        String itemId = getIntent().getStringExtra(EXTRA_ITEM);
        return DetailsFragment.newInstance(itemType, itemId);
    }
}

<|next_version|>
package com.funnyhatsoftware.spacedock.activity;

import android.content.Context;
import android.content.Intent;
import android.support.v4.app.Fragment;

import com.funnyhatsoftware.spacedock.fragment.DetailsFragment;
import com.funnyhatsoftware.spacedock.holder.ExpansionHolder;

public class DetailsActivity extends SinglePaneActivity {
    private static final String EXTRA_TYPE = "browsetype";
    private static final String EXTRA_ITEM = "displayitem";

    public static Intent getIntent(Context context, String itemType, String itemId) {
        if (itemType == null || itemId == null) {
            throw new IllegalArgumentException();
        }

        if (itemType.equals(ExpansionHolder.TYPE_STRING)) {
            return ExpansionDetailsActivity.getIntent(context, itemId);
        }

        Intent intent = new Intent(context, DetailsActivity.class);
        intent.putExtra(EXTRA_TYPE, itemType);
        intent.putExtra(EXTRA_ITEM, itemId);
        return intent;
    }

    public Fragment getFragment() {
        String itemType = getIntent().getStringExtra(EXTRA_TYPE);
        String itemId = getIntent().getStringExtra(EXTRA_ITEM);
        return DetailsFragment.newInstance(itemType, itemId);
    }
}


Fix tropiskellies using their spear inappropriately

Gross, tropiskellies. Gross.

--- src/main/java/net/tropicraft/core/client/entity/render/layer/TropiSkellyHeldItemLayer.java
+++ src/main/java/net/tropicraft/core/client/entity/render/layer/TropiSkellyHeldItemLayer.java
@@ -1,6 +1,7 @@
 package net.tropicraft.core.client.entity.render.layer;

 import com.mojang.blaze3d.platform.GlStateManager;
+
 import net.minecraft.client.renderer.entity.IEntityRenderer;
 import net.minecraft.client.renderer.entity.layers.HeldItemLayer;
 import net.minecraft.client.renderer.entity.model.EntityModel;
@@ -18,6 +19,7 @@

     @Override
     protected void translateToHand(HandSide handSide) {
+        super.translateToHand(handSide);
         GlStateManager.translatef(0.09375F, 0.1875F, 0.0F);
     }
 }

<|original_code|>
package net.tropicraft.core.client.entity.render.layer;

import com.mojang.blaze3d.platform.GlStateManager;
import net.minecraft.client.renderer.entity.IEntityRenderer;
import net.minecraft.client.renderer.entity.layers.HeldItemLayer;
import net.minecraft.client.renderer.entity.model.EntityModel;
import net.minecraft.client.renderer.entity.model.IHasArm;
import net.minecraft.entity.LivingEntity;
import net.minecraft.util.HandSide;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;

@OnlyIn(Dist.CLIENT)
public class TropiSkellyHeldItemLayer<T extends LivingEntity, M extends EntityModel<T> & IHasArm> extends HeldItemLayer<T, M> {
    public TropiSkellyHeldItemLayer(IEntityRenderer<T, M> renderer) {
        super(renderer);
    }

    @Override
    protected void translateToHand(HandSide handSide) {
        GlStateManager.translatef(0.09375F, 0.1875F, 0.0F);
    }
}

<|edits_diff|>
--- src/main/java/net/tropicraft/core/client/entity/render/layer/TropiSkellyHeldItemLayer.java
+++ src/main/java/net/tropicraft/core/client/entity/render/layer/TropiSkellyHeldItemLayer.java
@@ -1,6 +1,7 @@
 package net.tropicraft.core.client.entity.render.layer;

 import com.mojang.blaze3d.platform.GlStateManager;
+
 import net.minecraft.client.renderer.entity.IEntityRenderer;
 import net.minecraft.client.renderer.entity.layers.HeldItemLayer;
 import net.minecraft.client.renderer.entity.model.EntityModel;
<|current_version|>
package net.tropicraft.core.client.entity.render.layer;

import com.mojang.blaze3d.platform.GlStateManager;

import net.minecraft.client.renderer.entity.IEntityRenderer;
import net.minecraft.client.renderer.entity.layers.HeldItemLayer;
import net.minecraft.client.renderer.entity.model.EntityModel;
import net.minecraft.client.renderer.entity.model.IHasArm;
import net.minecraft.entity.LivingEntity;
import net.minecraft.util.HandSide;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;

@OnlyIn(Dist.CLIENT)
public class TropiSkellyHeldItemLayer<T extends LivingEntity, M extends EntityModel<T> & IHasArm> extends HeldItemLayer<T, M> {
    public TropiSkellyHeldItemLayer(IEntityRenderer<T, M> renderer) {
        super(renderer);
    }

    @Override
    protected void translateToHand(HandSide handSide) {
        GlStateManager.translatef(0.09375F, 0.1875F, 0.0F);
    }
}

<|next_version|>
package net.tropicraft.core.client.entity.render.layer;

import com.mojang.blaze3d.platform.GlStateManager;

import net.minecraft.client.renderer.entity.IEntityRenderer;
import net.minecraft.client.renderer.entity.layers.HeldItemLayer;
import net.minecraft.client.renderer.entity.model.EntityModel;
import net.minecraft.client.renderer.entity.model.IHasArm;
import net.minecraft.entity.LivingEntity;
import net.minecraft.util.HandSide;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;

@OnlyIn(Dist.CLIENT)
public class TropiSkellyHeldItemLayer<T extends LivingEntity, M extends EntityModel<T> & IHasArm> extends HeldItemLayer<T, M> {
    public TropiSkellyHeldItemLayer(IEntityRenderer<T, M> renderer) {
        super(renderer);
    }

    @Override
    protected void translateToHand(HandSide handSide) {
        super.translateToHand(handSide);
        GlStateManager.translatef(0.09375F, 0.1875F, 0.0F);
    }
}


Change SQLOperations to be an eager singleton

--- sql/src/main/java/io/crate/plugin/SQLModule.java
+++ sql/src/main/java/io/crate/plugin/SQLModule.java
@@ -22,6 +22,7 @@
 package io.crate.plugin;

 import io.crate.action.sql.DDLStatementDispatcher;
+import io.crate.action.sql.SQLOperations;
 import io.crate.metadata.FulltextAnalyzerResolver;
 import io.crate.protocols.postgres.PostgresNetty;
 import org.elasticsearch.common.inject.AbstractModule;
@@ -34,5 +35,6 @@
         bind(DDLStatementDispatcher.class).asEagerSingleton();
         bind(FulltextAnalyzerResolver.class).asEagerSingleton();
         bind(PostgresNetty.class).asEagerSingleton();
+        bind(SQLOperations.class).asEagerSingleton();
     }
 }

<|original_code|>
/*
 * Licensed to CRATE Technology GmbH ("Crate") under one or more contributor
 * license agreements.  See the NOTICE file distributed with this work for
 * additional information regarding copyright ownership.  Crate licenses
 * this file to you under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.  You may
 * obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
 * License for the specific language governing permissions and limitations
 * under the License.
 *
 * However, if you have executed another commercial license agreement
 * with Crate these terms will supersede the license and you may use the
 * software solely pursuant to the terms of the relevant commercial agreement.
 */

package io.crate.plugin;

import io.crate.action.sql.DDLStatementDispatcher;
import io.crate.metadata.FulltextAnalyzerResolver;
import io.crate.protocols.postgres.PostgresNetty;
import org.elasticsearch.common.inject.AbstractModule;

public class SQLModule extends AbstractModule {

    @Override
    protected void configure() {
        bind(DDLStatementDispatcher.class).asEagerSingleton();
        bind(FulltextAnalyzerResolver.class).asEagerSingleton();
        bind(PostgresNetty.class).asEagerSingleton();
    }
}

<|edits_diff|>
--- sql/src/main/java/io/crate/plugin/SQLModule.java
+++ sql/src/main/java/io/crate/plugin/SQLModule.java
@@ -22,6 +22,7 @@
 package io.crate.plugin;

 import io.crate.action.sql.DDLStatementDispatcher;
+import io.crate.action.sql.SQLOperations;
 import io.crate.metadata.FulltextAnalyzerResolver;
 import io.crate.protocols.postgres.PostgresNetty;
 import org.elasticsearch.common.inject.AbstractModule;
<|current_version|>
/*
 * Licensed to CRATE Technology GmbH ("Crate") under one or more contributor
 * license agreements.  See the NOTICE file distributed with this work for
 * additional information regarding copyright ownership.  Crate licenses
 * this file to you under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.  You may
 * obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
 * License for the specific language governing permissions and limitations
 * under the License.
 *
 * However, if you have executed another commercial license agreement
 * with Crate these terms will supersede the license and you may use the
 * software solely pursuant to the terms of the relevant commercial agreement.
 */

package io.crate.plugin;

import io.crate.action.sql.DDLStatementDispatcher;
import io.crate.action.sql.SQLOperations;
import io.crate.metadata.FulltextAnalyzerResolver;
import io.crate.protocols.postgres.PostgresNetty;
import org.elasticsearch.common.inject.AbstractModule;

public class SQLModule extends AbstractModule {

    @Override
    protected void configure() {
        bind(DDLStatementDispatcher.class).asEagerSingleton();
        bind(FulltextAnalyzerResolver.class).asEagerSingleton();
        bind(PostgresNetty.class).asEagerSingleton();
    }
}

<|next_version|>
/*
 * Licensed to CRATE Technology GmbH ("Crate") under one or more contributor
 * license agreements.  See the NOTICE file distributed with this work for
 * additional information regarding copyright ownership.  Crate licenses
 * this file to you under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.  You may
 * obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
 * License for the specific language governing permissions and limitations
 * under the License.
 *
 * However, if you have executed another commercial license agreement
 * with Crate these terms will supersede the license and you may use the
 * software solely pursuant to the terms of the relevant commercial agreement.
 */

package io.crate.plugin;

import io.crate.action.sql.DDLStatementDispatcher;
import io.crate.action.sql.SQLOperations;
import io.crate.metadata.FulltextAnalyzerResolver;
import io.crate.protocols.postgres.PostgresNetty;
import org.elasticsearch.common.inject.AbstractModule;

public class SQLModule extends AbstractModule {

    @Override
    protected void configure() {
        bind(DDLStatementDispatcher.class).asEagerSingleton();
        bind(FulltextAnalyzerResolver.class).asEagerSingleton();
        bind(PostgresNetty.class).asEagerSingleton();
        bind(SQLOperations.class).asEagerSingleton();
    }
}


Remove border from dialpad-button to hide the button style on ubuntu

--- src/net/java/sip/communicator/impl/gui/main/DialPadButton.java
+++ src/net/java/sip/communicator/impl/gui/main/DialPadButton.java
@@ -8,6 +8,8 @@

 import java.awt.*;
 import java.awt.event.*;
+
+import javax.swing.BorderFactory;

 import net.java.sip.communicator.impl.gui.utils.*;
 import net.java.sip.communicator.util.swing.*;
@@ -33,6 +35,7 @@
         super("");

         loadSkin();
+        setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));

         addActionListener(new ActionListener()
         {

<|original_code|>
/*
 * Jitsi, the OpenSource Java VoIP and Instant Messaging client.
 *
 * Distributable under LGPL license.
 * See terms of license at gnu.org.
 */
package net.java.sip.communicator.impl.gui.main;

import java.awt.*;
import java.awt.event.*;

import net.java.sip.communicator.impl.gui.utils.*;
import net.java.sip.communicator.util.swing.*;

/**
 * The dial pad button in the contact list.
 *
 * @author Yana Stamcheva
 */
public class DialPadButton
    extends SIPCommTextButton
{
    /**
     * The dial pad dialog that this button opens.
     */
    GeneralDialPadDialog dialPad;

    /**
     * Creates an instance of <tt>DialPadButton</tt>.
     */
    public DialPadButton()
    {
        super("");

        loadSkin();

        addActionListener(new ActionListener()
        {
            public void actionPerformed(ActionEvent e)
            {
                if (dialPad == null)
                    dialPad = new GeneralDialPadDialog();

                dialPad.clear();
                dialPad.setVisible(true);
            }
        });
    }

    /**
     * Loads images and sets history view.
     */
    public void loadSkin()
    {
        Image image = ImageLoader.getImage(ImageLoader.CONTACT_LIST_DIAL_BUTTON);

        setBgImage(image);

        this.setPreferredSize(new Dimension(image.getWidth(this),
                                            image.getHeight(this)));
    }
}

<|edits_diff|>
--- src/net/java/sip/communicator/impl/gui/main/DialPadButton.java
+++ src/net/java/sip/communicator/impl/gui/main/DialPadButton.java
@@ -8,6 +8,8 @@

 import java.awt.*;
 import java.awt.event.*;
+
+import javax.swing.BorderFactory;

 import net.java.sip.communicator.impl.gui.utils.*;
 import net.java.sip.communicator.util.swing.*;
<|current_version|>
/*
 * Jitsi, the OpenSource Java VoIP and Instant Messaging client.
 *
 * Distributable under LGPL license.
 * See terms of license at gnu.org.
 */
package net.java.sip.communicator.impl.gui.main;

import java.awt.*;
import java.awt.event.*;

import javax.swing.BorderFactory;

import net.java.sip.communicator.impl.gui.utils.*;
import net.java.sip.communicator.util.swing.*;

/**
 * The dial pad button in the contact list.
 *
 * @author Yana Stamcheva
 */
public class DialPadButton
    extends SIPCommTextButton
{
    /**
     * The dial pad dialog that this button opens.
     */
    GeneralDialPadDialog dialPad;

    /**
     * Creates an instance of <tt>DialPadButton</tt>.
     */
    public DialPadButton()
    {
        super("");

        loadSkin();

        addActionListener(new ActionListener()
        {
            public void actionPerformed(ActionEvent e)
            {
                if (dialPad == null)
                    dialPad = new GeneralDialPadDialog();

                dialPad.clear();
                dialPad.setVisible(true);
            }
        });
    }

    /**
     * Loads images and sets history view.
     */
    public void loadSkin()
    {
        Image image = ImageLoader.getImage(ImageLoader.CONTACT_LIST_DIAL_BUTTON);

        setBgImage(image);

        this.setPreferredSize(new Dimension(image.getWidth(this),
                                            image.getHeight(this)));
    }
}

<|next_version|>
/*
 * Jitsi, the OpenSource Java VoIP and Instant Messaging client.
 *
 * Distributable under LGPL license.
 * See terms of license at gnu.org.
 */
package net.java.sip.communicator.impl.gui.main;

import java.awt.*;
import java.awt.event.*;

import javax.swing.BorderFactory;

import net.java.sip.communicator.impl.gui.utils.*;
import net.java.sip.communicator.util.swing.*;

/**
 * The dial pad button in the contact list.
 *
 * @author Yana Stamcheva
 */
public class DialPadButton
    extends SIPCommTextButton
{
    /**
     * The dial pad dialog that this button opens.
     */
    GeneralDialPadDialog dialPad;

    /**
     * Creates an instance of <tt>DialPadButton</tt>.
     */
    public DialPadButton()
    {
        super("");

        loadSkin();
        setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));

        addActionListener(new ActionListener()
        {
            public void actionPerformed(ActionEvent e)
            {
                if (dialPad == null)
                    dialPad = new GeneralDialPadDialog();

                dialPad.clear();
                dialPad.setVisible(true);
            }
        });
    }

    /**
     * Loads images and sets history view.
     */
    public void loadSkin()
    {
        Image image = ImageLoader.getImage(ImageLoader.CONTACT_LIST_DIAL_BUTTON);

        setBgImage(image);

        this.setPreferredSize(new Dimension(image.getWidth(this),
                                            image.getHeight(this)));
    }
}


Allow Timber output from tests

Allow Timber output from tests

--- gnd/src/androidTest/java/com/google/android/gnd/CustomTestRunner.java
+++ gnd/src/androidTest/java/com/google/android/gnd/CustomTestRunner.java
@@ -20,6 +20,8 @@
 import android.content.Context;
 import androidx.test.runner.AndroidJUnitRunner;
 import dagger.hilt.android.testing.HiltTestApplication;
+import timber.log.Timber;
+import timber.log.Timber.DebugTree;

 public class CustomTestRunner extends AndroidJUnitRunner {

@@ -27,6 +29,8 @@
   public Application newApplication(ClassLoader cl, String className,
     Context context)
     throws ClassNotFoundException, IllegalAccessException, InstantiationException {
+
+    Timber.plant(new DebugTree());
     return super.newApplication(cl, HiltTestApplication.class.getName(), context);
   }
 }

<|original_code|>
/*
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.google.android.gnd;

import android.app.Application;
import android.content.Context;
import androidx.test.runner.AndroidJUnitRunner;
import dagger.hilt.android.testing.HiltTestApplication;

public class CustomTestRunner extends AndroidJUnitRunner {

  @Override
  public Application newApplication(ClassLoader cl, String className,
    Context context)
    throws ClassNotFoundException, IllegalAccessException, InstantiationException {
    return super.newApplication(cl, HiltTestApplication.class.getName(), context);
  }
}
<|edits_diff|>
--- gnd/src/androidTest/java/com/google/android/gnd/CustomTestRunner.java
+++ gnd/src/androidTest/java/com/google/android/gnd/CustomTestRunner.java
@@ -20,6 +20,8 @@
 import android.content.Context;
 import androidx.test.runner.AndroidJUnitRunner;
 import dagger.hilt.android.testing.HiltTestApplication;
+import timber.log.Timber;
+import timber.log.Timber.DebugTree;

 public class CustomTestRunner extends AndroidJUnitRunner {

<|current_version|>
/*
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.google.android.gnd;

import android.app.Application;
import android.content.Context;
import androidx.test.runner.AndroidJUnitRunner;
import dagger.hilt.android.testing.HiltTestApplication;
import timber.log.Timber;
import timber.log.Timber.DebugTree;

public class CustomTestRunner extends AndroidJUnitRunner {

  @Override
  public Application newApplication(ClassLoader cl, String className,
    Context context)
    throws ClassNotFoundException, IllegalAccessException, InstantiationException {
    return super.newApplication(cl, HiltTestApplication.class.getName(), context);
  }
}
<|next_version|>
/*
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.google.android.gnd;

import android.app.Application;
import android.content.Context;
import androidx.test.runner.AndroidJUnitRunner;
import dagger.hilt.android.testing.HiltTestApplication;
import timber.log.Timber;
import timber.log.Timber.DebugTree;

public class CustomTestRunner extends AndroidJUnitRunner {

  @Override
  public Application newApplication(ClassLoader cl, String className,
    Context context)
    throws ClassNotFoundException, IllegalAccessException, InstantiationException {

    Timber.plant(new DebugTree());
    return super.newApplication(cl, HiltTestApplication.class.getName(), context);
  }
}


Fix loading of posts (lob) (again)

Fix loading of posts (lob) (again)

--- src/main/java/eu/euregjug/site/events/RegistrationRepository.java
+++ src/main/java/eu/euregjug/site/events/RegistrationRepository.java
@@ -18,6 +18,7 @@
 import java.util.List;
 import java.util.Optional;
 import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.transaction.annotation.Transactional;

 /**
  * @author Michael J. Simons, 2015-12-26
@@ -31,5 +32,6 @@
      */
     public Optional<RegistrationEntity> findByEventAndEmail(final EventEntity event, final String email);

+    @Transactional(readOnly = true)
     public List<RegistrationEntity> findAllByEventId(Integer eventId);
 }

<|original_code|>
/*
 * Copyright 2015 EuregJUG.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package eu.euregjug.site.events;

import java.util.List;
import java.util.Optional;
import org.springframework.data.jpa.repository.JpaRepository;

/**
 * @author Michael J. Simons, 2015-12-26
 */
public interface RegistrationRepository extends JpaRepository<RegistrationEntity, Integer> {

    /**
     * @param event
     * @param email
     * @return A registration for a given event by a user.
     */
    public Optional<RegistrationEntity> findByEventAndEmail(final EventEntity event, final String email);

    public List<RegistrationEntity> findAllByEventId(Integer eventId);
}

<|edits_diff|>
--- src/main/java/eu/euregjug/site/events/RegistrationRepository.java
+++ src/main/java/eu/euregjug/site/events/RegistrationRepository.java
@@ -18,6 +18,7 @@
 import java.util.List;
 import java.util.Optional;
 import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.transaction.annotation.Transactional;

 /**
  * @author Michael J. Simons, 2015-12-26
<|current_version|>
/*
 * Copyright 2015 EuregJUG.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package eu.euregjug.site.events;

import java.util.List;
import java.util.Optional;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author Michael J. Simons, 2015-12-26
 */
public interface RegistrationRepository extends JpaRepository<RegistrationEntity, Integer> {

    /**
     * @param event
     * @param email
     * @return A registration for a given event by a user.
     */
    public Optional<RegistrationEntity> findByEventAndEmail(final EventEntity event, final String email);

    public List<RegistrationEntity> findAllByEventId(Integer eventId);
}

<|next_version|>
/*
 * Copyright 2015 EuregJUG.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package eu.euregjug.site.events;

import java.util.List;
import java.util.Optional;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author Michael J. Simons, 2015-12-26
 */
public interface RegistrationRepository extends JpaRepository<RegistrationEntity, Integer> {

    /**
     * @param event
     * @param email
     * @return A registration for a given event by a user.
     */
    public Optional<RegistrationEntity> findByEventAndEmail(final EventEntity event, final String email);

    @Transactional(readOnly = true)
    public List<RegistrationEntity> findAllByEventId(Integer eventId);
}


Use medieval font to the outcome text

Use medieval font to the outcome text

--- KnightsOfAlentejoAndroid-AS/app/src/main/java/br/odb/menu/ShowOutcomeActivity.java
+++ KnightsOfAlentejoAndroid-AS/app/src/main/java/br/odb/menu/ShowOutcomeActivity.java
@@ -1,6 +1,7 @@
 package br.odb.menu;

 import android.app.Activity;
+import android.graphics.Typeface;
 import android.os.Bundle;
 import android.widget.TextView;

@@ -16,5 +17,7 @@
         boolean outcomeIsGood = KnightsOfAlentejoSplashActivity.GameOutcome.valueOf( getIntent().getStringExtra( KnightsOfAlentejoSplashActivity.MAPKEY_SUCCESSFUL_LEVEL_OUTCOME) ) == KnightsOfAlentejoSplashActivity.GameOutcome.VICTORY;
         ((TextView) findViewById(R.id.tvOutcome)).setText( getString( outcomeIsGood ? R.string.outcome_good : R.string.outcome_bad ) );
         ((TextView) findViewById(R.id.tvOutcome)).setTextColor(outcomeIsGood ? 0xFF00FF00 : 0xFFFF0000);
+        Typeface font = Typeface.createFromAsset(getAssets(), "fonts/MedievalSharp.ttf");
+        ( (TextView)findViewById(R.id.tvOutcome) ).setTypeface( font );
     }
 }

<|original_code|>
package br.odb.menu;

import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;

import br.odb.knights.R;

public class ShowOutcomeActivity extends Activity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.outcome_layout);

        boolean outcomeIsGood = KnightsOfAlentejoSplashActivity.GameOutcome.valueOf( getIntent().getStringExtra( KnightsOfAlentejoSplashActivity.MAPKEY_SUCCESSFUL_LEVEL_OUTCOME) ) == KnightsOfAlentejoSplashActivity.GameOutcome.VICTORY;
        ((TextView) findViewById(R.id.tvOutcome)).setText( getString( outcomeIsGood ? R.string.outcome_good : R.string.outcome_bad ) );
        ((TextView) findViewById(R.id.tvOutcome)).setTextColor(outcomeIsGood ? 0xFF00FF00 : 0xFFFF0000);
    }
}
<|edits_diff|>
--- KnightsOfAlentejoAndroid-AS/app/src/main/java/br/odb/menu/ShowOutcomeActivity.java
+++ KnightsOfAlentejoAndroid-AS/app/src/main/java/br/odb/menu/ShowOutcomeActivity.java
@@ -1,6 +1,7 @@
 package br.odb.menu;

 import android.app.Activity;
+import android.graphics.Typeface;
 import android.os.Bundle;
 import android.widget.TextView;

<|current_version|>
package br.odb.menu;

import android.app.Activity;
import android.graphics.Typeface;
import android.os.Bundle;
import android.widget.TextView;

import br.odb.knights.R;

public class ShowOutcomeActivity extends Activity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.outcome_layout);

        boolean outcomeIsGood = KnightsOfAlentejoSplashActivity.GameOutcome.valueOf( getIntent().getStringExtra( KnightsOfAlentejoSplashActivity.MAPKEY_SUCCESSFUL_LEVEL_OUTCOME) ) == KnightsOfAlentejoSplashActivity.GameOutcome.VICTORY;
        ((TextView) findViewById(R.id.tvOutcome)).setText( getString( outcomeIsGood ? R.string.outcome_good : R.string.outcome_bad ) );
        ((TextView) findViewById(R.id.tvOutcome)).setTextColor(outcomeIsGood ? 0xFF00FF00 : 0xFFFF0000);
    }
}
<|next_version|>
package br.odb.menu;

import android.app.Activity;
import android.graphics.Typeface;
import android.os.Bundle;
import android.widget.TextView;

import br.odb.knights.R;

public class ShowOutcomeActivity extends Activity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.outcome_layout);

        boolean outcomeIsGood = KnightsOfAlentejoSplashActivity.GameOutcome.valueOf( getIntent().getStringExtra( KnightsOfAlentejoSplashActivity.MAPKEY_SUCCESSFUL_LEVEL_OUTCOME) ) == KnightsOfAlentejoSplashActivity.GameOutcome.VICTORY;
        ((TextView) findViewById(R.id.tvOutcome)).setText( getString( outcomeIsGood ? R.string.outcome_good : R.string.outcome_bad ) );
        ((TextView) findViewById(R.id.tvOutcome)).setTextColor(outcomeIsGood ? 0xFF00FF00 : 0xFFFF0000);
        Typeface font = Typeface.createFromAsset(getAssets(), "fonts/MedievalSharp.ttf");
        ( (TextView)findViewById(R.id.tvOutcome) ).setTypeface( font );
    }
}


Add @ComponentScan to discover GraphQLController

--- src/main/java/com/github/timtebeek/graphql/jpa/GraphqlJpaAutoConfiguration.java
+++ src/main/java/com/github/timtebeek/graphql/jpa/GraphqlJpaAutoConfiguration.java
@@ -5,9 +5,11 @@
 import org.crygier.graphql.GraphQLExecutor;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
 import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.ComponentScan;
 import org.springframework.context.annotation.Configuration;

 @Configuration
+@ComponentScan
 @SuppressWarnings("static-method")
 public class GraphqlJpaAutoConfiguration {
 	@Bean

<|original_code|>
package com.github.timtebeek.graphql.jpa;

import javax.persistence.EntityManager;

import org.crygier.graphql.GraphQLExecutor;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@SuppressWarnings("static-method")
public class GraphqlJpaAutoConfiguration {
	@Bean
	@ConditionalOnMissingBean(GraphQLExecutor.class)
	public GraphQLExecutor graphQLExecutor(final EntityManager entityManager) {
		return new GraphQLExecutor(entityManager);
	}
}

<|edits_diff|>
--- src/main/java/com/github/timtebeek/graphql/jpa/GraphqlJpaAutoConfiguration.java
+++ src/main/java/com/github/timtebeek/graphql/jpa/GraphqlJpaAutoConfiguration.java
@@ -5,6 +5,7 @@
 import org.crygier.graphql.GraphQLExecutor;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
 import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.ComponentScan;
 import org.springframework.context.annotation.Configuration;

 @Configuration
<|current_version|>
package com.github.timtebeek.graphql.jpa;

import javax.persistence.EntityManager;

import org.crygier.graphql.GraphQLExecutor;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

@Configuration
@SuppressWarnings("static-method")
public class GraphqlJpaAutoConfiguration {
	@Bean
	@ConditionalOnMissingBean(GraphQLExecutor.class)
	public GraphQLExecutor graphQLExecutor(final EntityManager entityManager) {
		return new GraphQLExecutor(entityManager);
	}
}

<|next_version|>
package com.github.timtebeek.graphql.jpa;

import javax.persistence.EntityManager;

import org.crygier.graphql.GraphQLExecutor;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

@Configuration
@ComponentScan
@SuppressWarnings("static-method")
public class GraphqlJpaAutoConfiguration {
	@Bean
	@ConditionalOnMissingBean(GraphQLExecutor.class)
	public GraphQLExecutor graphQLExecutor(final EntityManager entityManager) {
		return new GraphQLExecutor(entityManager);
	}
}


Make items and armor repairable

Make items and armor repairable

--- src/main/java/net/unladenswallow/minecraft/emeraldmaterial/EmeraldMaterials.java
+++ src/main/java/net/unladenswallow/minecraft/emeraldmaterial/EmeraldMaterials.java
@@ -1,6 +1,8 @@
 package net.unladenswallow.minecraft.emeraldmaterial;

+import net.minecraft.init.Items;
 import net.minecraft.item.Item.ToolMaterial;
+import net.minecraft.item.ItemStack;
 import net.minecraftforge.common.util.EnumHelper;

 public class EmeraldMaterials {
@@ -22,5 +24,9 @@
 			4.0f,
 			30
 			);
+	static {
+		toolMaterial.setRepairItem(new ItemStack(Items.emerald));
+		broadswordMaterial.setRepairItem(new ItemStack(Items.emerald));
+	}

 }

<|original_code|>
package net.unladenswallow.minecraft.emeraldmaterial;

import net.minecraft.item.Item.ToolMaterial;
import net.minecraftforge.common.util.EnumHelper;

public class EmeraldMaterials {

	public static ToolMaterial toolMaterial = EnumHelper.addToolMaterial(
			"EmeraldTool",
			3,
			1000,
			10.0f,
			2.5f,
			30
			);

	public static ToolMaterial broadswordMaterial = EnumHelper.addToolMaterial(
			"EmeraldWeapon",
			0,
			1000,
			10.0f,
			4.0f,
			30
			);

}

<|edits_diff|>
--- src/main/java/net/unladenswallow/minecraft/emeraldmaterial/EmeraldMaterials.java
+++ src/main/java/net/unladenswallow/minecraft/emeraldmaterial/EmeraldMaterials.java
@@ -1,6 +1,8 @@
 package net.unladenswallow.minecraft.emeraldmaterial;

+import net.minecraft.init.Items;
 import net.minecraft.item.Item.ToolMaterial;
+import net.minecraft.item.ItemStack;
 import net.minecraftforge.common.util.EnumHelper;

 public class EmeraldMaterials {
<|current_version|>
package net.unladenswallow.minecraft.emeraldmaterial;

import net.minecraft.init.Items;
import net.minecraft.item.Item.ToolMaterial;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.util.EnumHelper;

public class EmeraldMaterials {

	public static ToolMaterial toolMaterial = EnumHelper.addToolMaterial(
			"EmeraldTool",
			3,
			1000,
			10.0f,
			2.5f,
			30
			);

	public static ToolMaterial broadswordMaterial = EnumHelper.addToolMaterial(
			"EmeraldWeapon",
			0,
			1000,
			10.0f,
			4.0f,
			30
			);

}

<|next_version|>
package net.unladenswallow.minecraft.emeraldmaterial;

import net.minecraft.init.Items;
import net.minecraft.item.Item.ToolMaterial;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.util.EnumHelper;

public class EmeraldMaterials {

	public static ToolMaterial toolMaterial = EnumHelper.addToolMaterial(
			"EmeraldTool",
			3,
			1000,
			10.0f,
			2.5f,
			30
			);

	public static ToolMaterial broadswordMaterial = EnumHelper.addToolMaterial(
			"EmeraldWeapon",
			0,
			1000,
			10.0f,
			4.0f,
			30
			);
	static {
		toolMaterial.setRepairItem(new ItemStack(Items.emerald));
		broadswordMaterial.setRepairItem(new ItemStack(Items.emerald));
	}

}


connection-settings: Add support for macro replacement in file parsing

Macro replacement is limited to system properties and environment
variables. See https://maven.apache.org/settings.html

Signed-off-by: BJ Hargrave <3d26bb3930946e3370762d769a073cece444c2d8@bjhargrave.com>

--- biz.aQute.bndlib/src/aQute/bnd/connection/settings/SettingsParser.java
+++ biz.aQute.bndlib/src/aQute/bnd/connection/settings/SettingsParser.java
@@ -2,10 +2,13 @@

 import java.io.File;

+import aQute.bnd.osgi.Macro;
+import aQute.bnd.osgi.Processor;
 import aQute.lib.xpath.XPathParser;

 public class SettingsParser extends XPathParser {
 	final SettingsDTO settings = new SettingsDTO();
+	private final Macro	replacer	= new Processor().getReplacer();

 	/*
 	 * <proxies> <proxy> <id>example-proxy</id> <active>true</active>
@@ -26,4 +29,9 @@
 	public SettingsDTO getSettings() {
 		return settings;
 	}
+
+	@Override
+	protected String processValue(String value) {
+		return replacer.process(value);
+	}
 }

<|original_code|>
package aQute.bnd.connection.settings;

import java.io.File;

import aQute.lib.xpath.XPathParser;

public class SettingsParser extends XPathParser {
	final SettingsDTO settings = new SettingsDTO();

	/*
	 * <proxies> <proxy> <id>example-proxy</id> <active>true</active>
	 * <protocol>http</protocol> <host>proxy.example.com</host>
	 * <port>8080</port> <username>proxyuser</username>
	 * <password>somepassword</password>
	 * <nonProxyHosts>www.google.com|*.example.com</nonProxyHosts> </proxy>
	 * </proxies>
	 */

	public SettingsParser(File file) throws Exception {
		super(file);

		parse("/settings/proxies/proxy", ProxyDTO.class, settings.proxies);
		parse("/settings/servers/server", ServerDTO.class, settings.servers);
	}

	public SettingsDTO getSettings() {
		return settings;
	}
}

<|edits_diff|>
--- biz.aQute.bndlib/src/aQute/bnd/connection/settings/SettingsParser.java
+++ biz.aQute.bndlib/src/aQute/bnd/connection/settings/SettingsParser.java
@@ -2,10 +2,13 @@

 import java.io.File;

+import aQute.bnd.osgi.Macro;
+import aQute.bnd.osgi.Processor;
 import aQute.lib.xpath.XPathParser;

 public class SettingsParser extends XPathParser {
 	final SettingsDTO settings = new SettingsDTO();
+	private final Macro	replacer	= new Processor().getReplacer();

 	/*
 	 * <proxies> <proxy> <id>example-proxy</id> <active>true</active>
<|current_version|>
package aQute.bnd.connection.settings;

import java.io.File;

import aQute.bnd.osgi.Macro;
import aQute.bnd.osgi.Processor;
import aQute.lib.xpath.XPathParser;

public class SettingsParser extends XPathParser {
	final SettingsDTO settings = new SettingsDTO();
	private final Macro	replacer	= new Processor().getReplacer();

	/*
	 * <proxies> <proxy> <id>example-proxy</id> <active>true</active>
	 * <protocol>http</protocol> <host>proxy.example.com</host>
	 * <port>8080</port> <username>proxyuser</username>
	 * <password>somepassword</password>
	 * <nonProxyHosts>www.google.com|*.example.com</nonProxyHosts> </proxy>
	 * </proxies>
	 */

	public SettingsParser(File file) throws Exception {
		super(file);

		parse("/settings/proxies/proxy", ProxyDTO.class, settings.proxies);
		parse("/settings/servers/server", ServerDTO.class, settings.servers);
	}

	public SettingsDTO getSettings() {
		return settings;
	}
}

<|next_version|>
package aQute.bnd.connection.settings;

import java.io.File;

import aQute.bnd.osgi.Macro;
import aQute.bnd.osgi.Processor;
import aQute.lib.xpath.XPathParser;

public class SettingsParser extends XPathParser {
	final SettingsDTO settings = new SettingsDTO();
	private final Macro	replacer	= new Processor().getReplacer();

	/*
	 * <proxies> <proxy> <id>example-proxy</id> <active>true</active>
	 * <protocol>http</protocol> <host>proxy.example.com</host>
	 * <port>8080</port> <username>proxyuser</username>
	 * <password>somepassword</password>
	 * <nonProxyHosts>www.google.com|*.example.com</nonProxyHosts> </proxy>
	 * </proxies>
	 */

	public SettingsParser(File file) throws Exception {
		super(file);

		parse("/settings/proxies/proxy", ProxyDTO.class, settings.proxies);
		parse("/settings/servers/server", ServerDTO.class, settings.servers);
	}

	public SettingsDTO getSettings() {
		return settings;
	}

	@Override
	protected String processValue(String value) {
		return replacer.process(value);
	}
}


Add method to find a place

Add method to find a place

--- app/src/main/java/br/com/nossolixo/nossolixo/services/PlaceService.java
+++ app/src/main/java/br/com/nossolixo/nossolixo/services/PlaceService.java
@@ -5,6 +5,7 @@
 import br.com.nossolixo.nossolixo.models.Place;
 import retrofit2.Call;
 import retrofit2.http.GET;
+import retrofit2.http.Path;
 import retrofit2.http.Query;

 public interface PlaceService {
@@ -13,4 +14,7 @@

     @GET("places")
     Call<List<Place>> listPlacesByCategory(@Query("category") String category);
+
+    @GET("place/{id}")
+    Call<Place> find(@Path("id") String placeId);
 }

<|original_code|>
package br.com.nossolixo.nossolixo.services;

import java.util.List;

import br.com.nossolixo.nossolixo.models.Place;
import retrofit2.Call;
import retrofit2.http.GET;
import retrofit2.http.Query;

public interface PlaceService {
    @GET("places")
    Call<List<Place>> listPlaces();

    @GET("places")
    Call<List<Place>> listPlacesByCategory(@Query("category") String category);
}

<|edits_diff|>
--- app/src/main/java/br/com/nossolixo/nossolixo/services/PlaceService.java
+++ app/src/main/java/br/com/nossolixo/nossolixo/services/PlaceService.java
@@ -5,6 +5,7 @@
 import br.com.nossolixo.nossolixo.models.Place;
 import retrofit2.Call;
 import retrofit2.http.GET;
+import retrofit2.http.Path;
 import retrofit2.http.Query;

 public interface PlaceService {
<|current_version|>
package br.com.nossolixo.nossolixo.services;

import java.util.List;

import br.com.nossolixo.nossolixo.models.Place;
import retrofit2.Call;
import retrofit2.http.GET;
import retrofit2.http.Path;
import retrofit2.http.Query;

public interface PlaceService {
    @GET("places")
    Call<List<Place>> listPlaces();

    @GET("places")
    Call<List<Place>> listPlacesByCategory(@Query("category") String category);
}

<|next_version|>
package br.com.nossolixo.nossolixo.services;

import java.util.List;

import br.com.nossolixo.nossolixo.models.Place;
import retrofit2.Call;
import retrofit2.http.GET;
import retrofit2.http.Path;
import retrofit2.http.Query;

public interface PlaceService {
    @GET("places")
    Call<List<Place>> listPlaces();

    @GET("places")
    Call<List<Place>> listPlacesByCategory(@Query("category") String category);

    @GET("place/{id}")
    Call<Place> find(@Path("id") String placeId);
}


Exclude the test for WELD-1086 temporarily

--- tests-arquillian/src/test/java/org/jboss/weld/tests/ejb/EJBCallTest.java
+++ tests-arquillian/src/test/java/org/jboss/weld/tests/ejb/EJBCallTest.java
@@ -10,6 +10,7 @@
 import org.jboss.shrinkwrap.api.asset.EmptyAsset;
 import org.jboss.shrinkwrap.api.spec.JavaArchive;
 import org.junit.Assert;
+import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.runner.RunWith;

@@ -33,6 +34,7 @@
 	SomeService someService;

 	@Test
+	@Ignore("WELD-1086")
 	public void testStatelessCall() {
 		Assert.assertEquals("test", someService.someMethod());
 	}

<|original_code|>
package org.jboss.weld.tests.ejb;

import javax.ejb.Stateless;
import javax.inject.Inject;

import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.shrinkwrap.api.ArchivePaths;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.asset.EmptyAsset;
import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;

@RunWith(Arquillian.class)
public class EJBCallTest {
	@Deployment
	public static JavaArchive createTestArchive() {
		return ShrinkWrap
				.create(JavaArchive.class, "test.jar")
				.addAsManifestResource(EmptyAsset.INSTANCE, ArchivePaths.create("beans.xml"));
	}

	@Stateless
	public static class SomeService {
		public String someMethod() {
			return "test";
		}
	}

	@Inject
	SomeService someService;

	@Test
	public void testStatelessCall() {
		Assert.assertEquals("test", someService.someMethod());
	}
}

<|edits_diff|>
--- tests-arquillian/src/test/java/org/jboss/weld/tests/ejb/EJBCallTest.java
+++ tests-arquillian/src/test/java/org/jboss/weld/tests/ejb/EJBCallTest.java
@@ -10,6 +10,7 @@
 import org.jboss.shrinkwrap.api.asset.EmptyAsset;
 import org.jboss.shrinkwrap.api.spec.JavaArchive;
 import org.junit.Assert;
+import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.runner.RunWith;

<|current_version|>
package org.jboss.weld.tests.ejb;

import javax.ejb.Stateless;
import javax.inject.Inject;

import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.shrinkwrap.api.ArchivePaths;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.asset.EmptyAsset;
import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;

@RunWith(Arquillian.class)
public class EJBCallTest {
	@Deployment
	public static JavaArchive createTestArchive() {
		return ShrinkWrap
				.create(JavaArchive.class, "test.jar")
				.addAsManifestResource(EmptyAsset.INSTANCE, ArchivePaths.create("beans.xml"));
	}

	@Stateless
	public static class SomeService {
		public String someMethod() {
			return "test";
		}
	}

	@Inject
	SomeService someService;

	@Test
	public void testStatelessCall() {
		Assert.assertEquals("test", someService.someMethod());
	}
}

<|next_version|>
package org.jboss.weld.tests.ejb;

import javax.ejb.Stateless;
import javax.inject.Inject;

import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.shrinkwrap.api.ArchivePaths;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.asset.EmptyAsset;
import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;

@RunWith(Arquillian.class)
public class EJBCallTest {
	@Deployment
	public static JavaArchive createTestArchive() {
		return ShrinkWrap
				.create(JavaArchive.class, "test.jar")
				.addAsManifestResource(EmptyAsset.INSTANCE, ArchivePaths.create("beans.xml"));
	}

	@Stateless
	public static class SomeService {
		public String someMethod() {
			return "test";
		}
	}

	@Inject
	SomeService someService;

	@Test
	@Ignore("WELD-1086")
	public void testStatelessCall() {
		Assert.assertEquals("test", someService.someMethod());
	}
}


Add javadoc to DraggablePanel application class

--- sample/src/main/java/com/github/pedrovgs/sample/DraggablePanelApplication.java
+++ sample/src/main/java/com/github/pedrovgs/sample/DraggablePanelApplication.java
@@ -20,12 +20,18 @@
 import dagger.ObjectGraph;

 /**
+ * Application implementation created to handle the dependency container implementation provided by the ObjectGraph
+ * entity.
+ *
  * @author Pedro Vicente Gómez Sánchez.
  */
 public class DraggablePanelApplication extends Application {

     private ObjectGraph objectGraph;

+    /**
+     * Override method used to initialize the dependency container graph with the MainModule.
+     */
     @Override
     public void onCreate() {
         super.onCreate();
@@ -35,6 +41,11 @@
         objectGraph.injectStatics();
     }

+    /**
+     * Inject an object to provide all the needed dependencies.
+     *
+     * @param object
+     */
     public void inject(Object object) {
         objectGraph.inject(object);
     }

<|original_code|>
/*
 * Copyright (C) 2014 Pedro Vicente Gómez Sánchez.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.github.pedrovgs.sample;

import android.app.Application;
import com.github.pedrovgs.sample.di.MainModule;
import dagger.ObjectGraph;

/**
 * @author Pedro Vicente Gómez Sánchez.
 */
public class DraggablePanelApplication extends Application {

    private ObjectGraph objectGraph;

    @Override
    public void onCreate() {
        super.onCreate();
        MainModule mainModule = new MainModule(this);
        objectGraph = ObjectGraph.create(mainModule);
        objectGraph.inject(this);
        objectGraph.injectStatics();
    }

    public void inject(Object object) {
        objectGraph.inject(object);
    }
}

<|edits_diff|>
--- sample/src/main/java/com/github/pedrovgs/sample/DraggablePanelApplication.java
+++ sample/src/main/java/com/github/pedrovgs/sample/DraggablePanelApplication.java
@@ -20,12 +20,18 @@
 import dagger.ObjectGraph;

 /**
+ * Application implementation created to handle the dependency container implementation provided by the ObjectGraph
+ * entity.
+ *
  * @author Pedro Vicente Gómez Sánchez.
  */
 public class DraggablePanelApplication extends Application {

     private ObjectGraph objectGraph;

+    /**
+     * Override method used to initialize the dependency container graph with the MainModule.
+     */
     @Override
     public void onCreate() {
         super.onCreate();
<|current_version|>
/*
 * Copyright (C) 2014 Pedro Vicente Gómez Sánchez.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.github.pedrovgs.sample;

import android.app.Application;
import com.github.pedrovgs.sample.di.MainModule;
import dagger.ObjectGraph;

/**
 * Application implementation created to handle the dependency container implementation provided by the ObjectGraph
 * entity.
 *
 * @author Pedro Vicente Gómez Sánchez.
 */
public class DraggablePanelApplication extends Application {

    private ObjectGraph objectGraph;

    /**
     * Override method used to initialize the dependency container graph with the MainModule.
     */
    @Override
    public void onCreate() {
        super.onCreate();
        MainModule mainModule = new MainModule(this);
        objectGraph = ObjectGraph.create(mainModule);
        objectGraph.inject(this);
        objectGraph.injectStatics();
    }

    public void inject(Object object) {
        objectGraph.inject(object);
    }
}

<|next_version|>
/*
 * Copyright (C) 2014 Pedro Vicente Gómez Sánchez.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.github.pedrovgs.sample;

import android.app.Application;
import com.github.pedrovgs.sample.di.MainModule;
import dagger.ObjectGraph;

/**
 * Application implementation created to handle the dependency container implementation provided by the ObjectGraph
 * entity.
 *
 * @author Pedro Vicente Gómez Sánchez.
 */
public class DraggablePanelApplication extends Application {

    private ObjectGraph objectGraph;

    /**
     * Override method used to initialize the dependency container graph with the MainModule.
     */
    @Override
    public void onCreate() {
        super.onCreate();
        MainModule mainModule = new MainModule(this);
        objectGraph = ObjectGraph.create(mainModule);
        objectGraph.inject(this);
        objectGraph.injectStatics();
    }

    /**
     * Inject an object to provide all the needed dependencies.
     *
     * @param object
     */
    public void inject(Object object) {
        objectGraph.inject(object);
    }
}


Set UI as best on OS

Set UI as best on OS

--- wow-attendance/src/main/java/ru/faulab/attendence/Runner.java
+++ wow-attendance/src/main/java/ru/faulab/attendence/Runner.java
@@ -5,12 +5,18 @@
 import ru.faulab.attendence.module.MainModule;
 import ru.faulab.attendence.ui.MainFrame;

+import javax.swing.*;
+
 public class Runner {

     /*
     * 1. Статистика
     * */
     public static void main(String[] args) throws Exception {
+
+        UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
+        JFrame.setDefaultLookAndFeelDecorated(true);
+        JDialog.setDefaultLookAndFeelDecorated(true);

         String userHome = System.getProperty("user.home");
         System.setProperty("derby.system.home", userHome);

<|original_code|>
package ru.faulab.attendence;

import com.google.inject.Guice;
import com.google.inject.Injector;
import ru.faulab.attendence.module.MainModule;
import ru.faulab.attendence.ui.MainFrame;

public class Runner {

    /*
    * 1. Статистика
    * */
    public static void main(String[] args) throws Exception {

        String userHome = System.getProperty("user.home");
        System.setProperty("derby.system.home", userHome);

        Injector injector = Guice.createInjector(new MainModule());

        MainFrame mainFrame = injector.getInstance(MainFrame.class);
        mainFrame.init();
    }

}

<|edits_diff|>
--- wow-attendance/src/main/java/ru/faulab/attendence/Runner.java
+++ wow-attendance/src/main/java/ru/faulab/attendence/Runner.java
@@ -4,6 +4,8 @@
 import com.google.inject.Injector;
 import ru.faulab.attendence.module.MainModule;
 import ru.faulab.attendence.ui.MainFrame;
+
+import javax.swing.*;

 public class Runner {

<|current_version|>
package ru.faulab.attendence;

import com.google.inject.Guice;
import com.google.inject.Injector;
import ru.faulab.attendence.module.MainModule;
import ru.faulab.attendence.ui.MainFrame;

import javax.swing.*;

public class Runner {

    /*
    * 1. Статистика
    * */
    public static void main(String[] args) throws Exception {

        String userHome = System.getProperty("user.home");
        System.setProperty("derby.system.home", userHome);

        Injector injector = Guice.createInjector(new MainModule());

        MainFrame mainFrame = injector.getInstance(MainFrame.class);
        mainFrame.init();
    }

}

<|next_version|>
package ru.faulab.attendence;

import com.google.inject.Guice;
import com.google.inject.Injector;
import ru.faulab.attendence.module.MainModule;
import ru.faulab.attendence.ui.MainFrame;

import javax.swing.*;

public class Runner {

    /*
    * 1. Статистика
    * */
    public static void main(String[] args) throws Exception {

        UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
        JFrame.setDefaultLookAndFeelDecorated(true);
        JDialog.setDefaultLookAndFeelDecorated(true);

        String userHome = System.getProperty("user.home");
        System.setProperty("derby.system.home", userHome);

        Injector injector = Guice.createInjector(new MainModule());

        MainFrame mainFrame = injector.getInstance(MainFrame.class);
        mainFrame.init();
    }

}


Fix loading of posts (lob) (again)

Fix loading of posts (lob) (again)

--- src/main/java/eu/euregjug/site/events/EventRepository.java
+++ src/main/java/eu/euregjug/site/events/EventRepository.java
@@ -17,10 +17,12 @@

 import java.util.List;
 import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.transaction.annotation.Transactional;

 /**
  * @author Michael J. Simons, 2015-12-26
  */
 public interface EventRepository extends JpaRepository<EventEntity, Integer> {
+    @Transactional(readOnly = true)
     List<EventEntity> findUpcomingEvents();
 }

<|original_code|>
/*
 * Copyright 2015 EuregJUG.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package eu.euregjug.site.events;

import java.util.List;
import org.springframework.data.jpa.repository.JpaRepository;

/**
 * @author Michael J. Simons, 2015-12-26
 */
public interface EventRepository extends JpaRepository<EventEntity, Integer> {
    List<EventEntity> findUpcomingEvents();
}
<|edits_diff|>
--- src/main/java/eu/euregjug/site/events/EventRepository.java
+++ src/main/java/eu/euregjug/site/events/EventRepository.java
@@ -17,6 +17,7 @@

 import java.util.List;
 import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.transaction.annotation.Transactional;

 /**
  * @author Michael J. Simons, 2015-12-26
<|current_version|>
/*
 * Copyright 2015 EuregJUG.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package eu.euregjug.site.events;

import java.util.List;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author Michael J. Simons, 2015-12-26
 */
public interface EventRepository extends JpaRepository<EventEntity, Integer> {
    List<EventEntity> findUpcomingEvents();
}
<|next_version|>
/*
 * Copyright 2015 EuregJUG.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package eu.euregjug.site.events;

import java.util.List;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author Michael J. Simons, 2015-12-26
 */
public interface EventRepository extends JpaRepository<EventEntity, Integer> {
    @Transactional(readOnly = true)
    List<EventEntity> findUpcomingEvents();
}


Mark API as experimental, because of javax.swing.TransferHandler.DropHandler.autoscroll

GitOrigin-RevId: c8522f07307517203906b9c867fd4fca6713b708

--- platform/platform-api/src/com/intellij/ide/dnd/DnDManager.java
+++ platform/platform-api/src/com/intellij/ide/dnd/DnDManager.java
@@ -3,6 +3,7 @@

 import com.intellij.openapi.application.ApplicationManager;
 import com.intellij.openapi.util.Key;
+import org.jetbrains.annotations.ApiStatus;
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;

@@ -37,5 +38,6 @@
    * @see JComponent#setAutoscrolls
    * @see JComponent#putClientProperty
    */
+  @ApiStatus.Experimental
   public static final Key<Boolean> AUTO_SCROLL = Key.create("AUTO_SCROLL");
 }

<|original_code|>
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.ide.dnd;

import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.util.Key;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import javax.swing.*;
import java.awt.*;

public abstract class DnDManager {
  public static DnDManager getInstance() {
    return ApplicationManager.getApplication().getService(DnDManager.class);
  }

  public abstract void registerSource(@NotNull DnDSource source, @NotNull JComponent component);

  public abstract void registerSource(@NotNull AdvancedDnDSource source);

  public abstract void unregisterSource(@NotNull DnDSource source, @NotNull JComponent component);

  public abstract void unregisterSource(@NotNull AdvancedDnDSource source);

  public abstract void registerTarget(DnDTarget target, JComponent component);

  public abstract void unregisterTarget(DnDTarget target, JComponent component);

  @Nullable
  public abstract Component getLastDropHandler();

  /**
   * This key is intended to switch on a smooth scrolling during drag-n-drop operations.
   * Note, that the target component must not use default auto-scrolling.
   *
   * @see java.awt.dnd.Autoscroll
   * @see JComponent#setAutoscrolls
   * @see JComponent#putClientProperty
   */
  public static final Key<Boolean> AUTO_SCROLL = Key.create("AUTO_SCROLL");
}

<|edits_diff|>
--- platform/platform-api/src/com/intellij/ide/dnd/DnDManager.java
+++ platform/platform-api/src/com/intellij/ide/dnd/DnDManager.java
@@ -3,6 +3,7 @@

 import com.intellij.openapi.application.ApplicationManager;
 import com.intellij.openapi.util.Key;
+import org.jetbrains.annotations.ApiStatus;
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;

<|current_version|>
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.ide.dnd;

import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.util.Key;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import javax.swing.*;
import java.awt.*;

public abstract class DnDManager {
  public static DnDManager getInstance() {
    return ApplicationManager.getApplication().getService(DnDManager.class);
  }

  public abstract void registerSource(@NotNull DnDSource source, @NotNull JComponent component);

  public abstract void registerSource(@NotNull AdvancedDnDSource source);

  public abstract void unregisterSource(@NotNull DnDSource source, @NotNull JComponent component);

  public abstract void unregisterSource(@NotNull AdvancedDnDSource source);

  public abstract void registerTarget(DnDTarget target, JComponent component);

  public abstract void unregisterTarget(DnDTarget target, JComponent component);

  @Nullable
  public abstract Component getLastDropHandler();

  /**
   * This key is intended to switch on a smooth scrolling during drag-n-drop operations.
   * Note, that the target component must not use default auto-scrolling.
   *
   * @see java.awt.dnd.Autoscroll
   * @see JComponent#setAutoscrolls
   * @see JComponent#putClientProperty
   */
  public static final Key<Boolean> AUTO_SCROLL = Key.create("AUTO_SCROLL");
}

<|next_version|>
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.ide.dnd;

import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.util.Key;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import javax.swing.*;
import java.awt.*;

public abstract class DnDManager {
  public static DnDManager getInstance() {
    return ApplicationManager.getApplication().getService(DnDManager.class);
  }

  public abstract void registerSource(@NotNull DnDSource source, @NotNull JComponent component);

  public abstract void registerSource(@NotNull AdvancedDnDSource source);

  public abstract void unregisterSource(@NotNull DnDSource source, @NotNull JComponent component);

  public abstract void unregisterSource(@NotNull AdvancedDnDSource source);

  public abstract void registerTarget(DnDTarget target, JComponent component);

  public abstract void unregisterTarget(DnDTarget target, JComponent component);

  @Nullable
  public abstract Component getLastDropHandler();

  /**
   * This key is intended to switch on a smooth scrolling during drag-n-drop operations.
   * Note, that the target component must not use default auto-scrolling.
   *
   * @see java.awt.dnd.Autoscroll
   * @see JComponent#setAutoscrolls
   * @see JComponent#putClientProperty
   */
  @ApiStatus.Experimental
  public static final Key<Boolean> AUTO_SCROLL = Key.create("AUTO_SCROLL");
}


Add custom toString() to SQLiteIndex

Add custom toString() to SQLiteIndex

--- src/main/java/com/getbase/autoindexer/SqliteIndex.java
+++ src/main/java/com/getbase/autoindexer/SqliteIndex.java
@@ -17,6 +17,8 @@
 package com.getbase.autoindexer;

 import com.google.common.base.Objects;
+
+import java.util.Arrays;

 public class SqliteIndex {
   public final String mTable;
@@ -39,6 +41,11 @@
   }

   @Override
+  public String toString() {
+    return "SQLiteIndex on " + mTable + Arrays.toString(mColumns);
+  }
+
+  @Override
   public int hashCode() {
     return Objects.hashCode(mTable, mColumns);
   }

<|original_code|>
/*
 * Copyright (C) 2013 Jerzy Chalupski
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.getbase.autoindexer;

import com.google.common.base.Objects;

public class SqliteIndex {
  public final String mTable;
  public final String[] mColumns;

  public SqliteIndex(String table, String... columns) {
    mTable = table;
    mColumns = columns;
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;

    SqliteIndex that = (SqliteIndex) o;

    return Objects.equal(mTable, that.mTable) &&
        Objects.equal(mColumns, that.mColumns);
  }

  @Override
  public int hashCode() {
    return Objects.hashCode(mTable, mColumns);
  }
}

<|edits_diff|>
--- src/main/java/com/getbase/autoindexer/SqliteIndex.java
+++ src/main/java/com/getbase/autoindexer/SqliteIndex.java
@@ -17,6 +17,8 @@
 package com.getbase.autoindexer;

 import com.google.common.base.Objects;
+
+import java.util.Arrays;

 public class SqliteIndex {
   public final String mTable;
<|current_version|>
/*
 * Copyright (C) 2013 Jerzy Chalupski
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.getbase.autoindexer;

import com.google.common.base.Objects;

import java.util.Arrays;

public class SqliteIndex {
  public final String mTable;
  public final String[] mColumns;

  public SqliteIndex(String table, String... columns) {
    mTable = table;
    mColumns = columns;
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;

    SqliteIndex that = (SqliteIndex) o;

    return Objects.equal(mTable, that.mTable) &&
        Objects.equal(mColumns, that.mColumns);
  }

  @Override
  public int hashCode() {
    return Objects.hashCode(mTable, mColumns);
  }
}

<|next_version|>
/*
 * Copyright (C) 2013 Jerzy Chalupski
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.getbase.autoindexer;

import com.google.common.base.Objects;

import java.util.Arrays;

public class SqliteIndex {
  public final String mTable;
  public final String[] mColumns;

  public SqliteIndex(String table, String... columns) {
    mTable = table;
    mColumns = columns;
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;

    SqliteIndex that = (SqliteIndex) o;

    return Objects.equal(mTable, that.mTable) &&
        Objects.equal(mColumns, that.mColumns);
  }

  @Override
  public String toString() {
    return "SQLiteIndex on " + mTable + Arrays.toString(mColumns);
  }

  @Override
  public int hashCode() {
    return Objects.hashCode(mTable, mColumns);
  }
}


Hide action bar icon on pre-L devices

Hide action bar icon on pre-L devices

--- app/src/main/java/tr/xip/horriblesubsschedule/MainActivity.java
+++ app/src/main/java/tr/xip/horriblesubsschedule/MainActivity.java
@@ -1,6 +1,7 @@
 package tr.xip.horriblesubsschedule;

 import android.app.Activity;
+import android.os.Build;
 import android.os.Bundle;
 import android.view.Menu;

@@ -10,6 +11,9 @@
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.activity_main);
+
+        if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.KITKAT)
+            getActionBar().setIcon(android.R.color.transparent);
     }

     @Override

<|original_code|>
package tr.xip.horriblesubsschedule;

import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;

public class MainActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.main, menu);
        return super.onCreateOptionsMenu(menu);
    }
}

<|edits_diff|>
--- app/src/main/java/tr/xip/horriblesubsschedule/MainActivity.java
+++ app/src/main/java/tr/xip/horriblesubsschedule/MainActivity.java
@@ -1,6 +1,7 @@
 package tr.xip.horriblesubsschedule;

 import android.app.Activity;
+import android.os.Build;
 import android.os.Bundle;
 import android.view.Menu;

<|current_version|>
package tr.xip.horriblesubsschedule;

import android.app.Activity;
import android.os.Build;
import android.os.Bundle;
import android.view.Menu;

public class MainActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.main, menu);
        return super.onCreateOptionsMenu(menu);
    }
}

<|next_version|>
package tr.xip.horriblesubsschedule;

import android.app.Activity;
import android.os.Build;
import android.os.Bundle;
import android.view.Menu;

public class MainActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.KITKAT)
            getActionBar().setIcon(android.R.color.transparent);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.main, menu);
        return super.onCreateOptionsMenu(menu);
    }
}


Reduce the column size for well known content

--- app-business/src/main/java/org/ligoj/app/model/Message.java
+++ app-business/src/main/java/org/ligoj/app/model/Message.java
@@ -1,5 +1,6 @@
 package org.ligoj.app.model;

+import javax.persistence.Column;
 import javax.persistence.Entity;
 import javax.persistence.EnumType;
 import javax.persistence.Enumerated;
@@ -34,6 +35,7 @@
 	 */
 	@Enumerated(EnumType.STRING)
 	@NotNull
+	@Column(length = 10)
 	private MessageTargetType targetType;

 	/**

<|original_code|>
package org.ligoj.app.model;

import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;

import org.ligoj.bootstrap.core.model.AbstractAudited;
import lombok.Getter;
import lombok.Setter;

/**
 * A message to target audience.
 */
@Getter
@Setter
@Entity
@Table(name = "LIGOJ_MESSAGE")
public class Message extends AbstractAudited<Integer> {

	/**
	 * SID
	 */
	private static final long serialVersionUID = 1L;

	/**
	 * Type of target (group, user, ...). When null the target is everybody.
	 *
	 * @see MessageTargetType
	 */
	@Enumerated(EnumType.STRING)
	@NotNull
	private MessageTargetType targetType;

	/**
	 * Optional related target : user, group, node, ...
	 */
	@NotNull
	private String target;

	/**
	 * Value of the message.
	 */
	@Length(max = 500)
	@NotNull
	@NotBlank
	private String value;
}

<|edits_diff|>
--- app-business/src/main/java/org/ligoj/app/model/Message.java
+++ app-business/src/main/java/org/ligoj/app/model/Message.java
@@ -1,5 +1,6 @@
 package org.ligoj.app.model;

+import javax.persistence.Column;
 import javax.persistence.Entity;
 import javax.persistence.EnumType;
 import javax.persistence.Enumerated;
<|current_version|>
package org.ligoj.app.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;

import org.ligoj.bootstrap.core.model.AbstractAudited;
import lombok.Getter;
import lombok.Setter;

/**
 * A message to target audience.
 */
@Getter
@Setter
@Entity
@Table(name = "LIGOJ_MESSAGE")
public class Message extends AbstractAudited<Integer> {

	/**
	 * SID
	 */
	private static final long serialVersionUID = 1L;

	/**
	 * Type of target (group, user, ...). When null the target is everybody.
	 *
	 * @see MessageTargetType
	 */
	@Enumerated(EnumType.STRING)
	@NotNull
	private MessageTargetType targetType;

	/**
	 * Optional related target : user, group, node, ...
	 */
	@NotNull
	private String target;

	/**
	 * Value of the message.
	 */
	@Length(max = 500)
	@NotNull
	@NotBlank
	private String value;
}

<|next_version|>
package org.ligoj.app.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;

import org.ligoj.bootstrap.core.model.AbstractAudited;
import lombok.Getter;
import lombok.Setter;

/**
 * A message to target audience.
 */
@Getter
@Setter
@Entity
@Table(name = "LIGOJ_MESSAGE")
public class Message extends AbstractAudited<Integer> {

	/**
	 * SID
	 */
	private static final long serialVersionUID = 1L;

	/**
	 * Type of target (group, user, ...). When null the target is everybody.
	 *
	 * @see MessageTargetType
	 */
	@Enumerated(EnumType.STRING)
	@NotNull
	@Column(length = 10)
	private MessageTargetType targetType;

	/**
	 * Optional related target : user, group, node, ...
	 */
	@NotNull
	private String target;

	/**
	 * Value of the message.
	 */
	@Length(max = 500)
	@NotNull
	@NotBlank
	private String value;
}


Add dpid to Port JSON object.

Add dpid to Port JSON object.

Change-Id: I69a78ce0a8cfb07883d4ac13318a7811ab951f02

--- src/main/java/net/onrc/onos/core/topology/serializers/PortSerializer.java
+++ src/main/java/net/onrc/onos/core/topology/serializers/PortSerializer.java
@@ -8,6 +8,7 @@
 import org.codehaus.jackson.JsonProcessingException;
 import org.codehaus.jackson.map.SerializerProvider;
 import org.codehaus.jackson.map.ser.std.SerializerBase;
+import org.openflow.util.HexString;

 public class PortSerializer extends SerializerBase<Port> {

@@ -21,6 +22,7 @@
             throws IOException, JsonProcessingException {
         jsonGenerator.writeStartObject();
         jsonGenerator.writeStringField("state", "ACTIVE");
+        jsonGenerator.writeStringField("dpid", HexString.toHexString(port.getDpid()));
         jsonGenerator.writeNumberField("number", port.getNumber());
         jsonGenerator.writeStringField("desc", port.getDescription());
         jsonGenerator.writeArrayFieldStart("devices");

<|original_code|>
package net.onrc.onos.core.topology.serializers;

import java.io.IOException;

import net.onrc.onos.core.topology.Port;

import org.codehaus.jackson.JsonGenerator;
import org.codehaus.jackson.JsonProcessingException;
import org.codehaus.jackson.map.SerializerProvider;
import org.codehaus.jackson.map.ser.std.SerializerBase;

public class PortSerializer extends SerializerBase<Port> {

    public PortSerializer() {
        super(Port.class);
    }

    @Override
    public void serialize(Port port, JsonGenerator jsonGenerator,
                          SerializerProvider serializerProvider)
            throws IOException, JsonProcessingException {
        jsonGenerator.writeStartObject();
        jsonGenerator.writeStringField("state", "ACTIVE");
        jsonGenerator.writeNumberField("number", port.getNumber());
        jsonGenerator.writeStringField("desc", port.getDescription());
        jsonGenerator.writeArrayFieldStart("devices");
        jsonGenerator.writeEndArray();
        jsonGenerator.writeEndObject();
    }

}

<|edits_diff|>
--- src/main/java/net/onrc/onos/core/topology/serializers/PortSerializer.java
+++ src/main/java/net/onrc/onos/core/topology/serializers/PortSerializer.java
@@ -8,6 +8,7 @@
 import org.codehaus.jackson.JsonProcessingException;
 import org.codehaus.jackson.map.SerializerProvider;
 import org.codehaus.jackson.map.ser.std.SerializerBase;
+import org.openflow.util.HexString;

 public class PortSerializer extends SerializerBase<Port> {

<|current_version|>
package net.onrc.onos.core.topology.serializers;

import java.io.IOException;

import net.onrc.onos.core.topology.Port;

import org.codehaus.jackson.JsonGenerator;
import org.codehaus.jackson.JsonProcessingException;
import org.codehaus.jackson.map.SerializerProvider;
import org.codehaus.jackson.map.ser.std.SerializerBase;
import org.openflow.util.HexString;

public class PortSerializer extends SerializerBase<Port> {

    public PortSerializer() {
        super(Port.class);
    }

    @Override
    public void serialize(Port port, JsonGenerator jsonGenerator,
                          SerializerProvider serializerProvider)
            throws IOException, JsonProcessingException {
        jsonGenerator.writeStartObject();
        jsonGenerator.writeStringField("state", "ACTIVE");
        jsonGenerator.writeNumberField("number", port.getNumber());
        jsonGenerator.writeStringField("desc", port.getDescription());
        jsonGenerator.writeArrayFieldStart("devices");
        jsonGenerator.writeEndArray();
        jsonGenerator.writeEndObject();
    }

}

<|next_version|>
package net.onrc.onos.core.topology.serializers;

import java.io.IOException;

import net.onrc.onos.core.topology.Port;

import org.codehaus.jackson.JsonGenerator;
import org.codehaus.jackson.JsonProcessingException;
import org.codehaus.jackson.map.SerializerProvider;
import org.codehaus.jackson.map.ser.std.SerializerBase;
import org.openflow.util.HexString;

public class PortSerializer extends SerializerBase<Port> {

    public PortSerializer() {
        super(Port.class);
    }

    @Override
    public void serialize(Port port, JsonGenerator jsonGenerator,
                          SerializerProvider serializerProvider)
            throws IOException, JsonProcessingException {
        jsonGenerator.writeStartObject();
        jsonGenerator.writeStringField("state", "ACTIVE");
        jsonGenerator.writeStringField("dpid", HexString.toHexString(port.getDpid()));
        jsonGenerator.writeNumberField("number", port.getNumber());
        jsonGenerator.writeStringField("desc", port.getDescription());
        jsonGenerator.writeArrayFieldStart("devices");
        jsonGenerator.writeEndArray();
        jsonGenerator.writeEndObject();
    }

}


Add default 200 status to Home mapping

Add default 200 status to Home mapping

--- src/main/java/com/pm/server/controller/HomeController.java
+++ src/main/java/com/pm/server/controller/HomeController.java
@@ -2,8 +2,10 @@

 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
+import org.springframework.http.HttpStatus;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.ResponseStatus;
 import org.springframework.web.bind.annotation.RestController;

 @RestController
@@ -16,6 +18,7 @@
 	@RequestMapping(
 			value="/",
 			method=RequestMethod.GET)
+	@ResponseStatus(value = HttpStatus.OK)
 	public String home() {

 		log.debug("Mapped GET /");

<|original_code|>
package com.pm.server.controller;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/")
public class HomeController implements Controller {

	private final static Logger log =
			LogManager.getLogger(HomeController.class.getName());

	@RequestMapping(
			value="/",
			method=RequestMethod.GET)
	public String home() {

		log.debug("Mapped GET /");

		return "Welcome to the Pac Macro server!";
	}

}

<|edits_diff|>
--- src/main/java/com/pm/server/controller/HomeController.java
+++ src/main/java/com/pm/server/controller/HomeController.java
@@ -2,8 +2,10 @@

 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
+import org.springframework.http.HttpStatus;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.ResponseStatus;
 import org.springframework.web.bind.annotation.RestController;

 @RestController
<|current_version|>
package com.pm.server.controller;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/")
public class HomeController implements Controller {

	private final static Logger log =
			LogManager.getLogger(HomeController.class.getName());

	@RequestMapping(
			value="/",
			method=RequestMethod.GET)
	public String home() {

		log.debug("Mapped GET /");

		return "Welcome to the Pac Macro server!";
	}

}

<|next_version|>
package com.pm.server.controller;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/")
public class HomeController implements Controller {

	private final static Logger log =
			LogManager.getLogger(HomeController.class.getName());

	@RequestMapping(
			value="/",
			method=RequestMethod.GET)
	@ResponseStatus(value = HttpStatus.OK)
	public String home() {

		log.debug("Mapped GET /");

		return "Welcome to the Pac Macro server!";
	}

}


Add version number to menu screen

Add version number to menu screen

--- demo/app/src/main/java/com/chaquo/python/demo/MainActivity.java
+++ demo/app/src/main/java/com/chaquo/python/demo/MainActivity.java
@@ -1,5 +1,6 @@
 package com.chaquo.python.demo;

+import android.content.pm.*;
 import android.os.*;
 import android.support.v7.app.*;
 import android.support.v7.preference.*;
@@ -12,6 +13,11 @@
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
+        try {
+            String version = getPackageManager().getPackageInfo(getPackageName(), 0).versionName;
+            setTitle(getTitle() + " " + version);
+        } catch (PackageManager.NameNotFoundException ignored) {}
+
         if (! Python.isStarted()) {
             Python.start(new AndroidPlatform(this));
         }

<|original_code|>
package com.chaquo.python.demo;

import android.os.*;
import android.support.v7.app.*;
import android.support.v7.preference.*;
import android.text.method.*;
import android.widget.*;
import com.chaquo.python.*;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        if (! Python.isStarted()) {
            Python.start(new AndroidPlatform(this));
        }

        setContentView(R.layout.activity_main);
        getSupportFragmentManager().beginTransaction()
            .replace(R.id.flMenu, new MenuFragment())
            .commit();

        ((TextView)findViewById(R.id.tvCaption)).setMovementMethod(LinkMovementMethod.getInstance());
    }

    public static class MenuFragment extends PreferenceFragmentCompat {
        @Override
        public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
            addPreferencesFromResource(R.xml.activity_main);
        }
    }
}

<|edits_diff|>
--- demo/app/src/main/java/com/chaquo/python/demo/MainActivity.java
+++ demo/app/src/main/java/com/chaquo/python/demo/MainActivity.java
@@ -1,5 +1,6 @@
 package com.chaquo.python.demo;

+import android.content.pm.*;
 import android.os.*;
 import android.support.v7.app.*;
 import android.support.v7.preference.*;
<|current_version|>
package com.chaquo.python.demo;

import android.content.pm.*;
import android.os.*;
import android.support.v7.app.*;
import android.support.v7.preference.*;
import android.text.method.*;
import android.widget.*;
import com.chaquo.python.*;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        if (! Python.isStarted()) {
            Python.start(new AndroidPlatform(this));
        }

        setContentView(R.layout.activity_main);
        getSupportFragmentManager().beginTransaction()
            .replace(R.id.flMenu, new MenuFragment())
            .commit();

        ((TextView)findViewById(R.id.tvCaption)).setMovementMethod(LinkMovementMethod.getInstance());
    }

    public static class MenuFragment extends PreferenceFragmentCompat {
        @Override
        public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
            addPreferencesFromResource(R.xml.activity_main);
        }
    }
}

<|next_version|>
package com.chaquo.python.demo;

import android.content.pm.*;
import android.os.*;
import android.support.v7.app.*;
import android.support.v7.preference.*;
import android.text.method.*;
import android.widget.*;
import com.chaquo.python.*;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        try {
            String version = getPackageManager().getPackageInfo(getPackageName(), 0).versionName;
            setTitle(getTitle() + " " + version);
        } catch (PackageManager.NameNotFoundException ignored) {}

        if (! Python.isStarted()) {
            Python.start(new AndroidPlatform(this));
        }

        setContentView(R.layout.activity_main);
        getSupportFragmentManager().beginTransaction()
            .replace(R.id.flMenu, new MenuFragment())
            .commit();

        ((TextView)findViewById(R.id.tvCaption)).setMovementMethod(LinkMovementMethod.getInstance());
    }

    public static class MenuFragment extends PreferenceFragmentCompat {
        @Override
        public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
            addPreferencesFromResource(R.xml.activity_main);
        }
    }
}


Annotate clean classes as @Nullsafe:: (4/14) libraries/components/litho-core/src/main/java/com/facebook/litho/

Reviewed By: pasqualeanatriello

Differential Revision: D28505758

fbshipit-source-id: 2bb4c97a1d166c4090db5edb7e6178719f0c2a5d

--- litho-core/src/main/java/com/facebook/litho/ArrayBatchAllocator.java
+++ litho-core/src/main/java/com/facebook/litho/ArrayBatchAllocator.java
@@ -17,7 +17,9 @@
 package com.facebook.litho;

 import androidx.annotation.Nullable;
+import com.facebook.infer.annotation.Nullsafe;

+@Nullsafe(Nullsafe.Mode.LOCAL)
 public class ArrayBatchAllocator {

   private static int batchSize = 200;

<|original_code|>
/*
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.facebook.litho;

import androidx.annotation.Nullable;

public class ArrayBatchAllocator {

  private static int batchSize = 200;

  @Nullable private static int[][] arrays = null;
  private static int index = 0;

  /** same as calling new int[2]; */
  public static int[] newArrayOfSize2() {
    if (arrays == null || arrays.length == index) {
      arrays = new int[batchSize][2];
      index = 0;
    }
    int[] toReturn = arrays[index];
    arrays[index++] = null;
    return toReturn;
  }
}

<|edits_diff|>
--- litho-core/src/main/java/com/facebook/litho/ArrayBatchAllocator.java
+++ litho-core/src/main/java/com/facebook/litho/ArrayBatchAllocator.java
@@ -17,6 +17,7 @@
 package com.facebook.litho;

 import androidx.annotation.Nullable;
+import com.facebook.infer.annotation.Nullsafe;

 public class ArrayBatchAllocator {

<|current_version|>
/*
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.facebook.litho;

import androidx.annotation.Nullable;
import com.facebook.infer.annotation.Nullsafe;

public class ArrayBatchAllocator {

  private static int batchSize = 200;

  @Nullable private static int[][] arrays = null;
  private static int index = 0;

  /** same as calling new int[2]; */
  public static int[] newArrayOfSize2() {
    if (arrays == null || arrays.length == index) {
      arrays = new int[batchSize][2];
      index = 0;
    }
    int[] toReturn = arrays[index];
    arrays[index++] = null;
    return toReturn;
  }
}

<|next_version|>
/*
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.facebook.litho;

import androidx.annotation.Nullable;
import com.facebook.infer.annotation.Nullsafe;

@Nullsafe(Nullsafe.Mode.LOCAL)
public class ArrayBatchAllocator {

  private static int batchSize = 200;

  @Nullable private static int[][] arrays = null;
  private static int index = 0;

  /** same as calling new int[2]; */
  public static int[] newArrayOfSize2() {
    if (arrays == null || arrays.length == index) {
      arrays = new int[batchSize][2];
      index = 0;
    }
    int[] toReturn = arrays[index];
    arrays[index++] = null;
    return toReturn;
  }
}