{"old_contents":"package io.github.saidie.plantuml_api;\n\nimport java.util.List;\nimport javax.persistence.CascadeType;\nimport javax.persistence.Column;\nimport javax.persistence.Entity;\nimport javax.persistence.GeneratedValue;\nimport javax.persistence.Id;\nimport javax.persistence.OneToMany;\nimport javax.validation.constraints.NotNull;\nimport lombok.AllArgsConstructor;\nimport lombok.Data;\nimport lombok.NoArgsConstructor;\n\n@Entity\n@Data\n@NoArgsConstructor\n@AllArgsConstructor\npublic class Account {\n @Id\n @GeneratedValue\n private long id;\n\n @NotNull\n @Column(nullable = false)\n private String username;\n\n @OneToMany(mappedBy = \"account\", cascade = CascadeType.ALL)\n private List federations;\n}\n","new_contents":"package io.github.saidie.plantuml_api;\n\nimport javax.persistence.Column;\nimport javax.persistence.Entity;\nimport javax.persistence.GeneratedValue;\nimport javax.persistence.Id;\nimport javax.validation.constraints.NotNull;\nimport lombok.AllArgsConstructor;\nimport lombok.Data;\nimport lombok.NoArgsConstructor;\n\n@Entity\n@Data\n@NoArgsConstructor\n@AllArgsConstructor\npublic class Account {\n @Id\n @GeneratedValue\n private long id;\n\n @NotNull\n @Column(nullable = false)\n private String username;\n}\n","subject":"Remove a dependency from account to federations"} {"old_contents":"package org.twig.syntax.parser.node.type;\n\nimport org.twig.compiler.*;\nimport org.twig.syntax.parser.node.Node;\n\nimport java.util.ArrayList;\nimport java.util.HashMap;\n\npublic class Text extends Node {\n public Text(ArrayList nodes, HashMap attributes, Integer line, String tag) {\n super(nodes, attributes, line, tag);\n }\n\n public Text(Integer line) {\n super(line);\n }\n\n @Override\n public void compile(ClassCompiler compiler) {\n String text = String.valueOf(attributes.get(\"data\"));\n compiler.write(\"output = output.concat(\");\n compiler.writeString(text);\n compiler.writeLine(\");\");\n }\n}\n","new_contents":"package org.twig.syntax.parser.node.type;\n\nimport org.twig.compiler.*;\nimport org.twig.syntax.parser.node.Node;\n\nimport java.util.ArrayList;\nimport java.util.HashMap;\n\npublic class Text extends Node {\n public Text(ArrayList nodes, HashMap attributes, Integer line, String tag) {\n super(nodes, attributes, line, tag);\n }\n\n public Text(Integer line) {\n super(line);\n }\n\n @Override\n public void compile(ClassCompiler compiler) {\n String text = String.valueOf(attributes.get(\"data\"));\n compiler.write(\"output = output.concat(\");\n compiler.writeString(text);\n compiler.writeRaw(\");\\n\");\n }\n}\n","subject":"Make formatting of text node nicer"} {"old_contents":"package seedu.address.commons.core;\n\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.junit.rules.ExpectedException;\n\nimport seedu.task.commons.core.Config;\n\nimport static org.junit.Assert.assertEquals;\nimport static org.junit.Assert.assertFalse;\nimport static org.junit.Assert.assertTrue;\n\npublic class ConfigTest {\n @Rule\n public ExpectedException thrown = ExpectedException.none();\n\n @Test\n public void toString_defaultObject_stringReturned() {\n String defaultConfigAsString = \"App title : Address App\\n\" +\n \"Current log level : INFO\\n\" +\n \"Preference file Location : preferences.json\\n\" +\n \"Local data file location : data\/taskmanager.xml\\n\" +\n \"TaskManager name : MyTaskManager\";\n\n assertEquals(defaultConfigAsString, new Config().toString());\n }\n\n @Test\n public void equalsMethod(){\n Config defaultConfig = new Config();\n assertFalse(defaultConfig.equals(null));\n assertTrue(defaultConfig.equals(defaultConfig));\n }\n\n\n}\n","new_contents":"package seedu.address.commons.core;\n\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.junit.rules.ExpectedException;\n\nimport seedu.task.commons.core.Config;\n\nimport static org.junit.Assert.assertEquals;\nimport static org.junit.Assert.assertFalse;\nimport static org.junit.Assert.assertTrue;\n\npublic class ConfigTest {\n @Rule\n public ExpectedException thrown = ExpectedException.none();\n\n @Test\n public void toString_defaultObject_stringReturned() {\n String defaultConfigAsString = \"App title : Task Manager\\n\" +\n \"Current log level : INFO\\n\" +\n \"Preference file Location : preferences.json\\n\" +\n \"Local data file location : data\/taskmanager.xml\\n\" +\n \"TaskManager name : MyTaskManager\";\n\n assertEquals(defaultConfigAsString, new Config().toString());\n }\n\n @Test\n public void equalsMethod(){\n Config defaultConfig = new Config();\n assertFalse(defaultConfig.equals(null));\n assertTrue(defaultConfig.equals(defaultConfig));\n }\n\n\n}\n","subject":"Change 'Address App' to Task Manager'"} {"old_contents":"package org.edx.mobile.base;\n\nimport android.app.Activity;\nimport android.os.Bundle;\nimport android.support.annotation.Nullable;\nimport android.view.LayoutInflater;\nimport android.view.View;\nimport android.view.ViewGroup;\n\nimport org.edx.mobile.event.NewRelicEvent;\n\nimport de.greenrobot.event.EventBus;\nimport roboguice.fragment.RoboFragment;\n\npublic class BaseFragment extends RoboFragment {\n private boolean isFirstVisit;\n\n @Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n EventBus.getDefault().post(new NewRelicEvent(getClass().getSimpleName()));\n }\n\n @Nullable\n @Override\n public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {\n isFirstVisit = true;\n return super.onCreateView(inflater, container, savedInstanceState);\n }\n\n @Override\n public void onResume() {\n super.onResume();\n if (isFirstVisit) {\n isFirstVisit = false;\n } else {\n onRevisit();\n }\n }\n\n \/**\n * Called when a Fragment is re-displayed to the user (the user has navigated back to it).\n * Defined to mock the behavior of {@link Activity#onRestart() Activity.onRestart} function.\n *\/\n protected void onRevisit() {\n }\n}\n","new_contents":"package org.edx.mobile.base;\n\nimport android.app.Activity;\nimport android.os.Bundle;\n\nimport org.edx.mobile.event.NewRelicEvent;\n\nimport de.greenrobot.event.EventBus;\nimport roboguice.fragment.RoboFragment;\n\npublic class BaseFragment extends RoboFragment {\n private boolean isFirstVisit = true;\n\n @Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n EventBus.getDefault().post(new NewRelicEvent(getClass().getSimpleName()));\n }\n\n @Override\n public void onResume() {\n super.onResume();\n if (isFirstVisit) {\n isFirstVisit = false;\n } else {\n onRevisit();\n }\n }\n\n \/**\n * Called when a Fragment is re-displayed to the user (the user has navigated back to it).\n * Defined to mock the behavior of {@link Activity#onRestart() Activity.onRestart} function.\n *\/\n protected void onRevisit() {\n }\n}\n","subject":"Fix 'onRevisit' callback calls wrongly issue."} {"old_contents":"package <%=packageName%>.web.rest.errors;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\n\/**\n * Custom, parameterized exception, which can be translated on the client side.\n * For example:\n *\n *
\n * throw new CustomParameterizedException("myCustomError", "hello", "world");\n * <\/pre>\n *\n * Can be translated with:\n *\n * 
\n * \"error.myCustomError\" :  \"The server says {{param0}} to {{param1}}\"\n * <\/pre>\n *\/\npublic class CustomParameterizedException extends RuntimeException {\n\n    private static final long serialVersionUID = 1L;\n\n    private static final String PARAM = \"param\";\n\n    private final String message;\n    private Map paramMap;\n\n    public CustomParameterizedException(String message, String... params) {\n        super(message);\n        this.message = message;\n        if (params != null && params.length > 0) {\n            this.paramMap = new HashMap<>();\n            for (int i = 0; i < params.length; i++) {\n                paramMap.put(PARAM + i, params[i]);\n            }\n        }\n    }\n\n    public CustomParameterizedException(String message, Map paramMap) {\n        super(message);\n        this.message = message;\n        this.paramMap = paramMap;\n    }\n\n    public ParameterizedErrorVM getErrorVM() {\n        return new ParameterizedErrorVM(message, paramMap);\n    }\n\n}\n","new_contents":"package <%=packageName%>.web.rest.errors;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\n\/**\n * Custom, parameterized exception, which can be translated on the client side.\n * For example:\n *\n * 
\n * throw new CustomParameterizedException("myCustomError", "hello", "world");\n * <\/pre>\n *\n * Can be translated with:\n *\n * 
\n * \"error.myCustomError\" :  \"The server says {{param0}} to {{param1}}\"\n * <\/pre>\n *\/\npublic class CustomParameterizedException extends RuntimeException {\n\n    private static final long serialVersionUID = 1L;\n\n    private static final String PARAM = \"param\";\n\n    private final String message;\n\n    private final Map paramMap = new HashMap<>();\n\n    public CustomParameterizedException(String message, String... params) {\n        super(message);\n        this.message = message;\n        if (params != null && params.length > 0) {\n            for (int i = 0; i < params.length; i++) {\n                paramMap.put(PARAM + i, params[i]);\n            }\n        }\n    }\n\n    public CustomParameterizedException(String message, Map paramMap) {\n        super(message);\n        this.message = message;\n        this.paramMap.putAll(paramMap);\n    }\n\n    public ParameterizedErrorVM getErrorVM() {\n        return new ParameterizedErrorVM(message, paramMap);\n    }\n}\n","subject":"Change code to make Sonar happy"}
{"old_contents":"\/*\n * generated by Xtext\n *\/\npackage org.yakindu.base.expressions.ui;\n\nimport org.eclipse.ui.plugin.AbstractUIPlugin;\n\n\/**\n * Use this class to register components to be used within the IDE.\n *\/\npublic class ExpressionsUiModule extends org.yakindu.base.expressions.ui.AbstractExpressionsUiModule {\n\tpublic ExpressionsUiModule(AbstractUIPlugin plugin) {\n\t\tsuper(plugin);\n\t}\n}\n","new_contents":"\/*\n * generated by Xtext\n *\/\npackage org.yakindu.base.expressions.ui;\n\nimport org.eclipse.ui.plugin.AbstractUIPlugin;\nimport org.eclipse.xtext.ui.editor.model.IResourceForEditorInputFactory;\nimport org.eclipse.xtext.ui.editor.model.JavaClassPathResourceForIEditorInputFactory;\nimport org.eclipse.xtext.ui.editor.model.ResourceForIEditorInputFactory;\nimport org.eclipse.xtext.ui.resource.IResourceSetProvider;\nimport org.eclipse.xtext.ui.resource.SimpleResourceSetProvider;\nimport org.eclipse.xtext.ui.resource.XtextResourceSetProvider;\nimport org.eclipse.xtext.ui.shared.Access;\n\n\/**\n * Use this class to register components to be used within the IDE.\n *\/\npublic class ExpressionsUiModule extends org.yakindu.base.expressions.ui.AbstractExpressionsUiModule {\n\tpublic ExpressionsUiModule(AbstractUIPlugin plugin) {\n\t\tsuper(plugin);\n\t}\n\n\tpublic com.google.inject.Provider provideIAllContainersState() {\n\t\tif (Access.getJdtHelper().get().isJavaCoreAvailable()) {\n\t\t\treturn Access.getJavaProjectsState();\n\t\t} else {\n\t\t\treturn Access.getWorkspaceProjectsState();\n\t\t}\n\t}\n\n\t@Override\n\tpublic Class bindIResourceSetProvider() {\n\t\tif (Access.getJdtHelper().get().isJavaCoreAvailable()) {\n\t\t\treturn XtextResourceSetProvider.class;\n\t\t} else {\n\t\t\treturn SimpleResourceSetProvider.class;\n\t\t}\n\t}\n\n\t@Override\n\tpublic Class bindIResourceForEditorInputFactory() {\n\t\tif (Access.getJdtHelper().get().isJavaCoreAvailable()) {\n\t\t\treturn JavaClassPathResourceForIEditorInputFactory.class;\n\t\t} else {\n\t\t\treturn ResourceForIEditorInputFactory.class;\n\t\t}\n\t}\n}\n","subject":"Check if JST is available"}
{"old_contents":"package eu.scasefp7.eclipse.core.handlers;\r\n\r\nimport org.eclipse.core.commands.ExecutionEvent;\r\nimport org.eclipse.core.commands.ExecutionException;\r\n\r\n\/**\r\n * A command handler for exporting all service compositions to the linked ontology.\r\n * \r\n * @author themis\r\n *\/\r\npublic class CompileServiceCompositionsHandler extends CommandExecutorHandler {\r\n\r\n\t\/**\r\n\t * This function is called when the user selects the menu item. It populates the linked ontology.\r\n\t * \r\n\t * @param event the event containing the information about which file was selected.\r\n\t * @return the result of the execution which must be {@code null}.\r\n\t *\/\r\n\t@Override\r\n\tpublic Object execute(ExecutionEvent event) throws ExecutionException {\r\n\t\tif (getProjectOfExecutionEvent(event) != null) {\r\n\t\t\t\/\/ executeCommand(\"eu.scasefp7.eclipse.servicecomposition.commands.exportAllToOntology\");\r\n\t\t\treturn null;\r\n\t\t} else {\r\n\t\t\tthrow new ExecutionException(\"No project selected\");\r\n\t\t}\r\n\t}\r\n\r\n}","new_contents":"package eu.scasefp7.eclipse.core.handlers;\r\n\r\nimport org.eclipse.core.commands.ExecutionEvent;\r\nimport org.eclipse.core.commands.ExecutionException;\r\n\r\n\/**\r\n * A command handler for exporting all service compositions to the linked ontology.\r\n * \r\n * @author themis\r\n *\/\r\npublic class CompileServiceCompositionsHandler extends CommandExecutorHandler {\r\n\r\n\t\/**\r\n\t * This function is called when the user selects the menu item. It populates the linked ontology.\r\n\t * \r\n\t * @param event the event containing the information about which file was selected.\r\n\t * @return the result of the execution which must be {@code null}.\r\n\t *\/\r\n\t@Override\r\n\tpublic Object execute(ExecutionEvent event) throws ExecutionException {\r\n\t\tif (getProjectOfExecutionEvent(event) != null) {\r\n\t\t\texecuteCommand(\"eu.scasefp7.eclipse.servicecomposition.commands.exportAllToOntology\");\r\n\t\t\treturn null;\r\n\t\t} else {\r\n\t\t\tthrow new ExecutionException(\"No project selected\");\r\n\t\t}\r\n\t}\r\n\r\n}","subject":"Enable service compositions command to instantiate the linked ontology"}
{"old_contents":"\/*\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\npackage io.trino.plugin.clickhouse;\n\nimport io.trino.plugin.jdbc.BaseJdbcConnectorSmokeTest;\nimport io.trino.testing.TestingConnectorBehavior;\nimport org.testng.annotations.Test;\n\npublic abstract class BaseClickHouseConnectorSmokeTest\n        extends BaseJdbcConnectorSmokeTest\n{\n    @Override\n    protected boolean hasBehavior(TestingConnectorBehavior connectorBehavior)\n    {\n        switch (connectorBehavior) {\n            case SUPPORTS_DELETE:\n                return false;\n            default:\n                return super.hasBehavior(connectorBehavior);\n        }\n    }\n\n    \/\/ TODO (https:\/\/github.com\/trinodb\/trino\/issues\/10653) Disable until fixing the flaky test issue\n    @Test(enabled = false)\n    @Override\n    public void testRenameSchema()\n    {\n        super.testRenameSchema();\n    }\n}\n","new_contents":"\/*\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\npackage io.trino.plugin.clickhouse;\n\nimport io.trino.plugin.jdbc.BaseJdbcConnectorSmokeTest;\nimport io.trino.testing.TestingConnectorBehavior;\nimport org.testng.annotations.Test;\n\npublic abstract class BaseClickHouseConnectorSmokeTest\n        extends BaseJdbcConnectorSmokeTest\n{\n    @Override\n    protected boolean hasBehavior(TestingConnectorBehavior connectorBehavior)\n    {\n        switch (connectorBehavior) {\n            case SUPPORTS_DELETE:\n                return false;\n            default:\n                return super.hasBehavior(connectorBehavior);\n        }\n    }\n\n    @Test\n    @Override\n    public void testRenameSchema()\n    {\n        super.testRenameSchema();\n    }\n}\n","subject":"Enable testRenameSchema in ClickHouse smoke test"}
{"old_contents":"package replicant;\n\nimport org.testng.annotations.Test;\nimport static org.testng.Assert.*;\n\npublic class ConvergerTest\n  extends AbstractReplicantTest\n{\n  @Test\n  public void construct_withUnnecessaryContext()\n  {\n    final ReplicantContext context = Replicant.context();\n    final IllegalStateException exception =\n      expectThrows( IllegalStateException.class, () -> Converger.create( context ) );\n    assertEquals( exception.getMessage(),\n                  \"Replicant-0124: SubscriptioConvergernService passed a context but Replicant.areZonesEnabled() is false\" );\n  }\n\n  @Test\n  public void getReplicantContext()\n  {\n    final ReplicantContext context = Replicant.context();\n    final Converger converger = context.getConverger();\n    assertEquals( converger.getReplicantContext(), context );\n    assertEquals( getFieldValue( converger, \"_context\" ), null );\n  }\n}\n","new_contents":"package replicant;\n\nimport org.testng.annotations.Test;\nimport static org.testng.Assert.*;\n\npublic class ConvergerTest\n  extends AbstractReplicantTest\n{\n  @Test\n  public void construct_withUnnecessaryContext()\n  {\n    final ReplicantContext context = Replicant.context();\n    final IllegalStateException exception =\n      expectThrows( IllegalStateException.class, () -> Converger.create( context ) );\n    assertEquals( exception.getMessage(),\n                  \"Replicant-0124: SubscriptioConvergernService passed a context but Replicant.areZonesEnabled() is false\" );\n  }\n\n  @Test\n  public void getReplicantContext()\n  {\n    final ReplicantContext context = Replicant.context();\n    final Converger converger = context.getConverger();\n    assertEquals( converger.getReplicantContext(), context );\n    assertEquals( getFieldValue( converger, \"_context\" ), null );\n  }\n\n  @Test\n  public void getReplicantContext_zonesEnabled()\n  {\n    ReplicantTestUtil.enableZones();\n    ReplicantTestUtil.resetState();\n\n    final ReplicantContext context = Replicant.context();\n    final Converger converger = context.getConverger();\n    assertEquals( converger.getReplicantContext(), context );\n    assertEquals( getFieldValue( converger, \"_context\" ), context );\n  }\n}\n","subject":"Add test for getReplicantContext with zones enabled"}
{"old_contents":"package bwyap.familyfeud.game.fastmoney.state;\n\n\/**\n * States in a family feud game whilst playing Fast Money\n * @author bwyap\n *\n *\/\npublic enum FFFastMoneyStateType {\n\t\/\/ TODO\n\t;\n\t\n\tprivate String name;\n\t\n\tprivate FFFastMoneyStateType(String name) {\n\t\tthis.name = name;\n\t}\n\t\n\t@Override\n\tpublic String toString() {\n\t\treturn name;\n\t}\n}\n","new_contents":"package bwyap.familyfeud.game.fastmoney.state;\n\n\/**\n * States in a family feud game whilst playing Fast Money\n * @author bwyap\n *\n *\/\npublic enum FFFastMoneyStateType {\n\t\n\tP1_ANSWER(\"p1 answer\"),\n\tP1_REVEAL(\"p1 reveal\"),\n\tP2_ANSWER(\"p2 answer\"),\n\tP2_REVEAL(\"p2 reveal\");\n\t\n\tprivate String name;\n\t\n\tprivate FFFastMoneyStateType(String name) {\n\t\tthis.name = name;\n\t}\n\t\n\t@Override\n\tpublic String toString() {\n\t\treturn name;\n\t}\n}\n","subject":"Add Fast Money state types"}
{"old_contents":"\/*\nCopyright 2011-2017 Frederic Langlet\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nyou may obtain a copy of the License at\n\n                http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*\/\n\npackage kanzi.test;\n\nimport kanzi.util.sort.BucketSort;\nimport org.junit.Assert;\nimport org.junit.Test;\n\n\npublic class TestBucketSort extends TestAbstractSort\n{\n    @Test\n    public void testBucketSort()\n    {\n        Assert.assertTrue(testCorrectness(\"BucketSort\", new BucketSort(8), 20));\n        testSpeed(\"BucketSort\", new BucketSort(16), 20000, 0xFFFF);\n    }    \n}","new_contents":"\/*\nCopyright 2011-2017 Frederic Langlet\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nyou may obtain a copy of the License at\n\n                http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*\/\n\npackage kanzi.test;\n\nimport kanzi.util.sort.BucketSort;\nimport org.junit.Assert;\nimport org.junit.Test;\n\n\npublic class TestBucketSort extends TestAbstractSort\n{\n    @Test\n    public void testBucketSort()\n    {\n        Assert.assertTrue(testCorrectness(\"BucketSort\", new BucketSort(8), 20));\n        testSpeed(\"BucketSort\", new BucketSort(16), 10000, 0xFFFF);\n    }    \n}","subject":"Speed up test by reducing iterations."}
{"old_contents":"package com.opnitech.rules.core.test.engine.test_validators;\n\nimport org.junit.Test;\n\nimport com.opnitech.rules.core.test.engine.AbstractRuleEngineExecutorTest;\nimport com.opnitech.rules.core.test.engine.test_validators.group.InvalidGroupDefinition;\nimport com.opnitech.rules.core.test.engine.test_validators.group.ValidGroupDefinition;\nimport com.opnitech.rules.core.test.engine.test_validators.rules.group.InvalidGroupRule;\nimport com.opnitech.rules.core.test.engine.test_validators.rules.group.ValidGroupRule;\n\n\/**\n * @author Rigre Gregorio Garciandia Sonora\n *\/\npublic class GroupRuleValidatorTest extends AbstractRuleEngineExecutorTest {\n\n    @Test\n    public void testValidRule() throws Exception {\n\n        \/\/ Group need to be defined\n        validateRule(ValidGroupDefinition.class, new ValidGroupRule());\n    }\n\n    @Test\n    public void testValidRuleButNoGroupDefinition() throws Exception {\n\n        \/\/ Group need to be defined\n        validateExceptionRule(new ValidGroupRule());\n    }\n\n    @Test\n    public void testInvalidRuleButNoGroupDefinition() throws Exception {\n\n        validateExceptionRule(new InvalidGroupRule());\n    }\n\n    @Test\n    public void testInvalidRule() throws Exception {\n\n        validateExceptionRule(InvalidGroupDefinition.class, new InvalidGroupRule());\n    }\n}\n","new_contents":"package com.opnitech.rules.core.test.engine.test_validators;\n\nimport org.junit.Test;\n\nimport com.opnitech.rules.core.test.engine.AbstractRuleEngineExecutorTest;\nimport com.opnitech.rules.core.test.engine.test_validators.group.InvalidGroupDefinition;\nimport com.opnitech.rules.core.test.engine.test_validators.group.ValidGroupDefinition;\nimport com.opnitech.rules.core.test.engine.test_validators.rules.group.InvalidGroupRule;\nimport com.opnitech.rules.core.test.engine.test_validators.rules.group.ValidGroupRule;\n\n\/**\n * @author Rigre Gregorio Garciandia Sonora\n *\/\npublic class GroupRuleValidatorTest extends AbstractRuleEngineExecutorTest {\n\n    @Test\n    public void testValidRule() throws Exception {\n\n        \/\/ Group need to be defined\n        validateRule(ValidGroupDefinition.class, new ValidGroupRule());\n    }\n\n    @Test\n    public void testValidRuleButNoGroupDefinition() throws Exception {\n\n        \/\/ Group need to be defined\n        validateRule(new ValidGroupRule());\n    }\n\n    @Test\n    public void testInvalidRuleButNoGroupDefinition() throws Exception {\n\n        validateExceptionRule(new InvalidGroupRule());\n    }\n\n    @Test\n    public void testInvalidRule() throws Exception {\n\n        validateExceptionRule(InvalidGroupDefinition.class, new InvalidGroupRule());\n    }\n}\n","subject":"Fix some unit test after the implementation allowing grouped rules without the group definition declared as executable"}
{"old_contents":"\/*\n * Copyright 2020 ThoughtWorks, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\npackage com.thoughtworks.gocd;\n\n\nimport java.util.Arrays;\nimport java.util.TreeSet;\n\npublic class AssertJava {\n    private static TreeSet SUPPORTED_VERSIONS = new TreeSet<>(Arrays.asList(\n            JavaVersion.VERSION_11,\n            JavaVersion.VERSION_12,\n            JavaVersion.VERSION_13,\n            JavaVersion.VERSION_14\n    ));\n\n    public static void assertVMVersion() {\n        checkSupported(JavaVersion.current());\n    }\n\n    private static void checkSupported(JavaVersion currentJavaVersion) {\n        if (!SUPPORTED_VERSIONS.contains(currentJavaVersion)) {\n            System.err.println(\"Running GoCD requires Java version >= \" + SUPPORTED_VERSIONS.first().name() +\n                    \" and <= \" + SUPPORTED_VERSIONS.last() +\n                    \". You are currently running with Java version \" + currentJavaVersion + \". GoCD will now exit!\");\n            System.exit(1);\n        }\n    }\n}\n","new_contents":"\/*\n * Copyright 2020 ThoughtWorks, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\npackage com.thoughtworks.gocd;\n\n\nimport java.util.Arrays;\nimport java.util.TreeSet;\n\npublic class AssertJava {\n    private static TreeSet SUPPORTED_VERSIONS = new TreeSet<>(Arrays.asList(\n            JavaVersion.VERSION_11,\n            JavaVersion.VERSION_12,\n            JavaVersion.VERSION_13,\n            JavaVersion.VERSION_14,\n            JavaVersion.VERSION_15\n    ));\n\n    public static void assertVMVersion() {\n        checkSupported(JavaVersion.current());\n    }\n\n    private static void checkSupported(JavaVersion currentJavaVersion) {\n        if (!SUPPORTED_VERSIONS.contains(currentJavaVersion)) {\n            System.err.println(\"Running GoCD requires Java version >= \" + SUPPORTED_VERSIONS.first().name() +\n                    \" and <= \" + SUPPORTED_VERSIONS.last() +\n                    \". You are currently running with Java version \" + currentJavaVersion + \". GoCD will now exit!\");\n            System.exit(1);\n        }\n    }\n}\n","subject":"Allow JDK 15 in prep for 20.9.0"}
{"old_contents":"package io.cucumber.junit;\n\nimport io.cucumber.core.exception.CucumberException;\n\nimport java.lang.annotation.Annotation;\nimport java.lang.reflect.Method;\n\nfinal class Assertions {\n    private Assertions() {\n    }\n\n    static void assertNoCucumberAnnotatedMethods(Class clazz) {\n        for (Method method : clazz.getDeclaredMethods()) {\n            for (Annotation annotation : method.getAnnotations()) {\n                if (annotation.annotationType().getName().startsWith(\"cucumber\") \/\/TODO: Remove once migrated\n                 || annotation.annotationType().getName().startsWith(\"io.cucumber\")) {\n                    throw new CucumberException(\n                            \"\\n\\n\" +\n                                    \"Classes annotated with @RunWith(Cucumber.class) must not define any\\n\" +\n                                    \"Step Definition or Hook methods. Their sole purpose is to serve as\\n\" +\n                                    \"an entry point for JUnit. Step Definitions and Hooks should be defined\\n\" +\n                                    \"in their own classes. This allows them to be reused across features.\\n\" +\n                                    \"Offending class: \" + clazz + \"\\n\"\n                    );\n                }\n            }\n        }\n    }\n}\n","new_contents":"package io.cucumber.junit;\n\nimport io.cucumber.core.exception.CucumberException;\n\nimport java.lang.annotation.Annotation;\nimport java.lang.reflect.Method;\n\nfinal class Assertions {\n    private Assertions() {\n    }\n\n    static void assertNoCucumberAnnotatedMethods(Class clazz) {\n        for (Method method : clazz.getDeclaredMethods()) {\n            for (Annotation annotation : method.getAnnotations()) {\n                if (annotation.annotationType().getName().startsWith(\"io.cucumber\")) {\n                    throw new CucumberException(\n                            \"\\n\\n\" +\n                                    \"Classes annotated with @RunWith(Cucumber.class) must not define any\\n\" +\n                                    \"Step Definition or Hook methods. Their sole purpose is to serve as\\n\" +\n                                    \"an entry point for JUnit. Step Definitions and Hooks should be defined\\n\" +\n                                    \"in their own classes. This allows them to be reused across features.\\n\" +\n                                    \"Offending class: \" + clazz + \"\\n\"\n                    );\n                }\n            }\n        }\n    }\n}\n","subject":"Remove cucumber.api glue annotation check"}
{"old_contents":"package net.glowstone.scoreboard;\n\nimport lombok.Getter;\nimport lombok.RequiredArgsConstructor;\nimport lombok.Setter;\nimport net.glowstone.net.message.play.scoreboard.ScoreboardScoreMessage;\nimport org.bukkit.Bukkit;\nimport org.bukkit.OfflinePlayer;\nimport org.bukkit.scoreboard.Objective;\nimport org.bukkit.scoreboard.Score;\nimport org.bukkit.scoreboard.Scoreboard;\n\n\/**\n * Implementation\/data holder for Scores.\n *\/\n@RequiredArgsConstructor\npublic final class GlowScore implements Score {\n\n    @Getter\n    private final GlowObjective objective;\n    @Getter\n    private final String entry;\n    private int score;\n    @Getter\n    @Setter\n    private boolean locked;\n\n    @Override\n    public Scoreboard getScoreboard() {\n        return objective.getScoreboard();\n    }\n\n    @Override\n    @Deprecated\n    public OfflinePlayer getPlayer() {\n        return Bukkit.getOfflinePlayer(entry);\n    }\n\n    @Override\n    public int getScore() throws IllegalStateException {\n        objective.checkValid();\n        return score;\n    }\n\n    \/**\n     * Sets this score's value.\n     * @param score the new value\n     * @throws IllegalStateException if the objective is not registered on a scoreboard\n     *\/\n    @Override\n    public void setScore(int score) throws IllegalStateException {\n        objective.checkValid();\n        this.score = score;\n        objective.getScoreboard()\n            .broadcast(new ScoreboardScoreMessage(entry, objective.getName(), score));\n    }\n\n    @Override\n    public boolean isScoreSet() throws IllegalStateException {\n        objective.checkValid();\n        return objective.getScoreboard().getScores(entry).contains(this);\n    }\n}\n","new_contents":"package net.glowstone.scoreboard;\n\nimport lombok.Getter;\nimport lombok.RequiredArgsConstructor;\nimport lombok.Setter;\nimport net.glowstone.net.message.play.scoreboard.ScoreboardScoreMessage;\nimport org.bukkit.Bukkit;\nimport org.bukkit.OfflinePlayer;\nimport org.bukkit.scoreboard.Objective;\nimport org.bukkit.scoreboard.Score;\nimport org.bukkit.scoreboard.Scoreboard;\n\n\/**\n * Implementation\/data holder for Scores.\n *\/\n@RequiredArgsConstructor\npublic final class GlowScore implements Score {\n\n    @Getter\n    private final GlowObjective objective;\n    @Getter\n    private final String entry;\n    private int score;\n    @Setter\n    private boolean locked;\n\n    @Override\n    public Scoreboard getScoreboard() {\n        return objective.getScoreboard();\n    }\n\n    @Override\n    @Deprecated\n    public OfflinePlayer getPlayer() {\n        return Bukkit.getOfflinePlayer(entry);\n    }\n\n    @Override\n    public int getScore() throws IllegalStateException {\n        objective.checkValid();\n        return score;\n    }\n\n    \/**\n     * Sets this score's value.\n     * @param score the new value\n     * @throws IllegalStateException if the objective is not registered on a scoreboard\n     *\/\n    @Override\n    public void setScore(int score) throws IllegalStateException {\n        objective.checkValid();\n        this.score = score;\n        objective.getScoreboard()\n            .broadcast(new ScoreboardScoreMessage(entry, objective.getName(), score));\n    }\n\n    @Override\n    public boolean isScoreSet() throws IllegalStateException {\n        objective.checkValid();\n        return objective.getScoreboard().getScores(entry).contains(this);\n    }\n\n    public boolean getLocked() {\n        return locked;\n    }\n}\n","subject":"Revert getLocked (Lombokified name was isLocked)"}
{"old_contents":"package com.java.laiy;\n\nimport com.java.laiy.controller.Game;\nimport com.java.laiy.controller.GameController;\nimport com.java.laiy.model.Board;\nimport com.java.laiy.model.Figure;\nimport com.java.laiy.model.Player;\nimport com.java.laiy.view.ConsoleView;\n\npublic class Main {\n\n    public static void main(final String[] args) {\n        final String GAME_NAME = \"XO\";\n        final Board board = new Board();\n        final Player[] players = new Player[2];\n        players[0] = new Player(\"Xonstantin\", Figure.X);\n        players[1] = new Player(\"Oleg\", Figure.O);\n        final GameController gameController = new GameController(GAME_NAME, players, board);\n        final ConsoleView consoleView = new ConsoleView(gameController);\n        final Game game = new Game(consoleView,gameController);\n\n        game.theGame();\n    }\n\n\n}\n","new_contents":"\npackage com.java.laiy;\n\nimport com.java.laiy.view.ConsoleMenuView;\n\npublic class Main {\n\n    public static void main(final String[] args) {\n        ConsoleMenuView.showMenuWithResult();\n    }\n\n\n}","subject":"Move game start and settings to MenuView, MenuView renamed in ConsoleMenuView"}
{"old_contents":"package bj.pranie.config;\n\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;\nimport org.springframework.security.config.annotation.web.builders.HttpSecurity;\nimport org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;\nimport org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;\n\n\/**\n * Created by noon on 13.10.16.\n *\/\n@Configuration\n@EnableWebSecurity\npublic class WebSecurityConfig extends WebSecurityConfigurerAdapter {\n    @Override\n    protected void configure(HttpSecurity http) throws Exception {\n        http.csrf().disable();\n        http.authorizeRequests()\n                .antMatchers(\"\/\", \"\/week\" ,\"\/week\/*\", \"\/wm\/*\", \"\/user\/registration\", \"\/user\/restore\", \"\/images\/*\", \"\/js\/*\").permitAll()\n                .anyRequest().authenticated()\n                .and()\n                .formLogin()\n                .loginPage(\"\/\")\n                .permitAll()\n                .and()\n                .logout()\n                .permitAll();\n    }\n\n    @Autowired\n    public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {\n        auth.inMemoryAuthentication()\n                .withUser(\"admin\").password(\"admin\").roles(\"USER\");\n    }\n}","new_contents":"package bj.pranie.config;\n\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;\nimport org.springframework.security.config.annotation.web.builders.HttpSecurity;\nimport org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;\nimport org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;\n\n\/**\n * Created by noon on 13.10.16.\n *\/\n@Configuration\n@EnableWebSecurity\npublic class WebSecurityConfig extends WebSecurityConfigurerAdapter {\n    @Override\n    protected void configure(HttpSecurity http) throws Exception {\n        http.csrf().disable();\n        http.authorizeRequests()\n                .antMatchers(\"\/\", \"\/week\" ,\"\/week\/*\", \"\/wm\/*\/*\", \"\/user\/registration\", \"\/user\/restore\", \"\/images\/*\", \"\/js\/*\").permitAll()\n                .anyRequest().authenticated()\n                .and()\n                .formLogin()\n                .loginPage(\"\/\")\n                .permitAll()\n                .and()\n                .logout()\n                .permitAll();\n    }\n\n    @Autowired\n    public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {\n        auth.inMemoryAuthentication()\n                .withUser(\"admin\").password(\"admin\").roles(\"USER\");\n    }\n}","subject":"Change path to site no requested authorization."}
{"old_contents":"package info.sleeplessacorn.nomagi.client;\n\nimport net.minecraft.block.state.IBlockState;\nimport net.minecraft.client.renderer.block.model.ModelResourceLocation;\nimport net.minecraft.client.renderer.block.statemap.StateMapperBase;\nimport net.minecraft.util.ResourceLocation;\nimport net.minecraftforge.fml.common.Loader;\n\n\/**\n * Used for blocks that implement the Chisel CTM format\n *\n * When Chisel is not loaded, a secondary blockstate file, with {@code _noctm} appended, is used instead.\n *\/\npublic class StateMapperNoCTM extends StateMapperBase {\n\n    @Override\n    protected ModelResourceLocation getModelResourceLocation(IBlockState state) {\n        ResourceLocation location = state.getBlock().getRegistryName();\n        if (!Loader.isModLoaded(\"chisel\"))\n            location = new ResourceLocation(location.getResourceDomain(), location.getResourcePath() + \"_noctm\");\n\n        return new ModelResourceLocation(location, getPropertyString(state.getProperties()));\n    }\n}\n","new_contents":"package info.sleeplessacorn.nomagi.client;\n\nimport net.minecraft.block.state.IBlockState;\nimport net.minecraft.client.renderer.block.model.ModelResourceLocation;\nimport net.minecraft.client.renderer.block.statemap.StateMapperBase;\nimport net.minecraft.util.ResourceLocation;\nimport net.minecraftforge.fml.common.Loader;\n\n\/**\n * Used for blocks that implement the Chisel CTM format\n *\n * When neither Chisel nor ConnectedTexturesMod are loaded, a secondary blockstate file, with {@code _noctm} appended, is used instead.\n *\/\npublic class StateMapperNoCTM extends StateMapperBase {\n\n    @Override\n    protected ModelResourceLocation getModelResourceLocation(IBlockState state) {\n        ResourceLocation location = state.getBlock().getRegistryName();\n        if (!Loader.isModLoaded(\"chisel\") || !Loader.isModLoaded(\"ctm\"))\n            location = new ResourceLocation(location.getResourceDomain(), location.getResourcePath() + \"_noctm\");\n\n        return new ModelResourceLocation(location, getPropertyString(state.getProperties()));\n    }\n}\n","subject":"Update CTM statemapper to check for ConnectedTexturesMod"}
{"old_contents":"\/*\n * ToroDB\n * Copyright © 2014 8Kdata Technology (www.8kdata.com)\n *\n * This program is free software: you can redistribute it and\/or modify\n * it under the terms of the GNU Affero General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see .\n *\/\n\npackage com.torodb.packaging.config.validation;\n\nimport com.torodb.packaging.config.model.protocol.mongo.AbstractReplication;\n\nimport javax.validation.ConstraintValidator;\nimport javax.validation.ConstraintValidatorContext;\n\npublic class MutualExclusiveReplSetOrShardsValidator implements\n    ConstraintValidator {\n\n  @Override\n  public void initialize(MutualExclusiveReplSetOrShards constraintAnnotation) {\n  }\n\n  @Override\n  public boolean isValid(AbstractReplication value, ConstraintValidatorContext context) {\n    if ((value.getShardList() != null && !value.getShardList().isEmpty())\n        && (value.getReplSetName().notDefault() || value.getSyncSource().notDefault())) {\n      return false;\n    }\n    \n    return true;\n  }\n}\n","new_contents":"\/*\n * ToroDB\n * Copyright © 2014 8Kdata Technology (www.8kdata.com)\n *\n * This program is free software: you can redistribute it and\/or modify\n * it under the terms of the GNU Affero General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see .\n *\/\n\npackage com.torodb.packaging.config.validation;\n\nimport com.torodb.packaging.config.model.protocol.mongo.AbstractReplication;\n\nimport javax.validation.ConstraintValidator;\nimport javax.validation.ConstraintValidatorContext;\n\npublic class MutualExclusiveReplSetOrShardsValidator implements\n    ConstraintValidator> {\n\n  @Override\n  public void initialize(MutualExclusiveReplSetOrShards constraintAnnotation) {\n  }\n\n  @Override\n  public boolean isValid(AbstractReplication value, ConstraintValidatorContext context) {\n    if ((value.getShardList() != null && !value.getShardList().isEmpty())\n        && value.getSyncSource().notDefault()) {\n      return false;\n    }\n    \n    return true;\n  }\n}\n","subject":"Allow a commond replSetName for all shards"}
{"old_contents":"package net.stickycode.configured.finder;\n\nimport static org.fest.assertions.Assertions.assertThat;\n\nimport org.junit.Test;\n\npublic abstract class AbstractBeanFinderTest {\n\n  protected abstract BeanFinder getFinder();\n\n  @Test\n  public void lookupPrototype() {\n    Bean bean = getFinder().find(Bean.class);\n    assertThat(bean).isNotNull();\n    Bean bean2 = getFinder().find(Bean.class);\n    assertThat(bean).isNotSameAs(bean2);\n  }\n\n  @Test\n  public void lookupSingleton() {\n    BeanFinder finder = getFinder();\n    SingletonBean bean = finder.find(SingletonBean.class);\n    assertThat(bean).isNotNull();\n    SingletonBean bean2 = finder.find(SingletonBean.class);\n    assertThat(bean).isSameAs(bean2);\n  }\n\n  @Test(expected = BeanNotFoundException.class)\n  public void notFound() {\n    getFinder().find(getClass());\n  }\n\n  @Test\n  \/\/ (expected = BeanNotFoundException.class)\n  public void tooMany() {\n    getFinder().find(TooMany.class);\n  }\n}\n","new_contents":"package net.stickycode.configured.finder;\n\nimport static org.fest.assertions.Assertions.assertThat;\n\nimport org.junit.Test;\n\npublic abstract class AbstractBeanFinderTest {\n\n  protected abstract BeanFinder getFinder();\n\n  @Test\n  public void lookupPrototype() {\n    Bean bean = getFinder().find(Bean.class);\n    assertThat(bean).isNotNull();\n    Bean bean2 = getFinder().find(Bean.class);\n    assertThat(bean).isNotSameAs(bean2);\n  }\n\n  @Test\n  public void lookupSingleton() {\n    BeanFinder finder = getFinder();\n    SingletonBean bean = finder.find(SingletonBean.class);\n    assertThat(bean).isNotNull();\n    SingletonBean bean2 = finder.find(SingletonBean.class);\n    assertThat(bean).isSameAs(bean2);\n  }\n\n  @Test(expected = BeanNotFoundException.class)\n  public void notFound() {\n    getFinder().find(getClass());\n  }\n\n  @Test(expected = BeanNotFoundException.class)\n  public void tooMany() {\n    getFinder().find(TooMany.class);\n  }\n}\n","subject":"Enable the correct exception check on the test, was disabled when inspecting the contents of the exception"}
{"old_contents":"\/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *    http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\npackage org.apache.eagle.jobrunning.url;\n\n\npublic class JobCompletedConfigServiceURLBuilderImpl implements ServiceURLBuilder {\n\t\n\tpublic String build(String ... parameters) {\n\t\t\/\/ parameters[0] = baseUrl, parameters[1] = jobID\n\t\t\/\/ {historyUrl}\/jobhistory\/conf\/job_xxxxxxxxxxxxx_xxxxxx\t\t\n\t\treturn parameters[0] + \"jobhistory\/conf\/\" + parameters[1];\t\t\n\t}\n}\n","new_contents":"\/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *    http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\npackage org.apache.eagle.jobrunning.url;\n\n\nimport org.apache.eagle.jobrunning.common.JobConstants;\n\npublic class JobCompletedConfigServiceURLBuilderImpl implements ServiceURLBuilder {\n\t\n\tpublic String build(String ... parameters) {\n\t\t\/\/ parameters[0] = baseUrl, parameters[1] = jobID\n\t\t\/\/ {historyUrl}\/jobhistory\/conf\/job_xxxxxxxxxxxxx_xxxxxx\t\t\n\t\treturn parameters[0] + \"jobhistory\/conf\/\" + parameters[1]\n\t\t\t\t+ \"?\" + JobConstants.ANONYMOUS_PARAMETER;\n\t}\n}\n","subject":"Add a missing anonymous parameter in hive running spout"}
{"old_contents":"package com.intellij.find.findUsages;\n\nimport com.intellij.openapi.project.Project;\nimport com.intellij.openapi.util.text.StringUtil;\nimport com.intellij.psi.PsiElement;\nimport com.intellij.usageView.UsageViewUtil;\n\nimport javax.swing.*;\n\n\/**\n * Created by IntelliJ IDEA.\n * User: max\n * Date: Feb 14, 2005\n * Time: 5:40:05 PM\n * To change this template use File | Settings | File Templates.\n *\/\npublic class CommonFindUsagesDialog extends AbstractFindUsagesDialog {\n  private PsiElement myPsiElement;\n\n  public CommonFindUsagesDialog(PsiElement element,\n                                Project project,\n                                FindUsagesOptions findUsagesOptions,\n                                boolean toShowInNewTab,\n                                boolean mustOpenInNewTab,\n                                boolean isSingleFile) {\n    super(project, findUsagesOptions, toShowInNewTab, mustOpenInNewTab, isSingleFile,\n          FindUsagesUtil.isSearchForTextOccurencesAvailable(element, isSingleFile), !isSingleFile && !element.getManager().isInProject(element));\n    myPsiElement = element;\n  }\n\n  protected JPanel createFindWhatPanel() {\n    return null;\n  }\n\n  protected JComponent getPreferredFocusedControl() {\n    return null;\n  }\n\n  public String getLabelText() {\n    return StringUtil.capitalize(UsageViewUtil.getType(myPsiElement)) + \" \" + UsageViewUtil.getDescriptiveName(myPsiElement);\n  }\n}\n","new_contents":"package com.intellij.find.findUsages;\n\nimport com.intellij.openapi.project.Project;\nimport com.intellij.openapi.util.text.StringUtil;\nimport com.intellij.psi.PsiElement;\nimport com.intellij.usageView.UsageViewUtil;\n\nimport javax.swing.*;\n\n\/**\n * Created by IntelliJ IDEA.\n * User: max\n * Date: Feb 14, 2005\n * Time: 5:40:05 PM\n * To change this template use File | Settings | File Templates.\n *\/\npublic class CommonFindUsagesDialog extends AbstractFindUsagesDialog {\n  private PsiElement myPsiElement;\n\n  public CommonFindUsagesDialog(PsiElement element,\n                                Project project,\n                                FindUsagesOptions findUsagesOptions,\n                                boolean toShowInNewTab,\n                                boolean mustOpenInNewTab,\n                                boolean isSingleFile) {\n    super(project, findUsagesOptions, toShowInNewTab, mustOpenInNewTab, isSingleFile,\n          FindUsagesUtil.isSearchForTextOccurencesAvailable(element, isSingleFile), !isSingleFile && !element.getManager().isInProject(element));\n    myPsiElement = element;\n    init();\n  }\n\n  protected JPanel createFindWhatPanel() {\n    return null;\n  }\n\n  protected JComponent getPreferredFocusedControl() {\n    return null;\n  }\n\n  public String getLabelText() {\n    return StringUtil.capitalize(UsageViewUtil.getType(myPsiElement)) + \" \" + UsageViewUtil.getDescriptiveName(myPsiElement);\n  }\n}\n","subject":"Fix non-java find usages dialogs."}
{"old_contents":"\/\/ Copyright 2019 Google LLC\n\/\/\n\/\/ Licensed under the Apache License, Version 2.0 (the \"License\");\n\/\/ you may not use this file except in compliance with the License.\n\/\/ You may obtain a copy of the License at\n\/\/\n\/\/     https:\/\/www.apache.org\/licenses\/LICENSE-2.0\n\/\/\n\/\/ Unless required by applicable law or agreed to in writing, software\n\/\/ distributed under the License is distributed on an \"AS IS\" BASIS,\n\/\/ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n\/\/ See the License for the specific language governing permissions and\n\/\/ limitations under the License.\n\npackage com.google.sps.servlets;\n\nimport java.io.IOException;\nimport javax.servlet.annotation.WebServlet;\nimport javax.servlet.http.HttpServlet;\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\n\n\/** Servlet that takes in audio stream and retrieves \n ** user input string to display. *\/\n\n@WebServlet(\"\/audio-input\")\npublic class AudioInputServlet extends HttpServlet {\n\n  @Override\n  public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {\n    response.setContentType(\"text\/html;\");\n    response.getWriter().println(\"

Hello world!<\/h1>\");\n }\n}\n","new_contents":"\/\/ Copyright 2019 Google LLC\n\/\/\n\/\/ Licensed under the Apache License, Version 2.0 (the \"License\");\n\/\/ you may not use this file except in compliance with the License.\n\/\/ You may obtain a copy of the License at\n\/\/\n\/\/ https:\/\/www.apache.org\/licenses\/LICENSE-2.0\n\/\/\n\/\/ Unless required by applicable law or agreed to in writing, software\n\/\/ distributed under the License is distributed on an \"AS IS\" BASIS,\n\/\/ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n\/\/ See the License for the specific language governing permissions and\n\/\/ limitations under the License.\n\npackage com.google.sps.servlets;\nimport java.util.*;\n\nimport java.io.IOException;\nimport javax.servlet.annotation.WebServlet;\nimport javax.servlet.http.HttpServlet;\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\n\n\/** Servlet that takes in audio stream and retrieves \n ** user input string to display. *\/\n\n@WebServlet(\"\/audio-input\")\npublic class AudioInputServlet extends HttpServlet {\n\n @Override\n public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {\n Object formdata = request.getParameter(\"file\");\n System.out.println(formdata);\n System.out.println(\"Got to servlet\");\n \/\/response.setContentType(\"text\/html;\");\n \/\/response.getWriter().println(\"

Hello world!<\/h1>\");\n }\n}\n","subject":"Add get retrieval of FormData"} {"old_contents":"package uk.co.alynn.games.ld30.world;\n\npublic abstract class Invader implements Adversary {\n\n private final float m_x, m_y;\n \n public Invader(float x, float y) {\n m_x = x;\n m_y = y;\n }\n \n @Override\n public String getImage() {\n return \"invader\";\n }\n\n @Override\n public float getX() {\n return m_x;\n }\n\n @Override\n public float getY() {\n return m_y;\n }\n \n abstract public Adversary update(float dt);\n\n @Override\n public Adversary hitPlayer(Runnable terminateGame) {\n return this;\n }\n\n @Override\n public Adversary hitBullet() {\n return null;\n }\n\n @Override\n public float getHeading() {\n return 0.0f;\n }\n\n}\n","new_contents":"package uk.co.alynn.games.ld30.world;\n\npublic abstract class Invader implements Adversary {\n\n private final float m_x, m_y;\n \n public Invader(float x, float y) {\n m_x = x;\n m_y = y;\n }\n \n @Override\n public String getImage() {\n return \"invader\";\n }\n\n @Override\n public float getX() {\n return m_x;\n }\n\n @Override\n public float getY() {\n return m_y;\n }\n \n abstract public Adversary update(float dt);\n\n @Override\n public Adversary hitPlayer(Runnable terminateGame) {\n terminateGame.run();\n return null;\n }\n\n @Override\n public Adversary hitBullet() {\n return null;\n }\n\n @Override\n public float getHeading() {\n return 0.0f;\n }\n\n}\n","subject":"Make collisions with invaders destroy the player"} {"old_contents":"package com.xdrop.passlock.core;\nimport org.apache.commons.codec.binary.Base64;\n\n\nimport com.xdrop.passlock.crypto.EncryptionModel;\nimport com.xdrop.passlock.crypto.aes.AESEncryptionData;\nimport com.xdrop.passlock.crypto.aes.AESEncryptionModel;\nimport com.xdrop.passlock.datasource.Datasource;\nimport com.xdrop.passlock.datasource.sqlite.SQLiteAESDatasource;\nimport com.xdrop.passlock.model.EncryptionData;\nimport com.xdrop.passlock.model.PasswordEntry;\nimport com.xdrop.passlock.utils.ByteUtils;\n\npublic class PasswordManager {\n\n public void addPassword(String description, char[] newPassword, String reference){\n\n EncryptionModel encryptionModel = new AESEncryptionModel();\n\n AESEncryptionData encryptionData = encryptionModel.encrypt(ByteUtils.getBytes(newPassword), pass.toCharArray());\n\n PasswordEntry passwordEntry = new PasswordEntry<>();\n passwordEntry.setDescription(description);\n passwordEntry.setRef(reference);\n passwordEntry.setEncryptionData(encryptionData);\n\n Datasource datasource = new SQLiteAESDatasource();\n datasource.addPass(reference, passwordEntry);\n\n\n byte[] b64 = Base64.encodeBase64(encryptionData.getEncryptedPayload());\n\n System.out.println(new String(b64));\n\n }\n\n\n\n}\n","new_contents":"package com.xdrop.passlock.core;\nimport org.apache.commons.codec.binary.Base64;\n\n\nimport com.xdrop.passlock.crypto.EncryptionModel;\nimport com.xdrop.passlock.crypto.aes.AESEncryptionData;\nimport com.xdrop.passlock.crypto.aes.AESEncryptionModel;\nimport com.xdrop.passlock.datasource.Datasource;\nimport com.xdrop.passlock.datasource.sqlite.SQLiteAESDatasource;\nimport com.xdrop.passlock.model.EncryptionData;\nimport com.xdrop.passlock.model.PasswordEntry;\nimport com.xdrop.passlock.utils.ByteUtils;\n\npublic class PasswordManager {\n\n public void addPassword(String description, char[] newPassword, char[] masterPass, String reference){\n\n EncryptionModel encryptionModel = new AESEncryptionModel();\n\n AESEncryptionData encryptionData = encryptionModel.encrypt(ByteUtils.getBytes(newPassword), masterPass);\n\n PasswordEntry passwordEntry = new PasswordEntry<>();\n passwordEntry.setDescription(description);\n passwordEntry.setRef(reference);\n passwordEntry.setEncryptionData(encryptionData);\n\n Datasource datasource = new SQLiteAESDatasource();\n datasource.addPass(reference, passwordEntry);\n\n\n byte[] b64 = Base64.encodeBase64(encryptionData.getEncryptedPayload());\n\n System.out.println(new String(b64));\n\n }\n\n\n\n}\n","subject":"Fix issue with missing var"} {"old_contents":"package org.ethereum.config.net;\n\nimport org.ethereum.config.blockchain.FrontierConfig;\n\n\/**\n * Created by Anton Nashatyrev on 25.02.2016.\n *\/\npublic class TestNetConfig extends AbstractNetConfig {\n public TestNetConfig() {\n add(0, new FrontierConfig());\n }\n}\n","new_contents":"package org.ethereum.config.net;\n\nimport org.ethereum.config.blockchain.FrontierConfig;\nimport org.ethereum.config.blockchain.HomesteadConfig;\n\n\/**\n * Created by Anton Nashatyrev on 25.02.2016.\n *\/\npublic class TestNetConfig extends AbstractNetConfig {\n public TestNetConfig() {\n add(0, new FrontierConfig());\n add(1_150_000, new HomesteadConfig());\n }\n}\n","subject":"Switch testnet config to Homestead"} {"old_contents":"public interface MatrixInterface {\n\t\/\/ boolean modify means function returns the modified matrix\n\t\/\/ no boolean modify means function returns a new matrix\n\n\t\/\/ matrix addition \n\tpublic Matrix m_add(Matrix m);\n\n\tpublic Matrix m_add(Matrix m, boolean modify);\n\n\n\t\/\/ matrix multiplication \n\tpublic Matrix m_multiply(Matrix m);\n\n\tpublic Matrix m_multiply(Matrix m, boolean modify);\n\n\n\t\/\/ transpose matrix \n\tpublic Matrix m_transpose(Matrix m);\n\n\tpublic Matrix m_transpose(Matrix m, boolean modify);\n\n\n\t\/\/ change element in matrix\n\tpublic void m_edit(double[][] a1);\n\n}","new_contents":"public interface MatrixInterface {\n\t\/\/ boolean modify means function returns the modified matrix\n\t\/\/ no boolean modify means function returns a new matrix\n\n\t\/\/ matrix addition \n\tpublic Matrix add(Matrix m);\n\n\tpublic Matrix add(Matrix m, boolean modify);\n\n\n\t\/\/ matrix multiplication \n\tpublic Matrix multiply(Matrix m);\n\n\tpublic Matrix multiply(Matrix m, boolean modify);\n\n\n\t\/\/ transpose matrix \n\tpublic Matrix transpose(Matrix m);\n\n\tpublic Matrix transpose(Matrix m, boolean modify);\n\n\n\t\/\/ change element in matrix\n\tpublic double[][] edit();\n\n}","subject":"Fix method names and change edit"} {"old_contents":"\/*\n * Copyright 2015 Hewlett-Packard Development Company, L.P.\n * Licensed under the MIT License (the \"License\"); you may not use this file except in compliance with the License.\n *\/\n\npackage com.hp.autonomy.hod.client.api.textindex;\n\n\/**\n * Enum type representing the possible options for the index flavor parameter\n *\/\npublic enum IndexFlavor {\n standard,\n explorer,\n categorization,\n custom_fields,\n web_cloud,\n querymanipulation\n}\n","new_contents":"\/*\n * Copyright 2015 Hewlett-Packard Development Company, L.P.\n * Licensed under the MIT License (the \"License\"); you may not use this file except in compliance with the License.\n *\/\n\npackage com.hp.autonomy.hod.client.api.textindex;\n\n\/**\n * Enum type representing the possible options for the index flavor parameter\n *\/\npublic enum IndexFlavor {\n standard,\n explorer,\n categorization,\n custom_fields,\n querymanipulation\n}\n","subject":"Remove web_cloud as it can't be used to create a text index"} {"old_contents":"package com.microsoft.azure.documentdb.sample.dao;\n\nimport com.microsoft.azure.documentdb.ConnectionPolicy;\nimport com.microsoft.azure.documentdb.ConsistencyLevel;\nimport com.microsoft.azure.documentdb.DocumentClient;\n\npublic class DocumentClientFactory {\n private static final String HOST = \"https:\/\/docdb-java-sample.documents.azure.com:443\/\";\n private static final String MASTER_KEY = \"[YOUR_KEY_HERE]\";\n\n private static DocumentClient documentClient;\n\n public static DocumentClient getDocumentClient() {\n if (documentClient == null) {\n documentClient = new DocumentClient(HOST, MASTER_KEY,\n ConnectionPolicy.GetDefault(), ConsistencyLevel.Session);\n }\n\n return documentClient;\n }\n\n}\n","new_contents":"package com.microsoft.azure.documentdb.sample.dao;\n\nimport com.microsoft.azure.documentdb.ConnectionPolicy;\nimport com.microsoft.azure.documentdb.ConsistencyLevel;\nimport com.microsoft.azure.documentdb.DocumentClient;\n\npublic class DocumentClientFactory {\n private static final String HOST = \"https:\/\/docdb-java-sample.documents.azure.com:443\/\";\n private static final String MASTER_KEY = \"[YOUR_KEY_HERE]\";\n\n private static DocumentClient documentClient = new DocumentClient(HOST, MASTER_KEY,\n ConnectionPolicy.GetDefault(), ConsistencyLevel.Session);\n\n public static DocumentClient getDocumentClient() {\n return documentClient;\n }\n\n}\n","subject":"Load DocumentDB client at class-load time"} {"old_contents":"package com.fabiohideki.socialbooks.resources;\n\nimport java.util.List;\n\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.PathVariable;\nimport org.springframework.web.bind.annotation.RequestBody;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestMethod;\nimport org.springframework.web.bind.annotation.RestController;\n\nimport com.fabiohideki.socialbooks.domain.Livro;\nimport com.fabiohideki.socialbooks.repository.LivrosRepository;\n\n@RestController\n@RequestMapping(\"\/livros\")\npublic class LivrosResources {\n\n\t@Autowired\n\tprivate LivrosRepository livrosRepository;\n\n\t@RequestMapping(method = RequestMethod.GET)\n\tpublic List listar() {\n\t\treturn livrosRepository.findAll();\n\t}\n\n\t@RequestMapping(method = RequestMethod.POST)\n\tpublic void salvar(@RequestBody Livro livro) {\n\t\tlivrosRepository.save(livro);\n\t}\n\n\t@RequestMapping(value = \"\/{id}\", method = RequestMethod.GET)\n\tpublic Livro buscar(@PathVariable Long id) {\n\t\treturn livrosRepository.findOne(id);\n\t}\n\n\t@RequestMapping(value = \"\/{id}\", method = RequestMethod.DELETE)\n\tpublic void deletar(@PathVariable Long id) {\n\t\tlivrosRepository.delete(id);\n\t}\n\n}\n","new_contents":"package com.fabiohideki.socialbooks.resources;\n\nimport java.util.List;\n\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.PathVariable;\nimport org.springframework.web.bind.annotation.RequestBody;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestMethod;\nimport org.springframework.web.bind.annotation.RestController;\n\nimport com.fabiohideki.socialbooks.domain.Livro;\nimport com.fabiohideki.socialbooks.repository.LivrosRepository;\n\n@RestController\n@RequestMapping(\"\/livros\")\npublic class LivrosResources {\n\n\t@Autowired\n\tprivate LivrosRepository livrosRepository;\n\n\t@RequestMapping(method = RequestMethod.GET)\n\tpublic List listar() {\n\t\treturn livrosRepository.findAll();\n\t}\n\n\t@RequestMapping(method = RequestMethod.POST)\n\tpublic void salvar(@RequestBody Livro livro) {\n\t\tlivrosRepository.save(livro);\n\t}\n\n\t@RequestMapping(value = \"\/{id}\", method = RequestMethod.GET)\n\tpublic Livro buscar(@PathVariable(\"id\") Long id) {\n\t\treturn livrosRepository.findOne(id);\n\t}\n\n\t@RequestMapping(value = \"\/{id}\", method = RequestMethod.DELETE)\n\tpublic void deletar(@PathVariable(\"id\") Long id) {\n\t\tlivrosRepository.delete(id);\n\t}\n\n\t@RequestMapping(value = \"\/{id}\", method = RequestMethod.PUT)\n\tpublic void atualizar(@RequestBody Livro livro, @PathVariable(\"id\") Long id) {\n\t\tlivro.setId(id);\n\t\tlivrosRepository.save(livro);\n\t}\n\n}\n","subject":"PUT para atualizar o recurso Livro"} {"old_contents":"package edu.washington.escience.myriad;\n\n\/**\n * This class holds the constants for the Myria execution.\n * \n * @author dhalperi\n * \n *\/\npublic final class MyriaConstants {\n \/** Private constructor to disallow building utility class. *\/\n private MyriaConstants() {\n }\n\n \/** The identity of the master worker is current always zero. *\/\n public static final Integer MASTER_ID = Integer.valueOf(0);\n\n}\n","new_contents":"package edu.washington.escience.myriad;\n\n\/**\n * This class holds the constants for the Myria execution.\n * \n * @author dhalperi\n * \n *\/\npublic final class MyriaConstants {\n \/** Private constructor to disallow building utility class. *\/\n private MyriaConstants() {\n }\n\n \/** The identity of the master worker is current always zero. *\/\n public static final int MASTER_ID = 0;\n\n public static final String SYSTEM_NAME = \"Myria\";\n\n}\n","subject":"Move some more constants here"} {"old_contents":"package pokefenn.totemic.init;\n\nimport net.minecraft.tileentity.TileEntityType;\nimport net.minecraftforge.event.RegistryEvent;\nimport net.minecraftforge.eventbus.api.SubscribeEvent;\nimport net.minecraftforge.registries.ObjectHolder;\nimport pokefenn.totemic.Totemic;\nimport pokefenn.totemic.tile.totem.TileTotemBase;\n\n@ObjectHolder(Totemic.MOD_ID)\npublic final class ModTileEntities {\n public static final TileEntityType totem_base = null;\n\n @SubscribeEvent\n public static void init(RegistryEvent.Register> event) {\n event.getRegistry().registerAll(\n TileEntityType.Builder.create(TileTotemBase::new).build(null).setRegistryName(\"totem_base\")\n );\n }\n}\n","new_contents":"package pokefenn.totemic.init;\n\nimport net.minecraft.block.Block;\nimport net.minecraft.tileentity.TileEntityType;\nimport net.minecraftforge.event.RegistryEvent;\nimport net.minecraftforge.eventbus.api.SubscribeEvent;\nimport net.minecraftforge.registries.ObjectHolder;\nimport pokefenn.totemic.Totemic;\nimport pokefenn.totemic.tile.totem.TileTotemBase;\n\n@ObjectHolder(Totemic.MOD_ID)\npublic final class ModTileEntities {\n public static final TileEntityType totem_base = null;\n\n @SubscribeEvent\n public static void init(RegistryEvent.Register> event) {\n event.getRegistry().registerAll(\n TileEntityType.Builder.create(TileTotemBase::new, ModBlocks.getTotemBases().values().toArray(new Block[0])).build(null).setRegistryName(\"totem_base\")\n );\n }\n}\n","subject":"Fix invalid tile entity error"} {"old_contents":"package tutorial.storm.trident;\n\nimport backtype.storm.generated.DRPCExecutionException;\nimport backtype.storm.utils.DRPCClient;\nimport org.apache.thrift7.TException;\n\n\/**\n * @author Enno Shioji (eshioji@gmail.com)\n *\/\npublic class DrpcTestClient {\n public static void main(String[] args) throws TException, DRPCExecutionException {\n DRPCClient cl = new DRPCClient(\"localhost\",3772, 3000);\n System.out.println(cl.execute(\"ping\", \"ted\"));\n\n }\n}\n","new_contents":"package tutorial.storm.trident;\n\nimport backtype.storm.generated.DRPCExecutionException;\nimport backtype.storm.utils.DRPCClient;\nimport org.apache.thrift7.TException;\n\n\/**\n * @author Enno Shioji (eshioji@gmail.com)\n *\/\npublic class DrpcTestClient {\n public static void main(String[] args) throws TException, DRPCExecutionException {\n DRPCClient cl = new DRPCClient(\"localhost\",3772, 3000);\n if (args.length != 2){\n System.err.println(\" \");\n }else{\n String func = args[0];\n String argument = args[1];\n System.out.println(cl.execute(func, argument));\n }\n\n }\n}\n","subject":"Generalize the test DRPC client"} {"old_contents":"\/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements. See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership. The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License. You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n *\/\n\n@Version(\"2.3\")\npackage org.apache.sling.api.resource;\n\nimport aQute.bnd.annotation.Version;\n\n","new_contents":"\/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements. See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership. The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License. You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n *\/\n\n@Version(\"2.3.2\")\npackage org.apache.sling.api.resource;\n\nimport aQute.bnd.annotation.Version;\n\n","subject":"Update package version because of SLING-2844 and SLING-2845"} {"old_contents":"package com.nelsonjrodrigues.pchud.net;\n\nimport static java.lang.Byte.toUnsignedInt;\n\n\n\npublic class Extractor {\n\n private byte[] buffer;\n private int offset;\n private int length;\n\n public Extractor(byte[] buffer, int offset, int length) {\n this.buffer = buffer;\n this.offset = offset;\n this.length = length;\n }\n\n public int u8() {\n if (offset > length) {\n throw new ArrayIndexOutOfBoundsException();\n }\n return toUnsignedInt(buffer[offset++]);\n }\n\n public int u16() {\n return u8() ^\n u8() << 8;\n }\n\n public float f32() {\n return Float.intBitsToFloat(u8() ^\n u8() << 8 ^\n u8() << 16 ^\n u8() << 24);\n }\n\n}\n","new_contents":"package com.nelsonjrodrigues.pchud.net;\n\npublic class Extractor {\n\n private byte[] buffer;\n private int offset;\n private int length;\n\n public Extractor(byte[] buffer, int offset, int length) {\n this.buffer = buffer;\n this.offset = offset;\n this.length = length;\n }\n\n public int u8() {\n if (offset > length) {\n throw new ArrayIndexOutOfBoundsException();\n }\n return Byte.toUnsignedInt(buffer[offset++]);\n }\n\n public int u16() {\n return u8() ^\n u8() << 8;\n }\n\n public float f32() {\n return Float.intBitsToFloat(u8() ^\n u8() << 8 ^\n u8() << 16 ^\n u8() << 24);\n }\n\n}\n","subject":"Remove static import, code is more readable like this"} {"old_contents":"\/*\n * This file is provided to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\n * License for the specific language governing permissions and limitations under\n * the License.\n *\/\npackage com.basho.riak.client.raw.itest;\n\nimport java.io.IOException;\n\nimport com.basho.riak.client.http.Hosts;\nimport com.basho.riak.client.raw.RawClient;\nimport com.basho.riak.client.raw.http.HTTPClientConfig;\nimport com.basho.riak.client.raw.http.HTTPRiakClientFactory;\n\n\/**\n * @author russell\n * \n *\/\npublic class ITestHTTPClientAdapter extends ITestRawClientAdapter {\n\n \/*\n * (non-Javadoc)\n * \n * @see com.basho.riak.client.raw.itest.ITestRawClientAdapter#getClient()\n *\/\n @Override protected RawClient getClient() throws IOException {\n HTTPClientConfig config = new HTTPClientConfig.Builder().withHost(Hosts.RIAK_HOST).build();\n return HTTPRiakClientFactory.getInstance().newClient(config);\n }\n\n}\n","new_contents":"\/*\n * This file is provided to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\n * License for the specific language governing permissions and limitations under\n * the License.\n *\/\npackage com.basho.riak.client.raw.itest;\n\nimport java.io.IOException;\n\nimport com.basho.riak.client.http.Hosts;\nimport com.basho.riak.client.raw.RawClient;\nimport com.basho.riak.client.raw.http.HTTPClientConfig;\nimport com.basho.riak.client.raw.http.HTTPRiakClientFactory;\n\n\/**\n * @author russell\n * \n *\/\npublic class ITestHTTPClientAdapter extends ITestRawClientAdapter {\n\n \/*\n * (non-Javadoc)\n * \n * @see com.basho.riak.client.raw.itest.ITestRawClientAdapter#getClient()\n *\/\n @Override protected RawClient getClient() throws IOException {\n HTTPClientConfig config = new HTTPClientConfig.Builder().withUrl(Hosts.RIAK_URL).build();\n return HTTPRiakClientFactory.getInstance().newClient(config);\n }\n\n}\n","subject":"Add URL config to HTTP client adapter itest"} {"old_contents":"package com.cflint.plugins.core;\n\nimport ro.fortsoft.pf4j.Extension;\nimport cfml.parsing.cfscript.CFFunctionExpression;\nimport cfml.parsing.cfscript.script.CFAbortStatement;\nimport cfml.parsing.cfscript.script.CFExpressionStatement;\nimport cfml.parsing.cfscript.script.CFScriptStatement;\n\nimport com.cflint.BugInfo;\nimport com.cflint.BugList;\nimport com.cflint.plugins.CFLintScannerAdapter;\nimport com.cflint.plugins.Context;\n\n@Extension\npublic class AbortChecker extends CFLintScannerAdapter {\n\tfinal String severity = \"WARNING\";\n\n\tpublic void expression(final CFScriptStatement expression, final Context context, final BugList bugs) {\n\t\tSystem.out.println(expression.getClass().getName());\n\n\t\tif (expression instanceof CFAbortStatement) {\n\t\t\tint lineNo = ((CFAbortStatement) expression).getLine();\n\t\t\tbugs.add(new BugInfo.BugInfoBuilder().setLine(lineNo).setMessageCode(\"AVOID_USING_ABORT\")\n\t\t\t\t.setSeverity(severity).setFilename(context.getFilename())\n\t\t\t\t.setMessage(\"Abort statement at \" + lineNo + \". Avoid using abort in production code.\")\n\t\t\t\t.build());\n\t\t}\n\t}\n}","new_contents":"package com.cflint.plugins.core;\n\nimport ro.fortsoft.pf4j.Extension;\nimport cfml.parsing.cfscript.CFFunctionExpression;\nimport cfml.parsing.cfscript.script.CFAbortStatement;\nimport cfml.parsing.cfscript.script.CFExpressionStatement;\nimport cfml.parsing.cfscript.script.CFScriptStatement;\n\nimport com.cflint.BugInfo;\nimport com.cflint.BugList;\nimport com.cflint.plugins.CFLintScannerAdapter;\nimport com.cflint.plugins.Context;\n\n@Extension\npublic class AbortChecker extends CFLintScannerAdapter {\n\tfinal String severity = \"WARNING\";\n\t\n\t@Override\n\tpublic void expression(final CFScriptStatement expression, final Context context, final BugList bugs) {\n\t\tif (expression instanceof CFAbortStatement) {\n\t\t\tint lineNo = ((CFAbortStatement) expression).getLine() + context.startLine() - 1;\n\t\t\tbugs.add(new BugInfo.BugInfoBuilder().setLine(lineNo).setMessageCode(\"AVOID_USING_ABORT\")\n\t\t\t\t.setSeverity(severity).setFilename(context.getFilename())\n\t\t\t\t.setMessage(\"Abort statement at line \" + lineNo + \". Avoid using abort in production code.\")\n\t\t\t\t.build());\n\t\t}\n\t}\n}","subject":"Remove debug and fix line number"} {"old_contents":"package org.recap.route;\n\nimport org.apache.camel.Exchange;\nimport org.apache.camel.Processor;\nimport org.apache.camel.impl.DefaultMessage;\nimport org.recap.model.jpa.ReportEntity;\nimport org.recap.repository.ReportDetailRepository;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Component;\nimport org.springframework.util.CollectionUtils;\n\nimport java.util.List;\n\n\/**\n * Created by peris on 8\/20\/16.\n *\/\n@Component\npublic class XMLFileLoadValidator implements Processor {\n\n @Autowired\n ReportDetailRepository reportDetailRepository;\n\n @Override\n public void process(Exchange exchange) throws Exception {\n String camelFileName = (String) exchange.getIn().getHeader(\"CamelFileName\");\n\n List reportEntity =\n reportDetailRepository.findByFileName(camelFileName);\n\n if(!CollectionUtils.isEmpty(reportEntity)){\n DefaultMessage defaultMessage = new DefaultMessage();\n defaultMessage.setBody(\"\");\n exchange.setIn(defaultMessage);\n exchange.setOut(defaultMessage);\n }\n }\n}\n","new_contents":"package org.recap.route;\n\nimport org.apache.camel.Exchange;\nimport org.apache.camel.Processor;\nimport org.apache.camel.impl.DefaultMessage;\nimport org.recap.model.jpa.ReportEntity;\nimport org.recap.repository.ReportDetailRepository;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Component;\nimport org.springframework.util.CollectionUtils;\n\nimport java.util.List;\n\n\/**\n * Created by peris on 8\/20\/16.\n *\/\n@Component\npublic class XMLFileLoadValidator implements Processor {\n\n @Autowired\n ReportDetailRepository reportDetailRepository;\n\n \/**\n * Check to see if the xml file has been loaded already. If so, set empty body such that the file doesn't get\n * processed again.\n * @param exchange\n * @throws Exception\n *\/\n @Override\n public void process(Exchange exchange) throws Exception {\n String camelFileName = (String) exchange.getIn().getHeader(\"CamelFileName\");\n\n List reportEntity =\n reportDetailRepository.findByFileName(camelFileName);\n\n if(!CollectionUtils.isEmpty(reportEntity)){\n DefaultMessage defaultMessage = new DefaultMessage();\n defaultMessage.setBody(\"\");\n exchange.setIn(defaultMessage);\n exchange.setOut(defaultMessage);\n }\n }\n}\n","subject":"Check to validated xml file has been loaded already; if so, dont load it again."} {"old_contents":"package Functions;\nimport javax.swing.*;\nimport javax.swing.border.*;\n\nimport Elements.Element;\n\nimport java.awt.*;\n\npublic class ElementPanel extends JPanel \n{\n\tprivate Element element;\n\t\n\tpublic ElementPanel(Element element)\n\t{\n\t\tthis.element = element;\n\t\tif(element != null)\n\t\t{\n\t\t\tString name = element.getSymbol();\n\t\t\tif(element.getName().equals(\"Lanthanum\"))\n\t\t\t{\n\t\t\t\tname = \"*\" + name;\n\t\t\t}\n\t\t\tif(element.getName().equals(\"Barium\"))\n\t\t\t{\n\t\t\t\tname += \"*\";\n\t\t\t}\n\t\t\tif(element.getName().equals(\"Actinium\"))\n\t\t\t{\n\t\t\t\tname = \"**\" + name;\n\t\t\t}\n\t\t\tif(element.getName().equals(\"Radium\"))\n\t\t\t{\n\t\t\t\tname += \"**\";\n\t\t\t}\n\t\t\t\n\t\t\tadd(new JLabel(name));\n\t\t\tsetBorder(new CompoundBorder(new LineBorder(Color.BLACK, 1), new EmptyBorder(6, 6, 6, 6)));\n\t\t}\n\t}\n\t\n\tpublic Element getElement()\n\t{\n\t\treturn element;\n\t}\n}\n","new_contents":"package Functions;\nimport javax.swing.*;\nimport javax.swing.border.*;\n\nimport Elements.Element;\n\nimport java.awt.*;\n\npublic class ElementPanel extends JPanel \n{\n\tprivate Element element;\n\t\n\tpublic ElementPanel(Element element)\n\t{\n\t\tthis.element = element;\n\t\tif(element != null)\n\t\t{\n\t\t\tString name = element.getSymbol();\n\t\t\tif(element.getName().equals(\"Lanthanum\"))\n\t\t\t{\n\t\t\t\tname = \"*\" + name;\n\t\t\t}\n\t\t\tif(element.getName().equals(\"Barium\"))\n\t\t\t{\n\t\t\t\tname += \"*\";\n\t\t\t}\n\t\t\tif(element.getName().equals(\"Actinium\"))\n\t\t\t{\n\t\t\t\tname = \"**\" + name;\n\t\t\t}\n\t\t\tif(element.getName().equals(\"Radium\"))\n\t\t\t{\n\t\t\t\tname += \"**\";\n\t\t\t}\n\t\t\t\n\t\t\tthis.setLayout(new GridBagLayout());\n\t\t\tGridBagConstraints c = new GridBagConstraints();\n\t\t\tc.ipady = -5;\n\t\t\tc.gridy = 0;\n\t\t\tadd(new JLabel(\"\" + element.getNum()), c);\n\n\t\t\tc.gridy = 1;\n\t\t\tadd(new JLabel(\"

\" + name + \"<\/h3><\/html>\"), c);\n\t\t\t\n\t\t\tc.gridy = 2;\n\t\t\tc.ipady = 0;\n\t\t\tadd(new JLabel(\"\" + element.getName() + \"<\/font><\/html>\"), c);\n\t\t\t\n\t\t\tsetBorder(new CompoundBorder(new LineBorder(Color.BLACK, 1), new EmptyBorder(3, 3, 3, 3)));\n\t\t\t\n\t\t\t\/*add(new JLabel(\"\" + element.getNum() + \"

\" + name + \"<\/h1>
\" + element.getName() + \"<\/center><\/html>\"));\n\t\t\tsetBorder(new CompoundBorder(new LineBorder(Color.BLACK, 1), new EmptyBorder(6, 6, 6, 6)));\n\t\t\tsetSize(50, 50);*\/\n\t\t}\n\t}\n\t\n\tpublic Element getElement()\n\t{\n\t\treturn element;\n\t}\n}\n","subject":"Revert \"Revert \"Made the periodic table different\"\""} {"old_contents":"package android.org.json;\n\nimport com.google.gwt.json.client.JSONParser;\n\n\/**\n * Proxy to the GWT class\n *\/\npublic class JSONObject {\n\n\tcom.google.gwt.json.client.JSONObject jsonObject;\n\n\tpublic JSONObject(String json) {\n\t\tjsonObject = JSONParser.parseStrict(json).isObject();\n\t}\n\n\tpublic String getString(String name) {\n\t\treturn jsonObject.get(name).toString();\n\t}\n\n\tpublic int getInt(String name) {\n\t\treturn Integer.valueOf(jsonObject.get(name).toString());\n\t}\n}\n","new_contents":"package android.org.json;\n\nimport com.google.gwt.json.client.JSONParser;\n\n\/**\n * Proxy to the GWT class\n *\/\npublic class JSONObject {\n\n\tcom.google.gwt.json.client.JSONObject jsonObject;\n\n\tpublic JSONObject(String json) {\n\t\tjsonObject = JSONParser.parseStrict(json).isObject();\n\t}\n\n\tpublic String getString(String name) {\n\t\treturn jsonObject.get(name).toString().replaceAll(\"^\\\"|\\\"$\", \"\");\n\t}\n\n\tpublic int getInt(String name) {\n\t\treturn Integer.valueOf(jsonObject.get(name).toString().replaceAll(\"^\\\"|\\\"$\", \"\"));\n\t}\n}\n","subject":"Remove quotation marks from JSON objects"} {"old_contents":"package org.jtrim2.build;\n\nimport java.io.IOException;\nimport org.gradle.api.Project;\n\nimport static org.jtrim2.build.BuildFileUtils.*;\n\npublic final class Versions {\n private static final String GROUP_NAME = \"org.jtrim2\";\n\n private static final String VERSION_BASE_PROPERTY = \"versionBase\";\n\n public static void setVersion(Project project) throws IOException {\n String suffix = ReleaseUtils.isRelease(project) ? \"\" : \"-SNAPSHOT\";\n\n String versionBase = readTextFile(rootPath(project, \"version.txt\")).trim();\n project.getExtensions().add(VERSION_BASE_PROPERTY, versionBase);\n\n project.setGroup(GROUP_NAME);\n project.setVersion(versionBase + suffix);\n }\n\n public static String getVersion(Project project) {\n Object version = project.getVersion();\n return version != null ? version.toString() : null;\n }\n\n public static String getVersionBase(Project project) {\n return ProjectUtils.getStringProperty(project, VERSION_BASE_PROPERTY, \"\");\n }\n\n private Versions() {\n throw new AssertionError();\n }\n}\n","new_contents":"package org.jtrim2.build;\n\nimport java.io.IOException;\nimport org.gradle.api.Project;\n\nimport static org.jtrim2.build.BuildFileUtils.*;\n\npublic final class Versions {\n private static final String GROUP_NAME = \"org.jtrim2\";\n\n private static final String VERSION_BASE_PROPERTY = \"versionBase\";\n private static final String VERSION_SUFFIX_PROPERTY = \"versionSuffix\";\n\n public static void setVersion(Project project) throws IOException {\n String versionBase = readTextFile(rootPath(project, \"version.txt\")).trim();\n project.getExtensions().add(VERSION_BASE_PROPERTY, versionBase);\n\n project.setGroup(GROUP_NAME);\n project.setVersion(versionBase + getVersionSuffix(project));\n }\n\n private static String getVersionSuffix(Project project) {\n boolean release = ReleaseUtils.isRelease(project);\n\n String defaultSuffix = release ? \"\" : \"SNAPSHOT\";\n String suffix = ProjectUtils.getStringProperty(project, VERSION_SUFFIX_PROPERTY, defaultSuffix);\n return suffix.isEmpty()\n ? \"\"\n : \"-\" + suffix;\n }\n\n public static String getVersion(Project project) {\n Object version = project.getVersion();\n return version != null ? version.toString() : null;\n }\n\n public static String getVersionBase(Project project) {\n return ProjectUtils.getStringProperty(project, VERSION_BASE_PROPERTY, \"\");\n }\n\n private Versions() {\n throw new AssertionError();\n }\n}\n","subject":"Build now allows to specify custom version suffix."} {"old_contents":"import java.util.*;\n\npublic class Solution {\n public int jump(int[] jumps) {\n if (jumps.length == 0) return 0;\n\n int lastIndex = jumps.length - 1;\n boolean[] visited = new boolean[jumps.length];\n LinkedList queue = new LinkedList();\n queue.add(0);\n int stepCount = 0;\n visited[0] = true;\n\n while (!queue.isEmpty()) {\n int queueSize = queue.size();\n for (int i = 0; i < queueSize; i++) {\n int index = queue.removeFirst();\n if (index == lastIndex) {\n return stepCount;\n }\n\n int maxJump = jumps[index];\n for (int jump = 1; jump <= maxJump; jump++) {\n int newIndex = index + jump;\n if (newIndex >= jumps.length) {\n break;\n }\n if (!visited[newIndex]) {\n visited[newIndex] = true;\n queue.addLast(newIndex);\n }\n }\n }\n\n stepCount++;\n }\n\n return stepCount;\n }\n}\n","new_contents":"import java.util.*;\n\npublic class Solution {\n public int jump(int[] jumps) {\n if (jumps.length == 0) return 0;\n if (jumps.length == 1) return 0;\n\n int lastIndex = jumps.length - 1;\n boolean[] visited = new boolean[jumps.length];\n LinkedList queue = new LinkedList();\n queue.add(0);\n int stepCount = 0;\n visited[0] = true;\n\n while (!queue.isEmpty()) {\n int queueSize = queue.size();\n for (int i = 0; i < queueSize; i++) {\n int index = queue.removeFirst();\n int maxIndex = Math.min(index + jumps[index], lastIndex);\n if (maxIndex == lastIndex) {\n return stepCount + 1;\n }\n\n for (int newIndex = maxIndex; newIndex > index; newIndex--) {\n if (visited[newIndex]) break;\n\n visited[newIndex] = true;\n queue.addLast(newIndex);\n }\n }\n\n stepCount++;\n }\n\n return stepCount;\n }\n}\n","subject":"Optimize jump game ii solution"} {"old_contents":"package bj.pranie.controller;\n\nimport bj.pranie.util.TimeUtil;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\nimport org.springframework.stereotype.Controller;\nimport org.springframework.ui.Model;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestMethod;\nimport org.springframework.web.servlet.ModelAndView;\n\nimport java.util.Calendar;\n\n\/**\n * Created by Sebastian Sokolowski on 12.10.16.\n *\/\n\n@Controller\npublic class IndexController {\n private final Logger log = LoggerFactory.getLogger(this.getClass());\n\n @RequestMapping(value = \"\/\", method = RequestMethod.GET)\n public ModelAndView index(Model model) {\n ModelAndView modelAndView = new ModelAndView(\"index\");\n modelAndView.addObject(\"time\", TimeUtil.getTime());\n log.debug(\"time\" + Calendar.getInstance().getTime().toString());\n\n return modelAndView;\n }\n}\n","new_contents":"package bj.pranie.controller;\n\nimport bj.pranie.entity.User;\nimport org.springframework.security.core.Authentication;\nimport org.springframework.security.core.context.SecurityContextHolder;\nimport org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestMethod;\n\n\/**\n * Created by Sebastian Sokolowski on 12.10.16.\n *\/\n\n@Controller\npublic class IndexController {\n\n @RequestMapping(value = \"\/\", method = RequestMethod.GET)\n public String index() {\n if (isAuthenticatedUser()) {\n return \"redirect:\/week\";\n }\n return \"index\";\n }\n\n private boolean isAuthenticatedUser() {\n Authentication authentication = SecurityContextHolder.getContext().getAuthentication();\n if (authentication.getPrincipal() instanceof User) {\n return true;\n }\n return false;\n }\n}\n","subject":"Implement auto redirect authenticated user to week page."} {"old_contents":"package no.stelar7.api.r4j.pojo.val.matchlist;\n\nimport java.io.Serializable;\nimport java.util.Objects;\n\npublic class MatchReference implements Serializable\n{\n private static final long serialVersionUID = -5301457261872587385L;\n \n private String matchId;\n private Long gameStartTime;\n private String teamId;\n \n public String getMatchId()\n {\n return matchId;\n }\n \n public Long getGameStartTime()\n {\n return gameStartTime;\n }\n \n public String getTeamId()\n {\n return teamId;\n }\n \n @Override\n public boolean equals(Object o)\n {\n if (this == o)\n {\n return true;\n }\n if (o == null || getClass() != o.getClass())\n {\n return false;\n }\n MatchReference match = (MatchReference) o;\n return Objects.equals(matchId, match.matchId) &&\n Objects.equals(gameStartTime, match.gameStartTime) &&\n Objects.equals(teamId, match.teamId);\n }\n \n @Override\n public int hashCode()\n {\n return Objects.hash(matchId, gameStartTime, teamId);\n }\n \n @Override\n public String toString()\n {\n return \"Match{\" +\n \"matchId='\" + matchId + '\\'' +\n \", gameStartTime=\" + gameStartTime +\n \", teamId='\" + teamId + '\\'' +\n '}';\n }\n}\n","new_contents":"package no.stelar7.api.r4j.pojo.val.matchlist;\n\nimport java.io.Serializable;\nimport java.util.Objects;\n\npublic class MatchReference implements Serializable\n{\n private static final long serialVersionUID = -5301457261872587385L;\n\n private String matchId;\n private Long gameStartTimeMillis;\n private String queueId;\n\n public String getMatchId()\n {\n return matchId;\n }\n\n public Long getGameStartTimeMillis()\n {\n return gameStartTimeMillis;\n }\n\n public String getQueueId()\n {\n return queueId;\n }\n\n @Override\n public boolean equals(Object o)\n {\n if (this == o)\n {\n return true;\n }\n if (o == null || getClass() != o.getClass())\n {\n return false;\n }\n MatchReference match = (MatchReference) o;\n return Objects.equals(matchId, match.matchId) &&\n Objects.equals(gameStartTimeMillis, match.gameStartTimeMillis) &&\n Objects.equals(queueId, match.queueId);\n }\n\n @Override\n public int hashCode()\n {\n return Objects.hash(matchId, gameStartTimeMillis, queueId);\n }\n\n @Override\n public String toString()\n {\n return \"Match{\" +\n \"matchId='\" + matchId + '\\'' +\n \", gameStartTimeMillis=\" + gameStartTimeMillis +\n \", queueId='\" + queueId + '\\'' +\n '}';\n }\n}\n","subject":"Fix property names to be related to response from riot valorant api"} {"old_contents":"package com.tobi.movies;\n\nimport android.support.annotation.IdRes;\nimport android.support.test.espresso.contrib.RecyclerViewActions;\n\nimport static android.support.test.espresso.Espresso.onView;\nimport static android.support.test.espresso.action.ViewActions.click;\nimport static android.support.test.espresso.assertion.ViewAssertions.matches;\nimport static android.support.test.espresso.matcher.ViewMatchers.*;\nimport static org.hamcrest.core.AllOf.allOf;\n\npublic abstract class Robot {\n\n protected T checkTextIsDisplayed(String text, @IdRes int view) {\n onView(allOf(withId(view), withText(text))).check(matches(isDisplayed()));\n return (T) this;\n }\n\n protected T selectPositionInRecyclerView(int position, @IdRes int recyclerView) {\n onView(withId(recyclerView))\n .perform(RecyclerViewActions.actionOnItemAtPosition(position, click()));\n return (T) this;\n }\n\n public K toRobot(Class robotClass) throws IllegalAccessException, InstantiationException {\n return robotClass.newInstance();\n }\n}\n","new_contents":"package com.tobi.movies;\n\nimport android.support.annotation.IdRes;\nimport android.support.test.espresso.contrib.RecyclerViewActions;\n\nimport static android.support.test.espresso.Espresso.onView;\nimport static android.support.test.espresso.action.ViewActions.click;\nimport static android.support.test.espresso.assertion.ViewAssertions.matches;\nimport static android.support.test.espresso.matcher.ViewMatchers.*;\nimport static org.hamcrest.core.AllOf.allOf;\n\npublic abstract class Robot {\n\n protected T checkTextIsDisplayed(String text, @IdRes int view) {\n onView(allOf(withId(view), withText(text))).check(matches(isDisplayed()));\n return (T) this;\n }\n\n protected T selectPositionInRecyclerView(int position, @IdRes int recyclerView) {\n onView(withId(recyclerView))\n .perform(RecyclerViewActions.actionOnItemAtPosition(position, click()));\n return (T) this;\n }\n\n public T waitFor(int seconds) throws InterruptedException {\n Thread.sleep(seconds * 1000);\n return (T) this;\n }\n\n\n public K toRobot(Class robotClass) throws IllegalAccessException, InstantiationException {\n return robotClass.newInstance();\n }\n}\n","subject":"Add sleep method to robot"} {"old_contents":"package com.box.l10n.mojito.aws.s3;\n\nimport com.amazonaws.auth.AWSCredentials;\nimport com.amazonaws.auth.AWSStaticCredentialsProvider;\nimport com.amazonaws.auth.BasicAWSCredentials;\nimport com.amazonaws.regions.Regions;\nimport com.amazonaws.services.s3.AmazonS3;\nimport com.amazonaws.services.s3.AmazonS3ClientBuilder;\nimport org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\n\n@Configuration\n@ConditionalOnProperty(\"l10n.aws.s3.enabled\")\npublic class AmazonS3Configuration {\n\n @Bean\n public AmazonS3 amazonS3Client(AmazonS3ConfigurationProperties amazonS3ConfigurationProperties) {\n AmazonS3ClientBuilder amazonS3ClientBuilder = AmazonS3ClientBuilder\n .standard()\n .withRegion(Regions.fromName(amazonS3ConfigurationProperties.getRegion()));\n\n if (amazonS3ConfigurationProperties.getAccessKeyId() != null) {\n AWSCredentials credentials = new BasicAWSCredentials(amazonS3ConfigurationProperties.getAccessKeyId(), amazonS3ConfigurationProperties.getAccessKeySecret());\n amazonS3ClientBuilder.withCredentials(new AWSStaticCredentialsProvider(credentials));\n }\n\n AmazonS3 amazonS3 = amazonS3ClientBuilder.build();\n return amazonS3;\n }\n}\n","new_contents":"package com.box.l10n.mojito.aws.s3;\n\nimport com.amazonaws.PredefinedClientConfigurations;\nimport com.amazonaws.auth.AWSCredentials;\nimport com.amazonaws.auth.AWSStaticCredentialsProvider;\nimport com.amazonaws.auth.BasicAWSCredentials;\nimport com.amazonaws.regions.Regions;\nimport com.amazonaws.services.s3.AmazonS3;\nimport com.amazonaws.services.s3.AmazonS3ClientBuilder;\nimport org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\n\n@Configuration\n@ConditionalOnProperty(\"l10n.aws.s3.enabled\")\npublic class AmazonS3Configuration {\n\n @Bean\n public AmazonS3 amazonS3Client(AmazonS3ConfigurationProperties amazonS3ConfigurationProperties) {\n AmazonS3ClientBuilder amazonS3ClientBuilder = AmazonS3ClientBuilder\n .standard()\n .withClientConfiguration(PredefinedClientConfigurations.defaultConfig().withGzip(true))\n .withRegion(Regions.fromName(amazonS3ConfigurationProperties.getRegion()));\n\n if (amazonS3ConfigurationProperties.getAccessKeyId() != null) {\n AWSCredentials credentials = new BasicAWSCredentials(amazonS3ConfigurationProperties.getAccessKeyId(), amazonS3ConfigurationProperties.getAccessKeySecret());\n amazonS3ClientBuilder.withCredentials(new AWSStaticCredentialsProvider(credentials));\n }\n\n AmazonS3 amazonS3 = amazonS3ClientBuilder.build();\n return amazonS3;\n }\n}\n","subject":"Use GZip compression in the Amazon S3 client to speed up large object transfer"} {"old_contents":"package com.github.aureliano.edocs.app.gui;\n\nimport java.awt.BorderLayout;\nimport java.awt.Dimension;\n\nimport javax.swing.JFrame;\nimport javax.swing.JPanel;\n\nimport com.github.aureliano.edocs.app.gui.menu.MenuBar;\n\npublic class AppFrame extends JFrame {\n\n\tprivate static final long serialVersionUID = 7618501026967569839L;\n\n\tpublic AppFrame() {\n\t\tthis.buildGui();\n\t}\n\t\n\tprivate void buildGui() {\n\t\tsuper.setTitle(\"e-Docs\");\n\t\tsuper.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\t\n\t\tJPanel panel = new JPanel(new BorderLayout());\n\t\tpanel.setOpaque(true);\n\t\tpanel.add(new VerticalToolBar(), BorderLayout.WEST);\n\t\t\n\t\tsuper.setContentPane(panel);\n\t\tsuper.setJMenuBar(new MenuBar());\n\t}\n\t\n\tpublic void showFrame() {\n\t\tsuper.pack();\n\t\tsuper.setVisible(true);\n\t\tsuper.setSize(new Dimension(500, 500));\n\t}\n}","new_contents":"package com.github.aureliano.edocs.app.gui;\n\nimport java.awt.BorderLayout;\nimport java.awt.Dimension;\n\nimport javax.swing.JFrame;\nimport javax.swing.JPanel;\n\nimport com.github.aureliano.edocs.app.gui.menu.MenuBar;\n\npublic class AppFrame extends JFrame {\n\n\tprivate static final long serialVersionUID = 7618501026967569839L;\n\n\tprivate TabbedPane tabbedPane;\n\t\n\tpublic AppFrame() {\n\t\tthis.buildGui();\n\t}\n\t\n\tprivate void buildGui() {\n\t\tsuper.setTitle(\"e-Docs\");\n\t\tsuper.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\t\n\t\tJPanel panel = new JPanel(new BorderLayout());\n\t\tpanel.setOpaque(true);\n\t\tpanel.add(new VerticalToolBar(), BorderLayout.WEST);\n\t\t\n\t\tthis.tabbedPane = new TabbedPane();\n\t\tpanel.add(this.tabbedPane, BorderLayout.CENTER);\n\t\t\n\t\tsuper.setContentPane(panel);\n\t\tsuper.setJMenuBar(new MenuBar());\n\t}\n\t\n\tpublic void showFrame() {\n\t\tsuper.pack();\n\t\tsuper.setVisible(true);\n\t\tsuper.setSize(new Dimension(500, 500));\n\t}\n}","subject":"Add tabbed pane to the center of the frame."} {"old_contents":"package com.phonegap.device;\n\nimport net.rim.device.api.script.Scriptable;\nimport net.rim.device.api.system.DeviceInfo;\n\npublic final class DeviceFeature extends Scriptable {\n\tpublic static final String FIELD_PLATFORM = \"platform\";\n\tpublic static final String FIELD_UUID = \"uuid\";\n\tpublic static final String FIELD_PHONEGAP = \"phonegap\";\n\t\n\tpublic Object getField(String name) throws Exception {\n\t\t\n\t\tif (name.equals(FIELD_PLATFORM)) {\n\t\t\treturn new String(DeviceInfo.getPlatformVersion());\n\t\t}\n\t\telse if (name.equals(FIELD_UUID)) {\n\t\t\treturn new Integer(DeviceInfo.getDeviceId());\n\t\t}\n\t\telse if (name.equals(FIELD_PHONEGAP)) {\n\t\t\treturn \"pre-0.92 EDGE\";\n\t\t}\n\t\t\n\t\treturn super.getField(name);\n\t}\n}\n\n\n\n\n\n\n","new_contents":"\/*\n * PhoneGap is available under *either* the terms of the modified BSD license *or* the\n * MIT License (2008). See http:\/\/opensource.org\/licenses\/alphabetical for full text.\n * \n * Copyright (c) 2005-2010, Nitobi Software Inc.\n * Copyright (c) 2010, IBM Corporation\n *\/\npackage com.phonegap.device;\n\nimport net.rim.device.api.script.Scriptable;\nimport net.rim.device.api.system.DeviceInfo;\n\n\/**\n * PhoneGap plugin that provides device information, including:\n * \n * - Device platform version (e.g. 2.13.0.95). Not to be confused with BlackBerry OS version.\n * - Unique device identifier (UUID).\n * - PhoneGap software version.\n *\/\npublic final class DeviceFeature extends Scriptable {\n\tpublic static final String FIELD_PLATFORM = \"platform\";\n\tpublic static final String FIELD_UUID = \"uuid\";\n\tpublic static final String FIELD_PHONEGAP = \"phonegap\";\n\t\n\tpublic Object getField(String name) throws Exception {\n\t\t\n\t\tif (name.equals(FIELD_PLATFORM)) {\n\t\t\treturn new String(DeviceInfo.getPlatformVersion());\n\t\t}\n\t\telse if (name.equals(FIELD_UUID)) {\n\t\t\treturn new Integer(DeviceInfo.getDeviceId());\n\t\t}\n\t\telse if (name.equals(FIELD_PHONEGAP)) {\n\t\t\treturn \"0.9.2\";\n\t\t}\n\t\t\n\t\treturn super.getField(name);\n\t}\n}\n","subject":"Change PhoneGap version to '0.9.2'."} {"old_contents":"package ru.job4j.array;\n\n\/**\n* Class BubbpleSort ti sort some arrays.\n* @author Eugene Lazarev mailto(helycopternicht@rambler.ru)\n* @since 27.03.2017\n*\/\npublic class BubbleSort {\n\t\/**\n\t* Method returns sorted array.\n\t* @param source - source array\n\t* @return sorded source array\n\t*\/\n\tpublic int[] sort(int[] source) {\n\t\tboolean sorted = false;\n\t\tint intend = 0;\n\t\twhile (!sorted) {\n\t\t\tsorted = true;\n\t\t\tfor (int i = 1; i < source.length; i++) {\n\t\t\t\tif (source[i - 1] > source[i]) {\n\t\t\t\t\tint temp = source[i - 1];\n\t\t\t\t\tsource[i - 1] = source[i];\n\t\t\t\t\tsource[i] = temp;\n\t\t\t\t\tsorted = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tintend++;\n\t\t}\n\t\treturn source;\n\t}\n}","new_contents":"package ru.job4j.array;\n\n\/**\n* Class BubbpleSort ti sort some arrays.\n* @author Eugene Lazarev mailto(helycopternicht@rambler.ru)\n* @since 27.03.2017\n*\/\npublic class BubbleSort {\n\t\/**\n\t* Method returns sorted array.\n\t* @param source - source array\n\t* @return sorded source array\n\t*\/\n\tpublic int[] sort(int[] source) {\n\t\tboolean sorted = false;\n\t\tint intend = 0;\n\t\twhile (!sorted) {\n\t\t\tsorted = true;\n\t\t\tfor (int i = 1; i < source.length - intend; i++) {\n\t\t\t\tif (source[i - 1] > source[i]) {\n\t\t\t\t\tint temp = source[i - 1];\n\t\t\t\t\tsource[i - 1] = source[i];\n\t\t\t\t\tsource[i] = temp;\n\t\t\t\t\tsorted = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tintend++;\n\t\t}\n\t\treturn source;\n\t}\n}","subject":"Fix unused variable in BubbpleSort class"} {"old_contents":"package com.cisco.trex.stateless.model.capture;\n\nimport com.fasterxml.jackson.annotation.JsonIgnoreProperties;\nimport com.fasterxml.jackson.annotation.JsonProperty;\n\n@JsonIgnoreProperties(ignoreUnknown = true)\npublic class CaptureMonitor {\n \n @JsonProperty(\"capture_id\")\n private int captureId;\n\n @JsonProperty(\"start_ts\")\n private long startTs;\n\n @JsonProperty(\"capture_id\")\n public int getcaptureId() {\n return captureId;\n }\n\n @JsonProperty(\"capture_id\")\n public void setcaptureId(int captureId) {\n this.captureId = captureId;\n }\n}\n","new_contents":"package com.cisco.trex.stateless.model.capture;\n\nimport com.fasterxml.jackson.annotation.JsonIgnoreProperties;\nimport com.fasterxml.jackson.annotation.JsonProperty;\n\n@JsonIgnoreProperties(ignoreUnknown = true)\npublic class CaptureMonitor {\n \n @JsonProperty(\"capture_id\")\n private int captureId;\n\n @JsonProperty(\"start_ts\")\n private long startTs;\n\n @JsonProperty(\"capture_id\")\n public int getCaptureId() {\n return captureId;\n }\n\n @JsonProperty(\"capture_id\")\n public void setCaptureId(int captureId) {\n this.captureId = captureId;\n }\n\n @JsonProperty(\"start_ts\")\n public long getStartTimeStamp() {\n return startTs;\n }\n\n @JsonProperty(\"start_ts\")\n public void setStartTimeStamp(long startTs) {\n this.startTs = startTs;\n }\n}\n","subject":"Add getter and setter for start_ts field."} {"old_contents":"package es.shyri.longoperationservice;\n\nimport android.app.Service;\nimport android.content.Intent;\nimport android.os.Binder;\nimport android.os.IBinder;\nimport android.support.annotation.Nullable;\n\n\/**\n * Created by Shyri on 01\/02\/2016.\n *\/\npublic class LongOperationService extends Service {\n\n private final IBinder mBinder = new LocalBinder();\n\n @Nullable\n @Override\n public IBinder onBind(Intent intent) {\n return mBinder;\n }\n }\n\n \/**\n * Class used for the client Binder. Because we know this service always\n * runs in the same process as its clients, we don't need to deal with IPC.\n *\/\n public class LocalBinder extends Binder {\n public LongOperationService getService() {\n \/\/ Return this instance of LocalService so clients can call public methods\n return LongOperationService.this;\n }\n }\n}\n","new_contents":"package es.shyri.longoperationservice;\n\nimport android.app.NotificationManager;\nimport android.app.Service;\nimport android.content.Intent;\nimport android.os.Binder;\nimport android.os.IBinder;\nimport android.support.annotation.Nullable;\nimport android.support.v7.app.NotificationCompat;\n\n\/**\n * Created by Shyri on 01\/02\/2016.\n *\/\npublic class LongOperationService extends Service {\n public static final int NOTIFICATION_ID = 1234;\n private NotificationManager nm;\n\n private final IBinder mBinder = new LocalBinder();\n\n public void onCreate() {\n super.onCreate();\n nm = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);\n\n }\n\n @Nullable\n @Override\n public IBinder onBind(Intent intent) {\n return mBinder;\n }\n }\n\n \/**\n * Class used for the client Binder. Because we know this service always\n * runs in the same process as its clients, we don't need to deal with IPC.\n *\/\n public class LocalBinder extends Binder {\n public LongOperationService getService() {\n \/\/ Return this instance of LocalService so clients can call public methods\n return LongOperationService.this;\n }\n }\n}\n","subject":"Add notification manager to service"} {"old_contents":"package app.android.gambit.remote;\n\n\nimport java.util.Date;\n\nimport android.text.format.Time;\n\n\npublic class InternetDateTime\n{\n\tprivate Time time;\n\n\tpublic InternetDateTime() {\n\t\ttime = new Time(Time.TIMEZONE_UTC);\n\t\ttime.setToNow();\n\t}\n\n\tpublic InternetDateTime(String dateTimeAsString) {\n\t\ttime = new Time(Time.TIMEZONE_UTC);\n\t\ttime.parse3339(dateTimeAsString);\n\t}\n\n\tpublic InternetDateTime(Date dateTimeAsUtcDate) {\n\t\ttime = new Time(Time.TIMEZONE_UTC);\n\t\ttime.set(dateTimeAsUtcDate.getTime());\n\t}\n\n\t@Override\n\tpublic String toString() {\n\t\treturn time.format3339(false);\n\t}\n\n\tpublic Date toDate() {\n\t\treturn new Date(time.toMillis(false));\n\t}\n\n\tpublic boolean isAfter(InternetDateTime dateTime) {\n\t\treturn time.after(dateTime.time);\n\t}\n\n\tpublic boolean isBefore(InternetDateTime dateTime) {\n\t\treturn time.before(dateTime.time);\n\t}\n}\n","new_contents":"package app.android.gambit.remote;\n\n\nimport java.util.Date;\n\nimport android.text.format.Time;\n\n\npublic class InternetDateTime\n{\n\tprivate final Time time;\n\n\tpublic InternetDateTime() {\n\t\ttime = new Time(Time.TIMEZONE_UTC);\n\t\ttime.setToNow();\n\t}\n\n\tpublic InternetDateTime(String dateTimeAsString) {\n\t\ttime = new Time(Time.TIMEZONE_UTC);\n\t\ttime.parse3339(dateTimeAsString);\n\t}\n\n\tpublic InternetDateTime(Date dateTimeAsUtcDate) {\n\t\ttime = new Time(Time.TIMEZONE_UTC);\n\t\ttime.set(dateTimeAsUtcDate.getTime());\n\t}\n\n\t@Override\n\tpublic String toString() {\n\t\treturn time.format3339(false);\n\t}\n\n\tpublic Date toDate() {\n\t\treturn new Date(time.toMillis(false));\n\t}\n\n\tpublic boolean isAfter(InternetDateTime dateTime) {\n\t\treturn time.after(dateTime.time);\n\t}\n\n\tpublic boolean isBefore(InternetDateTime dateTime) {\n\t\treturn time.before(dateTime.time);\n\t}\n}\n","subject":"Add final modifier to internet date-time field."} {"old_contents":"package org.rocket.network.props;\n\nimport org.rocket.network.MutProp;\nimport org.rocket.network.NetworkClient;\nimport org.rocket.network.PropId;\nimport org.rocket.network.PropValidator;\n\npublic class PropPresenceValidator implements PropValidator {\n private final PropId pid;\n\n public PropPresenceValidator(PropPresence annotation) {\n this.pid = PropIds.type(annotation.value());\n }\n\n @Override\n public void validate(NetworkClient client) {\n MutProp prop = client.getProp(pid);\n\n if (!prop.isDefined()) {\n throw new AssertionError(String.format(\n \"Prop %s must have a value\",\n prop.getId()));\n }\n }\n}\n","new_contents":"package org.rocket.network.props;\n\nimport org.rocket.network.MutProp;\nimport org.rocket.network.NetworkClient;\nimport org.rocket.network.PropId;\nimport org.rocket.network.PropValidator;\n\npublic class PropPresenceValidator implements PropValidator {\n private final PropId pid;\n private String messageError;\n\n public PropPresenceValidator(PropPresence annotation) {\n this.pid = PropIds.type(annotation.value());\n this.messageError = String.format(\n \"Prop %s must have a value\", pid);\n }\n\n @Override\n public void validate(NetworkClient client) {\n MutProp prop = client.getProp(pid);\n\n if (!prop.isDefined()) {\n throw new AssertionError(messageError);\n }\n }\n}\n","subject":"Build the error message earlier"} {"old_contents":"package com.malpo.sliver.sample.ui.number;\n\nimport com.malpo.sliver.sample.models.Number;\n\nimport timber.log.Timber;\n\nclass NumberPresenter implements NumberContract.Presenter {\n\n private NumberContract.View view;\n\n private NumberContract.Interactor interactor;\n\n private NumberMapper mapper;\n\n NumberPresenter(NumberContract.Interactor interactor) {\n this.interactor = interactor;\n this.mapper = new NumberMapper();\n }\n\n @Override\n public void setView(NumberContract.View view) {\n this.view = view;\n }\n\n @Override\n public void setupView() {\n \/\/TODO Figure out how to unsubscribe\n interactor.getNumber().subscribe(this::displayNumber);\n interactor.onNumberUpdated().subscribe(this::onNumberUpdated);\n }\n\n @Override\n public void onNumberUpdated(Number number) {\n Timber.d(\"Number updated to: %d\", number.value);\n displayNumber(number);\n }\n\n @Override\n public void incrementNumberBy10() {\n Timber.d(\"Incrementing number by 10\");\n interactor.incrementNumberBy(10);\n }\n\n private void displayNumber(Number number) {\n view.display(mapper.map(number));\n }\n}\n","new_contents":"package com.malpo.sliver.sample.ui.number;\n\nimport com.malpo.sliver.sample.models.Number;\n\nimport timber.log.Timber;\n\nclass NumberPresenter implements NumberContract.Presenter {\n\n private NumberContract.View view;\n\n private NumberContract.Interactor interactor;\n\n private NumberMapper mapper;\n\n NumberPresenter(NumberContract.Interactor interactor) {\n this.interactor = interactor;\n this.mapper = new NumberMapper();\n }\n\n @Override\n public void setView(NumberContract.View view) {\n this.view = view;\n }\n\n @Override\n public void setupView() {\n \/\/TODO Figure out how to unsubscribe\n interactor.getNumber().subscribe(this::onNumberUpdated);\n interactor.onNumberUpdated().subscribe(this::onNumberUpdated);\n }\n\n @Override\n public void onNumberUpdated(Number number) {\n Timber.d(\"Number updated to: %d\", number.value);\n view.display(mapper.map(number));\n }\n\n @Override\n public void incrementNumberBy10() {\n Timber.d(\"Incrementing number by 10\");\n interactor.incrementNumberBy(10);\n }\n}\n","subject":"Use Overriden, not private method to interact with presenter"} {"old_contents":"package com.amalgam.view;\n\nimport android.content.res.Resources;\nimport android.util.DisplayMetrics;\nimport android.view.WindowManager;\n\npublic final class ViewUtils {\n private ViewUtils() {}\n\n \/**\n * Convert the dips to pixels, based on density scale\n *\n * @param resources application resources\n * @param dip to be converted value\n * @return converted value(px)\n *\/\n public static int dipToPixel(Resources resources, int dip) {\n final float scale = resources.getDisplayMetrics().density;\n \/\/ add 0.5f to round the figure up to the nearest whole number\n return (int) (dip * scale + 0.5f);\n }\n\n \/**\n * Convert the pixels to dips, based on density scale\n * @param windowManager the window manager of the display to use the scale density of\n * @param pixel\n * @return converted value(dip)\n *\/\n public static float pixelToDip(WindowManager windowManager, int pixel) {\n float dip = 0;\n DisplayMetrics metrics = new DisplayMetrics();\n windowManager.getDefaultDisplay().getMetrics(metrics);\n dip = metrics.scaledDensity * pixel;\n return dip;\n }\n}","new_contents":"package com.amalgam.view;\n\nimport android.content.Context;\nimport android.content.res.Resources;\nimport android.hardware.display.DisplayManager;\nimport android.util.DisplayMetrics;\nimport android.view.WindowManager;\n\nimport com.amalgam.content.ContextUtils;\n\npublic final class ViewUtils {\n private ViewUtils() {}\n\n public static int dipToPixel(Context context, int dip) {\n return dipToPixel(context.getResources(), dip);\n }\n\n \/**\n * Convert the dips to pixels, based on density scale\n *\n * @param resources application resources\n * @param dip to be converted value\n * @return converted value(px)\n *\/\n public static int dipToPixel(Resources resources, int dip) {\n final float scale = resources.getDisplayMetrics().density;\n \/\/ add 0.5f to round the figure up to the nearest whole number\n return (int) (dip * scale + 0.5f);\n }\n\n public static float pixelToDip(Context context, int pixel) {\n return pixelToDip(ContextUtils.getWindowManager(context), pixel);\n }\n\n \/**\n * Convert the pixels to dips, based on density scale\n * @param windowManager the window manager of the display to use the scale density of\n * @param pixel\n * @return converted value(dip)\n *\/\n public static float pixelToDip(WindowManager windowManager, int pixel) {\n DisplayMetrics metrics = new DisplayMetrics();\n windowManager.getDefaultDisplay().getMetrics(metrics);\n return metrics.scaledDensity * pixel;\n }\n\n public static float sipToPixel(Context context, float sip) {\n return sipToPixel(context.getResources(), sip);\n }\n\n public static float sipToPixel(Resources resources, float sip) {\n float density = resources.getDisplayMetrics().scaledDensity;\n return sip * density;\n }\n\n public static float pixelToSip(Context context, float pixels) {\n DisplayMetrics metrics = new DisplayMetrics();\n float scaledDensity = metrics.scaledDensity;\n if (pixels == 0 || scaledDensity == 0) {\n return 1;\n }\n return pixels\/scaledDensity;\n }\n}","subject":"Add sip to pixel conversion"} {"old_contents":"\/*\n * Copyright 2017 ThoughtWorks, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\n\npackage com.thoughtworks.go.utils;\n\n\nimport java.util.Arrays;\nimport java.util.TreeSet;\n\npublic class AssertJava8 {\n private static TreeSet SUPPORTED_VERSIONS = new TreeSet<>(Arrays.asList(\n JavaVersion.VERSION_1_8,\n JavaVersion.VERSION_1_9,\n JavaVersion.VERSION_1_10\n ));\n\n public static void assertVMVersion() {\n checkSupported(JavaVersion.current());\n }\n\n private static void checkSupported(JavaVersion currentJavaVersion) {\n if (!SUPPORTED_VERSIONS.contains(currentJavaVersion)) {\n System.err.println(\"Running GoCD requires Java version >= \" + SUPPORTED_VERSIONS.first().name() +\n \" and <= \" + SUPPORTED_VERSIONS.last() +\n \". You are currently running with Java version \" + currentJavaVersion + \". GoCD will now exit!\");\n System.exit(1);\n }\n }\n}\n","new_contents":"\/*\n * Copyright 2017 ThoughtWorks, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\n\npackage com.thoughtworks.go.utils;\n\n\nimport java.util.Arrays;\nimport java.util.TreeSet;\n\npublic class AssertJava8 {\n private static TreeSet SUPPORTED_VERSIONS = new TreeSet<>(Arrays.asList(\n JavaVersion.VERSION_1_8,\n JavaVersion.VERSION_1_9,\n JavaVersion.VERSION_1_10,\n JavaVersion.VERSION_11\n ));\n\n public static void assertVMVersion() {\n checkSupported(JavaVersion.current());\n }\n\n private static void checkSupported(JavaVersion currentJavaVersion) {\n if (!SUPPORTED_VERSIONS.contains(currentJavaVersion)) {\n System.err.println(\"Running GoCD requires Java version >= \" + SUPPORTED_VERSIONS.first().name() +\n \" and <= \" + SUPPORTED_VERSIONS.last() +\n \". You are currently running with Java version \" + currentJavaVersion + \". GoCD will now exit!\");\n System.exit(1);\n }\n }\n}\n","subject":"Include java 11 to supported list"} {"old_contents":"package beaform.events;\n\nimport static org.junit.Assert.assertEquals;\n\nimport java.text.SimpleDateFormat;\nimport java.util.Date;\n\nimport org.junit.After;\nimport org.junit.Before;\nimport org.junit.Test;\n\nimport beaform.utilities.SystemTime;\nimport beaform.utilities.TimeSource;\n\npublic class StoreEventTest {\n\n\t@Before\n\tpublic void setup() {\n\t\tSystemTime.setTimeSource(new TimeSource() {\n\t\t\tprivate final long timeInMillis = 0;\n\n\t\t\t@Override\n\t\t\tpublic long getSystemTime() {\n\t\t\t\treturn this.timeInMillis;\n\t\t\t}\n\t\t});\n\t}\n\n\t@After\n\tpublic void destroy() {\n\t\tSystemTime.reset();\n\t}\n\n\t@Test\n\tpublic void testEventString() {\n\t\t\/\/ Create a 'create' event for a new formula\n\t\tString name = \"TestFormula\";\n\t\tEvent createEvent = new FormulaCreatedEvent(name);\n\n\t\tDate timestamp = SystemTime.getAsDate();\n\t\tSimpleDateFormat df = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss.SSS\");\n\t\t\/\/ Check if the event converts to a string correctly\n\t\t\/\/ [timestamp] action properties\n\t\tassertEquals(\"[\" + df.format(timestamp) + \"] FormulaCreated \" + name, createEvent.toEventString());\n\t}\n\n}\n","new_contents":"package beaform.events;\n\nimport static org.junit.Assert.assertEquals;\n\nimport java.text.SimpleDateFormat;\nimport java.util.Date;\n\nimport org.junit.After;\nimport org.junit.Before;\nimport org.junit.Test;\n\nimport beaform.utilities.SystemTime;\nimport beaform.utilities.TimeSource;\n\npublic class StoreEventTest {\n\n\t@Before\n\tpublic void setup() {\n\t\tSystemTime.setTimeSource(new TimeSource() {\n\t\t\tprivate final long timeInMillis = 0;\n\n\t\t\t@Override\n\t\t\tpublic long getSystemTime() {\n\t\t\t\treturn this.timeInMillis;\n\t\t\t}\n\t\t});\n\t}\n\n\t@After\n\tpublic void destroy() {\n\t\tSystemTime.reset();\n\t}\n\n\t@Test\n\tpublic void testEventString() {\n\t\t\/\/ Create a 'create' event for a new formula\n\t\tString name = \"TestFormula\";\n\t\tEvent createEvent = new FormulaCreatedEvent(name);\n\n\t\tDate timestamp = SystemTime.getAsDate();\n\t\tSimpleDateFormat df = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss.SSS\");\n\t\tString expectedResult = \"[\" + df.format(timestamp) + \"] FormulaCreated \" + name;\n\t\t\/\/ Check if the event converts to a string correctly\n\t\t\/\/ [timestamp] action properties\n\t\tString assertMessageOnFail = \"Event format doesn't match with the expected one\";\n\t\tassertEquals(assertMessageOnFail, expectedResult, createEvent.toEventString());\n\t}\n\n}\n","subject":"Add a message for the failing assertion"} {"old_contents":"package algorithms.trees;\n\npublic class TreeHeightCalculator {\n\tprivate final int parents[];\n\n\t\/**\n\t * @param parents\n\t * defines index of parent for each node. Value -1 determines a root node\n\t *\/\n\tpublic TreeHeightCalculator(int parents[]) {\n\t\tthis.parents = parents;\n\t}\n\n\tpublic int computeHeight() {\n\t\tTreeNode root = createTree();\n\t\treturn recursiveHeightCalculation(root);\n\t}\n\n\tprivate TreeNode createTree() {\n\t\tTreeNode[] nodes = new TreeNode[parents.length];\n\t\tfor (int i = 0; i < parents.length; i++) {\n\t\t\tnodes[i] = new TreeNode();\n\t\t}\n\t\tTreeNode root = null;\n\t\tfor (int i = 0; i < parents.length; i++) {\n\t\t\tint parentId = parents[i];\n\t\t\tif (parentId >= 0) {\n\t\t\t\tnodes[i].setParent(nodes[parentId]);\n\t\t\t\tnodes[parentId].getChildren().add(nodes[i]);\n\t\t\t} else {\n\t\t\t\troot = nodes[i];\n\t\t\t}\n\t\t}\n\t\treturn root;\n\t}\n\n\tprivate int recursiveHeightCalculation(TreeNode treeNode) {\n\t\tint max = 0;\n\t\tfor (TreeNode child : treeNode.getChildren()) {\n\t\t\tint newMax = recursiveHeightCalculation(child);\n\t\t\tif (newMax > max) {\n\t\t\t\tmax = newMax;\n\t\t\t}\n\t\t}\n\t\treturn ++max;\n\t}\n}\n","new_contents":"package algorithms.trees;\n\npublic class TreeHeightCalculator {\n\tprivate final int parents[];\n\n\t\/**\n\t * @param parents\n\t * defines index of parent for each node. Value -1 determines a root node\n\t *\/\n\tpublic TreeHeightCalculator(int parents[]) {\n\t\tthis.parents = parents;\n\t}\n\n\t\/**\n\t * assumptions: there is exactly one root and the input represents a tree\n\t *\/\n\tpublic int computeHeight() {\n\t\tTreeNode root = createTree();\n\t\treturn recursiveHeightCalculation(root);\n\t}\n\n\tprivate TreeNode createTree() {\n\t\tTreeNode[] nodes = new TreeNode[parents.length];\n\t\tfor (int i = 0; i < parents.length; i++) {\n\t\t\tnodes[i] = new TreeNode();\n\t\t}\n\t\tTreeNode root = null;\n\t\tfor (int i = 0; i < parents.length; i++) {\n\t\t\tint parentId = parents[i];\n\t\t\tif (parentId >= 0) {\n\t\t\t\tnodes[i].setParent(nodes[parentId]);\n\t\t\t\tnodes[parentId].getChildren().add(nodes[i]);\n\t\t\t} else {\n\t\t\t\troot = nodes[i];\n\t\t\t}\n\t\t}\n\t\treturn root;\n\t}\n\n\tprivate int recursiveHeightCalculation(TreeNode treeNode) {\n\t\tint max = 0;\n\t\tfor (TreeNode child : treeNode.getChildren()) {\n\t\t\tint newMax = recursiveHeightCalculation(child);\n\t\t\tif (newMax > max) {\n\t\t\t\tmax = newMax;\n\t\t\t}\n\t\t}\n\t\treturn ++max;\n\t}\n}\n","subject":"Document prerequisites for the algorithm"} {"old_contents":"package oasis.web.authn;\n\nimport java.io.IOException;\nimport java.net.URI;\n\nimport javax.annotation.Priority;\nimport javax.inject.Inject;\nimport javax.ws.rs.container.ContainerRequestContext;\nimport javax.ws.rs.container.ContainerRequestFilter;\nimport javax.ws.rs.core.Response;\nimport javax.ws.rs.ext.Provider;\n\nimport oasis.urls.Urls;\nimport oasis.web.resteasy.Resteasy1099;\n\n\/**\n * Enforce the use of the {@link oasis.urls.Urls#canonicalBaseUri() canonical base URI}\n * for cookie-based authentication.\n *\/\n@User\n@Provider\n@Priority(0)\npublic class UserCanonicalBaseUriFilter implements ContainerRequestFilter {\n\n @Inject Urls urls;\n\n @Override\n public void filter(ContainerRequestContext requestContext) throws IOException {\n if (!urls.canonicalBaseUri().isPresent()) {\n return; \/\/ nothing to do\n }\n if (requestContext.getUriInfo().getBaseUri().equals(urls.canonicalBaseUri().get())) {\n return; \/\/ we're already on the canonical base URI\n }\n\n URI relativeUri = Resteasy1099.getBaseUri(requestContext.getUriInfo()).relativize(requestContext.getUriInfo().getRequestUri());\n URI canonicalUri = urls.canonicalBaseUri().get().resolve(relativeUri);\n\n requestContext.abortWith(Response.status(Response.Status.MOVED_PERMANENTLY)\n .location(canonicalUri)\n .build());\n }\n}\n","new_contents":"package oasis.web.authn;\n\nimport java.io.IOException;\nimport java.net.URI;\n\nimport javax.annotation.Priority;\nimport javax.inject.Inject;\nimport javax.ws.rs.container.ContainerRequestContext;\nimport javax.ws.rs.container.ContainerRequestFilter;\nimport javax.ws.rs.core.Response;\nimport javax.ws.rs.ext.Provider;\n\nimport oasis.urls.Urls;\nimport oasis.web.resteasy.Resteasy1099;\n\n\/**\n * Enforce the use of the {@link oasis.urls.Urls#canonicalBaseUri() canonical base URI}\n * for cookie-based authentication.\n *\/\n@User\n@Provider\n@Priority(0)\npublic class UserCanonicalBaseUriFilter implements ContainerRequestFilter {\n\n @Inject Urls urls;\n\n @Override\n public void filter(ContainerRequestContext requestContext) throws IOException {\n if (!urls.canonicalBaseUri().isPresent()) {\n return; \/\/ nothing to do\n }\n if (Resteasy1099.getBaseUri(requestContext.getUriInfo()).equals(urls.canonicalBaseUri().get())) {\n return; \/\/ we're already on the canonical base URI\n }\n\n URI relativeUri = Resteasy1099.getBaseUri(requestContext.getUriInfo()).relativize(requestContext.getUriInfo().getRequestUri());\n URI canonicalUri = urls.canonicalBaseUri().get().resolve(relativeUri);\n\n requestContext.abortWith(Response.status(Response.Status.MOVED_PERMANENTLY)\n .location(canonicalUri)\n .build());\n }\n}\n","subject":"Fix redirect loops in HTTPS when canonical-base-uri is configured"} {"old_contents":"package com.vk.api.sdk.objects.messages;\n\nimport com.google.gson.annotations.SerializedName;\n\n\/**\n * Message action type\n *\/\npublic enum Action {\n\n @SerializedName(\"chat_photo_update\")\n CHAT_PHOTO_UPDATE(\"chat_photo_update\"),\n\n @SerializedName(\"chat_photo_remove\")\n CHAT_PHOTO_REMOVE(\"chat_photo_remove\"),\n\n @SerializedName(\"chat_create\")\n CHAT_CREATE(\"chat_create\"),\n\n @SerializedName(\"chat_title_update\")\n CHAT_TITLE_UPDATE(\"chat_title_update\"),\n\n @SerializedName(\"chat_invite_user\")\n CHAT_INVITE_USER(\"chat_invite_user\"),\n\n @SerializedName(\"chat_kick_user\")\n CHAT_KICK_USER(\"chat_kick_user\");\n\n private final String value;\n\n Action(String value) {\n this.value = value;\n }\n\n public String getValue() {\n return value;\n }\n}\n","new_contents":"package com.vk.api.sdk.objects.messages;\n\nimport com.google.gson.annotations.SerializedName;\n\n\/**\n * Message action type\n *\/\npublic enum Action {\n\n @SerializedName(\"chat_photo_update\")\n CHAT_PHOTO_UPDATE(\"chat_photo_update\"),\n\n @SerializedName(\"chat_photo_remove\")\n CHAT_PHOTO_REMOVE(\"chat_photo_remove\"),\n\n @SerializedName(\"chat_create\")\n CHAT_CREATE(\"chat_create\"),\n\n @SerializedName(\"chat_title_update\")\n CHAT_TITLE_UPDATE(\"chat_title_update\"),\n\n @SerializedName(\"chat_invite_user\")\n CHAT_INVITE_USER(\"chat_invite_user\"),\n\n @SerializedName(\"chat_kick_user\")\n CHAT_KICK_USER(\"chat_kick_user\"),\n\n @SerializedName(\"chat_pin_message\")\n CHAT_PIN_MESSAGE(\"chat_pin_message\"),\n\n @SerializedName(\"chat_unpin_message\")\n CHAT_UNPIN_MESSAGE(\"chat_unpin_message\"),\n\n @SerializedName(\"chat_invite_user_by_link\")\n CHAT_INVITE_USER_BY_LINK(\"chat_invite_user_by_link\");\n\n private final String value;\n\n Action(String value) {\n this.value = value;\n }\n\n public String getValue() {\n return value;\n }\n}\n","subject":"Add missing field in 'action' for 'Message' object"} {"old_contents":"package com.faforever.client.legacy;\n\nimport com.faforever.client.os.OsUtils;\nimport org.springframework.context.annotation.Lazy;\nimport org.springframework.context.annotation.Profile;\nimport org.springframework.stereotype.Service;\n\nimport java.nio.file.Path;\n\n\n@Lazy\n@Service\n@Profile({\"unix\", \"mac\"})\npublic class UnixUidService implements UidService {\n\n @Override\n public String generate(String sessionId, Path logFile) {\n String uidDir = System.getProperty(\"uid.dir\", \"lib\");\n return OsUtils.execAndGetOutput(String.format(\"%s\/uid %s\", uidDir, sessionId));\n }\n}\n","new_contents":"package com.faforever.client.legacy;\n\nimport com.faforever.client.os.OsUtils;\nimport org.springframework.context.annotation.Lazy;\nimport org.springframework.context.annotation.Profile;\nimport org.springframework.stereotype.Service;\n\nimport java.nio.file.Path;\n\n\n@Lazy\n@Service\n@Profile({\"linux\", \"mac\"})\npublic class UnixUidService implements UidService {\n\n @Override\n public String generate(String sessionId, Path logFile) {\n String uidDir = System.getProperty(\"uid.dir\", \"lib\");\n return OsUtils.execAndGetOutput(String.format(\"%s\/uid %s\", uidDir, sessionId));\n }\n}\n","subject":"Fix UidService not loaded on linux"} {"old_contents":"\/*\n * Copyright 2017 - 2018 Volker Berlin (i-net software)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\npackage de.inetsoftware.jwebassembly;\n\nimport java.util.Arrays;\nimport java.util.Collection;\n\n\/**\n * @author Volker Berlin\n *\/\npublic enum ScriptEngine {\n NodeJS,\n SpiderMonkey,\n NodeWat,\n SpiderMonkeyWat,\n Wat2Wasm,\n ;\n\n public static Collection testParams() {\n ScriptEngine[][] val = { \/\/\n { ScriptEngine.SpiderMonkey }, \/\/\n { ScriptEngine.NodeJS }, \/\/\n { ScriptEngine.NodeWat }, \/\/\n\/\/ { ScriptEngine.SpiderMonkeyWat },\/\/\n { ScriptEngine.Wat2Wasm }, \/\/\n };\n return Arrays.asList(val);\n }\n}\n\n","new_contents":"\/*\n * Copyright 2017 - 2019 Volker Berlin (i-net software)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\npackage de.inetsoftware.jwebassembly;\n\nimport java.util.Arrays;\nimport java.util.Collection;\n\n\/**\n * @author Volker Berlin\n *\/\npublic enum ScriptEngine {\n NodeJS,\n SpiderMonkey,\n NodeWat,\n SpiderMonkeyWat,\n Wat2Wasm,\n ;\n\n public static Collection testParams() {\n ScriptEngine[][] val = { \/\/\n { ScriptEngine.SpiderMonkey }, \/\/\n { ScriptEngine.NodeJS }, \/\/\n { ScriptEngine.NodeWat }, \/\/\n { ScriptEngine.SpiderMonkeyWat },\/\/\n { ScriptEngine.Wat2Wasm }, \/\/\n };\n return Arrays.asList(val);\n }\n}\n\n","subject":"Enable tests with SpiderMonkey WasmTextToBinary()"} {"old_contents":"\/*\n * MIT License\n *\n * Copyright (c) 2017 Hindol Adhya\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\n * https:\/\/github.com\/Hindol\/commons\n *\/\n\npackage net.aeronica.mods.mxtune.caches;\n\n\/**\n * Interface definition for services.\n *\/\npublic interface Service {\n \/**\n * Starts the service. This method blocks until the service has completely started.\n *\/\n void start() throws Exception;\n\n \/**\n * Stops the service. This method blocks until the service has completely shut down.\n *\/\n void stop();\n}","new_contents":"\/*\n * MIT License\n *\n * Copyright (c) 2017 Hindol Adhya\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\n * https:\/\/github.com\/Hindol\/commons\n *\/\n\npackage net.aeronica.mods.mxtune.caches;\n\nimport net.aeronica.mods.mxtune.util.MXTuneException;\n\n\/**\n * Interface definition for services.\n *\/\npublic interface Service {\n \/**\n * Starts the service. This method blocks until the service has completely started.\n *\/\n void start() throws MXTuneException;\n\n \/**\n * Stops the service. This method blocks until the service has completely shut down.\n *\/\n void stop();\n}","subject":"Use an application defined exception."} {"old_contents":"package org.cryptonit.cloud.timestamping;\n\nimport org.cryptonit.cloud.interfaces.TimestampingPolicy;\n\npublic class Policy implements TimestampingPolicy {\n\n String identity;\n String policyId;\n\n public Policy(String identity, String policyId) {\n this.identity = identity;\n this.policyId = policyId;\n }\n\n @Override\n public String getIdentity() {\n return identity;\n }\n\n @Override\n public String getPolicyId() {\n return policyId;\n }\n}\n","new_contents":"package org.cryptonit.cloud.timestamping;\n\nimport org.cryptonit.cloud.interfaces.TimestampingPolicy;\n\npublic class Policy implements TimestampingPolicy {\n\n String identity;\n String policyId;\n String algorithm;\n\n public Policy(String identity, String policyId, String algorithm) {\n this.identity = identity;\n this.policyId = policyId;\n this.algorithm = algorithm;\n }\n\n @Override\n public String getIdentity() {\n return identity;\n }\n\n @Override\n public String getPolicyId() {\n return policyId;\n }\n\n public String getAlgorithm() {\n return algorithm;\n }\n}\n","subject":"Add algorithm field in class"} {"old_contents":"\/*\n * Copyright (c) 2012 Mateusz Parzonka, Eric Bodden\n * All rights reserved. This program and the accompanying materials\n * are made available under the terms of the Eclipse Public License v1.0\n * which accompanies this distribution, and is available at\n * http:\/\/www.eclipse.org\/legal\/epl-v10.html\n *\n * Contributors:\n * Mateusz Parzonka - initial API and implementation\n *\/\npackage prm4j.indexing.realtime;\n\nimport java.lang.ref.WeakReference;\n\nimport prm4j.indexing.map.MinimalMapEntry;\n\n\/**\n * A binding used by optimized indexing strategies.\n *\/\npublic interface LowLevelBinding extends prm4j.api.Binding, MinimalMapEntry{\n\n \/**\n * Releases all resources used in the indexing data structure and\/or notifies monitors about unreachability of the\n * parameter object. Amount of released resources can vary strongly with the implementation.\n *\/\n void release();\n\n \/**\n * Register a map where this binding is used.\n *\n * @param mapReference\n *\/\n void registerNode(WeakReference nodeReference); \/\/ TODO resource registration\n\n boolean isDisabled();\n\n void setDisabled(boolean disable);\n\n long getTimestamp();\n\n void setTimestamp(long timestamp);\n\n}\n","new_contents":"\/*\n * Copyright (c) 2012 Mateusz Parzonka, Eric Bodden\n * All rights reserved. This program and the accompanying materials\n * are made available under the terms of the Eclipse Public License v1.0\n * which accompanies this distribution, and is available at\n * http:\/\/www.eclipse.org\/legal\/epl-v10.html\n *\n * Contributors:\n * Mateusz Parzonka - initial API and implementation\n *\/\npackage prm4j.indexing.realtime;\n\nimport java.lang.ref.WeakReference;\n\nimport prm4j.indexing.map.MinimalMapEntry;\n\n\/**\n * A binding used by optimized indexing strategies.\n *\/\npublic interface LowLevelBinding extends prm4j.api.Binding, MinimalMapEntry{\n\n \/**\n * Releases all resources used in the indexing data structure and\/or notifies monitors about unreachability of the\n * parameter object. Amount of released resources can vary strongly with the implementation.\n *\/\n void release();\n\n \/**\n * Register a map which uses this binding as key.\n *\n * @param nodeRef\n *\/\n void registerNode(WeakReference nodeRef);\n\n boolean isDisabled();\n\n void setDisabled(boolean disable);\n\n long getTimestamp();\n\n void setTimestamp(long timestamp);\n\n}\n","subject":"Remove todo and add comment"} {"old_contents":"package me.androidbox.busbymovies;\n\nimport android.support.test.espresso.assertion.ViewAssertions;\nimport android.support.test.rule.ActivityTestRule;\nimport android.support.test.runner.AndroidJUnit4;\n\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\n\nimport me.androidbox.busbymovies.movielist.MovieListActivity;\n\nimport static android.support.test.espresso.Espresso.onView;\nimport static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;\nimport static android.support.test.espresso.matcher.ViewMatchers.withText;\n\n\/**\n * Created by steve on 2\/18\/17.\n *\/\n@RunWith(AndroidJUnit4.class)\npublic class MovieListViewImpTest {\n\n @Rule\n public final ActivityTestRule activityTestRule =\n new ActivityTestRule<>(MovieListActivity.class);\n\n @Test\n public void shouldDisplayCorrectTitleInToolbar() {\n onView(withText(R.string.app_name)).check(ViewAssertions.matches(isDisplayed()));\n }\n}\n","new_contents":"package me.androidbox.busbymovies;\n\nimport android.support.test.espresso.assertion.ViewAssertions;\nimport android.support.test.rule.ActivityTestRule;\nimport android.support.test.runner.AndroidJUnit4;\n\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\n\nimport me.androidbox.busbymovies.movielist.MovieListActivity;\nimport me.androidbox.busbymovies.utils.RecyclerViewAssertions;\n\nimport static android.support.test.espresso.Espresso.onView;\nimport static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;\nimport static android.support.test.espresso.matcher.ViewMatchers.withId;\nimport static android.support.test.espresso.matcher.ViewMatchers.withText;\nimport static org.hamcrest.Matchers.equalTo;\n\n\/**\n * Created by steve on 2\/18\/17.\n *\/\n@RunWith(AndroidJUnit4.class)\npublic class MovieListViewImpTest {\n\n @Rule\n public final ActivityTestRule activityTestRule =\n new ActivityTestRule<>(MovieListActivity.class);\n\n @Test\n public void shouldDisplayCorrectTitleInToolbar() {\n onView(withText(R.string.app_name)).check(ViewAssertions.matches(isDisplayed()));\n }\n\n @Test\n public void shouldDisplayTwentyItemsInRecyclerView() {\n onView(withId(R.id.rvMovieList))\n .check(new RecyclerViewAssertions(equalTo(20)));\n }\n}\n","subject":"Add matcher for the recyclerview to get the number of items to compare with"} {"old_contents":"\/*\n * Copyright (C) 2015 iychoi\n *\n * This program is free software; you can redistribute it and\/or\n * modify it under the terms of the GNU General Public License\n * as published by the Free Software Foundation; either version 2\n * of the License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program; if not, write to the Free Software\n * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n *\/\npackage biospectra.utils;\n\nimport java.io.File;\nimport java.io.FileFilter;\n\n\/**\n *\n * @author iychoi\n *\/\npublic class FastaFileFilter implements FileFilter {\n \n private String[] EXTENSIONS = {\n \".fa\",\n \".fa.gz\",\n \".ffn.gz\",\n \".ffn\",\n \".fna.gz\",\n \".fna\"\n };\n \n @Override\n public boolean accept(File file) {\n String lowername = file.getName().toLowerCase();\n \n for(String ext : EXTENSIONS) {\n if(lowername.endsWith(ext)) {\n return true;\n }\n }\n \n return false;\n }\n}\n","new_contents":"\/*\n * Copyright (C) 2015 iychoi\n *\n * This program is free software; you can redistribute it and\/or\n * modify it under the terms of the GNU General Public License\n * as published by the Free Software Foundation; either version 2\n * of the License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program; if not, write to the Free Software\n * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n *\/\npackage biospectra.utils;\n\nimport java.io.File;\nimport java.io.FileFilter;\n\n\/**\n *\n * @author iychoi\n *\/\npublic class FastaFileFilter implements FileFilter {\n \n private String[] EXTENSIONS = {\n \".fa\",\n \".fa.gz\",\n \".ffn.gz\",\n \".ffn\",\n \".fna.gz\",\n \".fna\",\n \".fasta\",\n \".fasta.gz\"\n };\n \n @Override\n public boolean accept(File file) {\n String lowername = file.getName().toLowerCase();\n \n for(String ext : EXTENSIONS) {\n if(lowername.endsWith(ext)) {\n return true;\n }\n }\n \n return false;\n }\n}\n","subject":"Add more extensions for fasta filter"} {"old_contents":"package t16b4.yats.logic.commands;\n\n\n\/**\n * Lists all persons in the address book to the user.\n *\/\npublic class ListCommand extends Command {\n\n public static final String COMMAND_WORD = \"list\";\n public static final String COMMAND_WORD_SUFFIX_TITLE = \"list title\";\n public static final String COMMAND_WORD_SUFFIX_DATE = \"list date\";\n public static final String COMMAND_WORD_SUFFIX_TAG = \"list tag\";\n\n public static final String MESSAGE_SUCCESS = \"Listed all items\";\n\n\n @Override\n public CommandResult execute() {\n model.updateFilteredListToShowAll();\n return new CommandResult(MESSAGE_SUCCESS);\n }\n}\n","new_contents":"package t16b4.yats.logic.commands;\n\n\n\/**\n * Lists all persons in the address book to the user.\n *\/\npublic class ListCommand extends Command {\n\n public static final String COMMAND_WORD = \"list\";\n public static final String COMMAND_WORD_EXTENTION = \"by\";\n public static final String COMMAND_WORD_SUFFIX_TITLE = \"title\";\n public static final String COMMAND_WORD_SUFFIX_DEADLINE = \"deadline\";\n public static final String COMMAND_WORD_SUFFIX_TIMING = \"timing\";\n public static final String COMMAND_WORD_SUFFIX_TAG = \"tag\";\n\n public static final String MESSAGE_SUCCESS = \"Listed all items\";\n\n\n @Override\n public CommandResult execute() {\n model.updateFilteredListToShowAll();\n return new CommandResult(MESSAGE_SUCCESS);\n }\n}\n","subject":"Add more command extension and suffix"} {"old_contents":"package com.example.activity;\n\nimport android.app.Activity;\nimport org.junit.runner.RunWith;\nimport org.robolectric.Robolectric;\nimport org.robolectric.RobolectricTestRunner;\n\nimport static org.junit.Assert.assertTrue;\n\n@RunWith(RobolectricTestRunner.class)\npublic class MainActivityTest {\n\n @org.junit.Test\n public void testSomething() throws Exception {\n Activity activity = Robolectric.setupActivity(MainActivity.class);\n assertTrue(activity.getTitle().toString().equals(\"Deckard\"));\n }\n}\n","new_contents":"package com.example.activity;\n\nimport android.app.Activity;\nimport org.junit.runner.RunWith;\nimport org.robolectric.Robolectric;\nimport org.robolectric.RobolectricTestRunner;\n\nimport static org.junit.Assert.assertTrue;\n\n@RunWith(RobolectricTestRunner.class)\npublic class MainActivityTest {\n\n @org.junit.Test\n public void titleIsCorrect() throws Exception {\n Activity activity = Robolectric.setupActivity(MainActivity.class);\n assertTrue(activity.getTitle().toString().equals(\"Deckard\"));\n }\n}\n","subject":"Rename test to be correct"} {"old_contents":"package com.amee.restlet;\n\nimport org.restlet.data.Status;\n\npublic interface Fault {\n\n public String getMessage();\n\n public Status getStatus();\n\n public String getCode();\n}\n","new_contents":"package com.amee.restlet;\n\nimport org.restlet.data.Status;\n\npublic interface Fault {\n\n String getMessage();\n\n Status getStatus();\n\n String getCode();\n}\n","subject":"Remove redundant access modifiers. PL-11097."} {"old_contents":"package sample.github.nisrulz.customview;\n\nimport android.content.Context;\nimport android.graphics.Canvas;\nimport android.graphics.Color;\nimport android.graphics.Paint;\nimport android.view.View;\n\npublic class CustomView extends View {\n\n Paint paint = new Paint();\n String text = \"Custom Text\";\n\n public CustomView(Context context) {\n super(context);\n\n paint.setColor(Color.BLACK);\n paint.setTextSize(30);\n }\n\n @Override protected void onDraw(Canvas canvas) {\n super.onDraw(canvas);\n\n setBackgroundColor(Color.BLUE);\n canvas.drawText(text, 100, 100, paint);\n\n }\n \n public void setText(String text) {\n this.text = text;\n invalidate();\n requestLayout();\n }\n\n\n}\n","new_contents":"package sample.github.nisrulz.customview;\n\nimport android.content.Context;\nimport android.graphics.Canvas;\nimport android.graphics.Color;\nimport android.graphics.Paint;\nimport android.view.View;\n\npublic class CustomView extends View {\n\n Paint paint = new Paint();\n String text = \"Custom Text\";\n\n public CustomView(Context context) {\n super(context);\n\n paint.setColor(Color.BLACK);\n paint.setTextSize(30);\n }\n\n @Override protected void onDraw(Canvas canvas) {\n super.onDraw(canvas);\n\n setBackgroundColor(Color.BLUE);\n canvas.drawText(text, 100, 100, paint);\n\n }\n \n public void setText(String text) {\n this.text = text;\n invalidate();\n }\n\n\n}\n","subject":"Revert \"Added call to `requestLayout()` after `invalidate()`\""} {"old_contents":"package edu.rice.cs.caper.bayou.application.dom_driver;\n\nimport java.io.BufferedReader;\nimport java.io.FileReader;\nimport java.io.IOException;\n\n\/**\n * Batch DOM Driver that can work with a list of files having the same config\n *\/\npublic class BatchDriver {\n\n public static void main(String args[]) throws IOException, InterruptedException {\n if (args.length != 2) {\n System.out.println(\"Usage: dom-driver-batch.jar file-containing-list-of-files.txt config.json\");\n return;\n }\n\n String listFile = args[0];\n String configFile = args[1];\n BufferedReader br = new BufferedReader(new FileReader(listFile));\n String file;\n int NPROCS = Runtime.getRuntime().availableProcessors();\n System.out.println(\"Going to run \" + NPROCS + \" threads\");\n\n while ((file = br.readLine()) != null) {\n System.out.println(file);\n String[] driverArgs = { \"-f\", file, \"-c\", configFile, \"-o\", file + \".json\" };\n Thread thread = new Thread(() -> Driver.main(driverArgs));\n while (Thread.activeCount() >= NPROCS)\n Thread.sleep(10);\n thread.start();\n }\n }\n\n}\n","new_contents":"\/*\nCopyright 2017 Rice University\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*\/\npackage edu.rice.cs.caper.bayou.application.dom_driver;\n\nimport java.io.BufferedReader;\nimport java.io.FileReader;\nimport java.io.IOException;\n\n\/**\n * Batch DOM Driver that can work with a list of files having the same config\n *\/\npublic class BatchDriver {\n\n public static void main(String args[]) throws IOException, InterruptedException {\n if (args.length != 2) {\n System.out.println(\"Usage: dom-driver-batch.jar file-containing-list-of-files.txt config.json\");\n return;\n }\n\n String listFile = args[0];\n String configFile = args[1];\n BufferedReader br = new BufferedReader(new FileReader(listFile));\n String file;\n int NPROCS = Runtime.getRuntime().availableProcessors();\n System.out.println(\"Going to run \" + NPROCS + \" threads\");\n\n while ((file = br.readLine()) != null) {\n System.out.println(file);\n String[] driverArgs = { \"-f\", file, \"-c\", configFile, \"-o\", file + \".json\" };\n Thread thread = new Thread(() -> Driver.main(driverArgs));\n while (Thread.activeCount() >= NPROCS)\n Thread.sleep(10);\n thread.start();\n }\n }\n\n}\n","subject":"Add license header to batch DOM driver class"} {"old_contents":"\/*\n * Copyright (c) 2016 Reto Inderbitzin (mail@indr.ch)\n *\n * For the full copyright and license information, please view\n * the LICENSE file that was distributed with this source code.\n *\/\n\npackage ch.indr.threethreefive.services;\n\nimport android.support.annotation.NonNull;\nimport android.support.annotation.Nullable;\n\nimport rx.Observable;\n\npublic interface Speaker {\n int LEVEL_URGENT = 1;\n int LEVEL_QUEUED = 2;\n int LEVEL_IDLE = 3;\n\n float SPEECH_RATE_NORMAL = 0.8f;\n float SPEECH_RATE_SLOW = 0.65f;\n\n void start();\n\n void stop();\n\n \/**\n * Call this when TTS is no longer needed.\n *\/\n void shutdown();\n\n \/**\n * Observable that emits initialization status of the tts engine and language settings.\n *\/\n Observable status();\n\n Observable utteranceStart();\n\n Observable utteranceDone();\n\n Observable utteranceError();\n\n @NonNull CommandSpeaker command();\n\n @NonNull InstructionsSpeaker instructions();\n\n @Nullable String sayUrgent(CharSequence speech);\n\n @Nullable String sayUrgent(CharSequence speech, float speechRate);\n\n @Nullable String sayUrgent(int resourceId);\n\n @Nullable String sayQueued(CharSequence speech);\n\n @Nullable String sayQueued(CharSequence speech, float speechRate);\n\n @Nullable String sayQueued(int resourceId);\n\n @Nullable String sayIdle(CharSequence speech);\n\n @Nullable String say(CharSequence speech, int level);\n}\n\n","new_contents":"\/*\n * Copyright (c) 2016 Reto Inderbitzin (mail@indr.ch)\n *\n * For the full copyright and license information, please view\n * the LICENSE file that was distributed with this source code.\n *\/\n\npackage ch.indr.threethreefive.services;\n\nimport android.support.annotation.NonNull;\nimport android.support.annotation.Nullable;\n\nimport rx.Observable;\n\npublic interface Speaker {\n int LEVEL_URGENT = 1;\n int LEVEL_QUEUED = 2;\n int LEVEL_IDLE = 3;\n\n float SPEECH_RATE_NORMAL = 1.0f;\n float SPEECH_RATE_SLOW = 0.8f;\n\n void start();\n\n void stop();\n\n \/**\n * Call this when TTS is no longer needed.\n *\/\n void shutdown();\n\n \/**\n * Observable that emits initialization status of the tts engine and language settings.\n *\/\n Observable status();\n\n Observable utteranceStart();\n\n Observable utteranceDone();\n\n Observable utteranceError();\n\n @NonNull CommandSpeaker command();\n\n @NonNull InstructionsSpeaker instructions();\n\n @Nullable String sayUrgent(CharSequence speech);\n\n @Nullable String sayUrgent(CharSequence speech, float speechRate);\n\n @Nullable String sayUrgent(int resourceId);\n\n @Nullable String sayQueued(CharSequence speech);\n\n @Nullable String sayQueued(CharSequence speech, float speechRate);\n\n @Nullable String sayQueued(int resourceId);\n\n @Nullable String sayIdle(CharSequence speech);\n\n @Nullable String say(CharSequence speech, int level);\n}\n\n","subject":"Set speech rates to 1.0\/0.8"} {"old_contents":"package net.minecraftforge.fml.common.launcher;\n\nimport net.minecraft.launchwrapper.LaunchClassLoader;\nimport net.minecraftforge.fml.relauncher.FMLLaunchHandler;\n\npublic class FMLServerTweaker extends FMLTweaker {\n @Override\n public String getLaunchTarget()\n {\n return \"net.minecraft.server.MinecraftServer\";\n }\n\n @Override\n public void injectIntoClassLoader(LaunchClassLoader classLoader)\n {\n \/\/ The mojang packages are excluded so the log4j2 queue is correctly visible from\n \/\/ the obfuscated and deobfuscated parts of the code. Without, the UI won't show anything\n classLoader.addClassLoaderExclusion(\"com.mojang.\");\n classLoader.addTransformerExclusion(\"net.minecraftforge.fml.repackage.\");\n classLoader.addTransformerExclusion(\"net.minecraftforge.fml.relauncher.\");\n classLoader.addTransformerExclusion(\"net.minecraftforge.fml.common.asm.transformers.\");\n classLoader.addClassLoaderExclusion(\"LZMA.\");\n FMLLaunchHandler.configureForServerLaunch(classLoader, this);\n FMLLaunchHandler.appendCoreMods();\n }\n}\n","new_contents":"package net.minecraftforge.fml.common.launcher;\n\nimport net.minecraft.launchwrapper.LaunchClassLoader;\nimport net.minecraftforge.fml.relauncher.FMLLaunchHandler;\n\npublic class FMLServerTweaker extends FMLTweaker {\n @Override\n public String getLaunchTarget()\n {\n return \"net.minecraft.server.MinecraftServer\";\n }\n\n @Override\n public void injectIntoClassLoader(LaunchClassLoader classLoader)\n {\n \/\/ The log4j2 queue is excluded so it is correctly visible from the obfuscated\n \/\/ and deobfuscated parts of the code. Without, the UI won't show anything\n classLoader.addClassLoaderExclusion(\"com.mojang.util.QueueLogAppender\");\n classLoader.addTransformerExclusion(\"net.minecraftforge.fml.repackage.\");\n classLoader.addTransformerExclusion(\"net.minecraftforge.fml.relauncher.\");\n classLoader.addTransformerExclusion(\"net.minecraftforge.fml.common.asm.transformers.\");\n classLoader.addClassLoaderExclusion(\"LZMA.\");\n FMLLaunchHandler.configureForServerLaunch(classLoader, this);\n FMLLaunchHandler.appendCoreMods();\n }\n}\n","subject":"Exclude only log4j2 queue from class loader"} {"old_contents":"package com.grayben.riskExtractor.headingMarker.elector;\n\nimport java.util.Collections;\nimport java.util.List;\n\nimport com.grayben.riskExtractor.headingMarker.nominator.NominatedText;\n\npublic class ElectedText\n\n extends\n NominatedText\n\n implements\n\t ElecteesRetrievable {\n\n \/\/TODO: make this a set: should not have repetitions\n List electees;\n\n public ElectedText(List textList, List nominees, List electees){\n super(textList, nominees);\n if (electees == null) {\n throw new NullPointerException(\"Attempted to pass illegal null argument\");\n }\n this.electees = electees;\n }\n\n public ElectedText(NominatedText nominatedText, List electees){\n super(nominatedText);\n if (electees == null) {\n throw new NullPointerException(\"Attempted to pass illegal null argument\");\n }\n this.electees = electees;\n }\n\n public ElectedText(ElectedText electedText){\n this(electedText, electedText.getElectees());\n }\n\n @Override\n public List getElectees() {\n return Collections.unmodifiableList(this.electees);\n }\n\n}\n","new_contents":"package com.grayben.riskExtractor.headingMarker.elector;\n\nimport java.util.Collections;\nimport java.util.List;\n\nimport com.grayben.riskExtractor.headingMarker.nominator.NominatedText;\n\npublic class ElectedText\n\n extends\n NominatedText\n\n implements\n\t ElecteesRetrievable {\n\n \/\/TODO: make this a set: should not have repetitions\n List electees;\n\n public ElectedText(List textList, List nominees, List electees){\n super(textList, nominees);\n if (electees == null) {\n throw new NullPointerException(\"Attempted to pass illegal null argument\");\n }\n if ( ! nominees.containsAll(electees))\n throw new IllegalArgumentException(\n \"The electees argument was not a subset \" +\n \"of the nominees argument\"\n );\n this.electees = electees;\n }\n\n public ElectedText(NominatedText nominatedText, List electees){\n this(\n nominatedText.getStringList(),\n nominatedText.getNominees(),\n electees\n );\n }\n\n public ElectedText(ElectedText electedText){\n this(electedText, electedText.getElectees());\n }\n\n @Override\n public List getElectees() {\n return Collections.unmodifiableList(this.electees);\n }\n\n}\n","subject":"Make init throw exception when electees not subset of nominees"} {"old_contents":"package io.core9.module.auth.standard;\n\nimport io.core9.plugin.database.repository.AbstractCrudEntity;\nimport io.core9.plugin.database.repository.Collection;\nimport io.core9.plugin.database.repository.CrudEntity;\n\nimport java.util.Set;\n\nimport org.apache.shiro.crypto.hash.Sha256Hash;\n\n@Collection(\"core.users\")\npublic class UserEntity extends AbstractCrudEntity implements CrudEntity {\n\t\n\tprivate String username;\n\tprivate String password;\n\tprivate String salt;\n\tprivate Set roles;\n\n\tpublic String getUsername() {\n\t\treturn username;\n\t}\n\n\tpublic void setUsername(String username) {\n\t\tthis.username = username;\n\t}\n\n\tpublic String getPassword() {\n\t\treturn password;\n\t}\n\n\tpublic void setPassword(String password) {\n\t\tthis.password = password;\n\t}\n\n\tpublic String getSalt() {\n\t\treturn salt;\n\t}\n\n\tpublic void setSalt(String salt) {\n\t\tthis.salt = salt;\n\t}\n\n\tpublic Set getRoles() {\n\t\treturn roles;\n\t}\n\n\tpublic void setRoles(Set roles) {\n\t\tthis.roles = roles;\n\t}\n\t\n\tpublic void hashPassword(String source) {\n\t\tthis.password = new Sha256Hash(source, salt).toString();\n\t}\n\n}\n","new_contents":"package io.core9.module.auth.standard;\n\nimport io.core9.plugin.database.repository.AbstractCrudEntity;\nimport io.core9.plugin.database.repository.Collection;\nimport io.core9.plugin.database.repository.CrudEntity;\n\nimport java.math.BigInteger;\nimport java.security.SecureRandom;\nimport java.util.Set;\n\nimport org.apache.shiro.crypto.hash.Sha256Hash;\n\n@Collection(\"core.users\")\npublic class UserEntity extends AbstractCrudEntity implements CrudEntity {\n\t\n\tprivate String username;\n\tprivate String password;\n\tprivate String salt;\n\tprivate Set roles;\n\n\tpublic String getUsername() {\n\t\treturn username;\n\t}\n\n\tpublic void setUsername(String username) {\n\t\tthis.username = username;\n\t}\n\n\tpublic String getPassword() {\n\t\treturn password;\n\t}\n\n\tpublic void setPassword(String password) {\n\t\tthis.password = password;\n\t}\n\n\tpublic String getSalt() {\n\t\treturn salt;\n\t}\n\n\tpublic void setSalt(String salt) {\n\t\tthis.salt = salt;\n\t}\n\n\tpublic Set getRoles() {\n\t\treturn roles;\n\t}\n\n\tpublic void setRoles(Set roles) {\n\t\tthis.roles = roles;\n\t}\n\t\n\tpublic void hashPassword(String source) {\n\t\tif(source == null) {\n\t\t\tSecureRandom random = new SecureRandom();\n\t\t\tsource = new BigInteger(130, random).toString(32);\n\t\t}\n\t\tthis.password = new Sha256Hash(source, salt).toString();\n\t}\n\n}\n","subject":"Create dummy password on null"} {"old_contents":"package io.castle.client.model;\n\nimport com.google.gson.annotations.SerializedName;\n\nimport java.util.List;\n\npublic class CastleUserDevices {\n int totalCount;\n @SerializedName(\"data\")\n List devices;\n\n public int getTotalCount() {\n return totalCount;\n }\n\n public void setTotalCount(int totalCount) {\n this.totalCount = totalCount;\n }\n\n public List getDevices() {\n return devices;\n }\n\n public void setDevices(List devices) {\n this.devices = devices;\n }\n}\n","new_contents":"package io.castle.client.model;\n\nimport com.google.gson.annotations.SerializedName;\n\nimport java.util.List;\n\npublic class CastleUserDevices {\n private int totalCount;\n @SerializedName(\"data\")\n private List devices;\n\n public int getTotalCount() {\n return totalCount;\n }\n\n public List getDevices() {\n return devices;\n }\n\n public void setDevices(List devices) {\n this.devices = devices;\n this.totalCount = devices != null ? devices.size() : 0;\n }\n}\n","subject":"Set totalCount field automatically in setter for devices"} {"old_contents":"package carpentersblocks.util.handler;\n\nimport carpentersblocks.tileentity.TEBase;\nimport carpentersblocks.tileentity.TECarpentersDaylightSensor;\nimport carpentersblocks.tileentity.TECarpentersFlowerPot;\nimport carpentersblocks.tileentity.TECarpentersSafe;\nimport carpentersblocks.tileentity.TECarpentersTorch;\nimport cpw.mods.fml.common.registry.GameRegistry;\n\npublic class TileEntityHandler {\n\n \/**\n * Registers tile entities.\n *\/\n public static void registerTileEntities()\n {\n GameRegistry.registerTileEntity( TEBase.class, \"TileEntityCarpentersBlock\");\n GameRegistry.registerTileEntity(TECarpentersDaylightSensor.class, \"TileEntityCarpentersDaylightSensor\");\n GameRegistry.registerTileEntity( TECarpentersTorch.class, \"TileEntityCarpentersTorch\");\n GameRegistry.registerTileEntity( TECarpentersSafe.class, \"TileEntityCarpentersSafe\");\n GameRegistry.registerTileEntity( TECarpentersFlowerPot.class, \"TileEntityCarpentersFlowerPot\");\n }\n\n}\n","new_contents":"package carpentersblocks.util.handler;\n\nimport carpentersblocks.tileentity.TEBase;\nimport carpentersblocks.tileentity.TECarpentersDaylightSensor;\nimport carpentersblocks.tileentity.TECarpentersFlowerPot;\nimport carpentersblocks.tileentity.TECarpentersSafe;\nimport carpentersblocks.tileentity.TECarpentersTorch;\nimport cpw.mods.fml.common.registry.GameRegistry;\n\npublic class TileEntityHandler {\n\n \/**\n * Registers tile entities.\n *\/\n public static void registerTileEntities()\n {\n GameRegistry.registerTileEntity( TEBase.class, \"TileEntityCarpentersBlock\");\n GameRegistry.registerTileEntity(TECarpentersDaylightSensor.class, \"TileEntityCarpentersDaylightSensor\");\n GameRegistry.registerTileEntity( TECarpentersTorch.class, \"TileEntityCarpentersTorch\");\n GameRegistry.registerTileEntity( TECarpentersSafe.class, \"TileEntityCarpentersSafe\");\n GameRegistry.registerTileEntity( TECarpentersFlowerPot.class, \"TileEntityCarpentersFlowerPot\");\n\n registerCompatibilityMappings();\n }\n\n \/**\n * Add tile entity class mappings needed to retain compatibility\n * with older versions of this mod.\n *\/\n private static void registerCompatibilityMappings()\n {\n GameRegistry.registerTileEntity( TEBase.class, \"TileEntityCarpentersSlope\"); \/\/ Mapping prior to MC 1.7+ migration\n GameRegistry.registerTileEntity(TECarpentersDaylightSensor.class, \"TileEntityCarpentersExt\"); \/\/ Mapping prior to MC 1.7+ migration\n }\n\n}\n","subject":"Add tile entity mappings to support 1.6.4 migrated worlds."} {"old_contents":"package com.obidea.semantika.cli2.command;\n\nimport com.obidea.semantika.cli2.runtime.ConsoleSession;\n\npublic class CommandFactory\n{\n public static Command create(String command, ConsoleSession session) throws Exception\n {\n if (startsWith(command, Command.SELECT)) {\n return new SelectCommand(command, session);\n }\n else if (startsWith(command, Command.SET_PREFIX)) {\n return new SetPrefixCommand(command, session);\n }\n else if (startsWith(command, Command.SHOW_PREFIXES)) {\n return new ShowPrefixesCommand(command, session);\n }\n throw new Exception(\"Unknown command\"); \/\/$NON-NLS-1$\n }\n\n private static boolean startsWith(String command, String keyword)\n {\n return command.startsWith(keyword) || command.startsWith(keyword.toUpperCase());\n }\n}\n","new_contents":"package com.obidea.semantika.cli2.command;\n\nimport com.obidea.semantika.cli2.runtime.ConsoleSession;\nimport com.obidea.semantika.cli2.runtime.UnknownCommandException;\n\npublic class CommandFactory\n{\n public static Command create(String command, ConsoleSession session) throws UnknownCommandException\n {\n if (startsWith(command, Command.SELECT)) {\n return new SelectCommand(command, session);\n }\n else if (startsWith(command, Command.SET_PREFIX)) {\n return new SetPrefixCommand(command, session);\n }\n else if (startsWith(command, Command.SHOW_PREFIXES)) {\n return new ShowPrefixesCommand(command, session);\n }\n throw new UnknownCommandException(); \/\/$NON-NLS-1$\n }\n\n private static boolean startsWith(String command, String keyword)\n {\n return command.startsWith(keyword) || command.startsWith(keyword.toUpperCase());\n }\n}\n","subject":"Use CommandUnknown exception in the method create."} {"old_contents":"package com.faforever.api.data.domain;\n\npublic enum Validity {\n \/\/ Order is crucial\n VALID,\n TOO_MANY_DESYNCS,\n WRONG_VICTORY_CONDITION,\n NO_FOG_OF_WAR,\n CHEATS_ENABLED,\n PREBUILT_ENABLED,\n NORUSH_ENABLED,\n BAD_UNIT_RESTRICTIONS,\n BAD_MAP,\n TOO_SHORT,\n BAD_MOD,\n COOP_NOT_RANKED,\n MUTUAL_DRAW,\n SINGLE_PLAYER,\n FFA_NOT_RANKED,\n UNEVEN_TEAMS_NOT_RANKED,\n UNKNOWN_RESULT,\n TEAMS_UNLOCKED,\n MULTIPLE_TEAMS,\n HAS_AI\n}\n","new_contents":"package com.faforever.api.data.domain;\n\npublic enum Validity {\n \/\/ Order is crucial\n VALID,\n TOO_MANY_DESYNCS,\n WRONG_VICTORY_CONDITION,\n NO_FOG_OF_WAR,\n CHEATS_ENABLED,\n PREBUILT_ENABLED,\n NORUSH_ENABLED,\n BAD_UNIT_RESTRICTIONS,\n BAD_MAP,\n TOO_SHORT,\n BAD_MOD,\n COOP_NOT_RANKED,\n MUTUAL_DRAW,\n SINGLE_PLAYER,\n FFA_NOT_RANKED,\n UNEVEN_TEAMS_NOT_RANKED,\n UNKNOWN_RESULT,\n TEAMS_UNLOCKED,\n MULTIPLE_TEAMS,\n HAS_AI,\n CIVILIANS_REVEALED,\n WRONG_DIFFICULTY,\n EXPANSION_DISABLED,\n SPAWN_NOT_FIXED\n}\n","subject":"Add validity states needed by some coop leaderboard checks"} {"old_contents":"\/*\n * Copyright 2016 Will Knez \n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\n\npackage com.solsticesquared.schelling;\n\n\/**\n * The main driver for the Schelling project.\n *\/\npublic final class AppEntry {\n\n \/**\n * The application entry point.\n *\n * @param args\n * The array of command line arguments, if any.\n *\/\n public static void main(final String[] args) {\n }\n\n \/**\n * Constructor (private).\n *\/\n private AppEntry() {\n }\n}\n","new_contents":"\/*\n * Copyright 2016 Will Knez \n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\n\npackage com.solsticesquared.schelling;\n\nimport com.solsticesquared.schelling.ui.SchellingExplorerConsole;\nimport com.solsticesquared.schelling.ui.SchellingExplorerWithUi;\nimport sim.display.Console;\nimport sim.display.GUIState;\nimport sim.engine.SimState;\n\nimport javax.swing.SwingUtilities;\n\n\/**\n * The main driver for the Schelling project.\n *\/\npublic final class AppEntry {\n\n \/**\n * The application entry point.\n *\n * @param args\n * The array of command line arguments, if any.\n *\/\n public static void main(final String[] args) {\n SwingUtilities.invokeLater(() -> {\n \/\/ The random number generation seed.\n final long seed = System.currentTimeMillis();\n\n \/\/ The underlying Schelling-based model.\n final SimState model =\n SchellingExplorerUtils.createTwoGroupModel(seed);\n \/\/ The user interface.\n final GUIState view = new SchellingExplorerWithUi(model);\n \/\/ The user interface controller.\n final Console controller = new SchellingExplorerConsole(view);\n\n \/\/ Run.\n controller.setVisible(true);\n });\n }\n\n \/**\n * Constructor (private).\n *\/\n private AppEntry() {\n }\n}\n","subject":"Update application entry point to use custom controller implementation."} {"old_contents":"package it.near.sdk.Utils;\n\nimport android.content.Intent;\n\nimport it.near.sdk.Reactions.Content.Content;\nimport it.near.sdk.Reactions.Coupon.Coupon;\nimport it.near.sdk.Reactions.CustomJSON.CustomJSON;\nimport it.near.sdk.Reactions.Feedback.Feedback;\nimport it.near.sdk.Reactions.Poll.Poll;\nimport it.near.sdk.Reactions.SimpleNotification.SimpleNotification;\n\n\/**\n * Interface for being notified of core content types.\n *\n * @author cattaneostefano\n *\/\npublic interface CoreContentsListener {\n void getPollNotification(Intent intent, Poll notification, String recipeId);\n void getContentNotification(Intent intent, Content notification, String recipeId);\n void getCouponNotification(Intent intent, Coupon notification, String recipeId);\n void getCustomJSONNotification(Intent intent, CustomJSON notification, String recipeId);\n void getSimpleNotification(Intent intent, SimpleNotification s_notif, String recipeId);\n void getFeedbackNotification(Intent intent, Feedback s_notif, String recipeId);\n}\n","new_contents":"package it.near.sdk.Utils;\n\nimport android.content.Intent;\nimport android.support.annotation.Nullable;\n\nimport it.near.sdk.Reactions.Content.Content;\nimport it.near.sdk.Reactions.Coupon.Coupon;\nimport it.near.sdk.Reactions.CustomJSON.CustomJSON;\nimport it.near.sdk.Reactions.Feedback.Feedback;\nimport it.near.sdk.Reactions.Poll.Poll;\nimport it.near.sdk.Reactions.SimpleNotification.SimpleNotification;\n\n\/**\n * Interface for being notified of core content types.\n *\n * @author cattaneostefano\n *\/\npublic interface CoreContentsListener {\n void getPollNotification(@Nullable Intent intent, Poll notification, String recipeId);\n void getContentNotification(@Nullable Intent intent, Content notification, String recipeId);\n void getCouponNotification(@Nullable Intent intent, Coupon notification, String recipeId);\n void getCustomJSONNotification(@Nullable Intent intent, CustomJSON notification, String recipeId);\n void getSimpleNotification(@Nullable Intent intent, SimpleNotification s_notif, String recipeId);\n void getFeedbackNotification(@Nullable Intent intent, Feedback s_notif, String recipeId);\n}\n","subject":"Add nullable to corecontentlistner methods parameters"} {"old_contents":"\nimport interfaces.*;\n\nimport java.net.ServerSocket;\nimport java.net.Socket;\nimport java.util.ArrayList;\nimport java.util.List;\n\n\/**\n * Chat Server for various clients\n *\/\npublic class MultiUserChatServer implements IChatServer {\n private List clients = new ArrayList<>();\n private ServerSocket ss;\n\n private static int PORT = 8200;\n\n public void setupServer() {\n try {\n ss = new ServerSocket(PORT);\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n\n public void waitForClients() {\n try {\n while (true) {\n Socket clientSocket = ss.accept();\n ConnectedClient client = new ConnectedClient(clientSocket, this);\n clients.add(client);\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n\n public List getClients() {\n return clients;\n }\n}\n","new_contents":"\nimport interfaces.*;\n\nimport java.net.ServerSocket;\nimport java.net.Socket;\nimport java.util.ArrayList;\nimport java.util.List;\n\n\/**\n * Chat Server for various clients\n *\/\npublic class MultiUserChatServer implements IChatServer {\n private List clients = new ArrayList<>();\n private ServerSocket ss;\n\n private static int PORT = 8200;\n\n public void setupServer() {\n try {\n ss = new ServerSocket(PORT);\n System.out.println(\"Server listening on port \" + PORT);\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n\n public void waitForClients() {\n try {\n while (true) {\n Socket clientSocket = ss.accept();\n ConnectedClient client = new ConnectedClient(clientSocket, this);\n System.out.println(\"New client connected from \" + clientSocket.getInetAddress().getHostAddress());\n clients.add(client);\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n\n public List getClients() {\n return clients;\n }\n}\n","subject":"Add some log messeges to server"} {"old_contents":"package com.iluwatar.callback;\n\n\/**\n * \n * Implementation of task that need to be executed\n * \n *\/\npublic class SimpleTask extends Task {\n\n\t@Override\n\tpublic void execute() {\n\t\tSystem.out.println(\"Perform some important activity.\");\n\t}\n\n}\n","new_contents":"package com.iluwatar.callback;\n\n\/**\n * \n * Implementation of task that need to be executed\n * \n *\/\npublic class SimpleTask extends Task {\n\n\t@Override\n\tpublic void execute() {\n\t\tSystem.out.println(\"Perform some important activity and after call the callback method.\");\n\t}\n\n}\n","subject":"Add unit test to show that the callback method is called."} {"old_contents":"\/*\n * Copyright (c) 1998-2014 by Richard A. Wilkes. All rights reserved.\n *\n * This Source Code Form is subject to the terms of the Mozilla Public License,\n * version 2.0. If a copy of the MPL was not distributed with this file, You\n * can obtain one at http:\/\/mozilla.org\/MPL\/2.0\/.\n *\n * This Source Code Form is \"Incompatible With Secondary Licenses\", as defined\n * by the Mozilla Public License, version 2.0.\n *\/\n\npackage com.trollworks.gcs.app;\n\nimport com.trollworks.toolkit.utility.Launcher;\n\n\/**\n * This class is to be compiled with Java 1.1 to allow it to be loaded and executed even on very old\n * JVM's.\n *\/\npublic class GCS {\n\tpublic static void main(String[] args) {\n\t\tLauncher.launch(\"1.8\", \"com.trollworks.gcs.app.GCS\", args); \/\/$NON-NLS-1$ \/\/$NON-NLS-2$\n\t}\n}\n","new_contents":"\/*\n * Copyright (c) 1998-2014 by Richard A. Wilkes. All rights reserved.\n *\n * This Source Code Form is subject to the terms of the Mozilla Public License,\n * version 2.0. If a copy of the MPL was not distributed with this file, You\n * can obtain one at http:\/\/mozilla.org\/MPL\/2.0\/.\n *\n * This Source Code Form is \"Incompatible With Secondary Licenses\", as defined\n * by the Mozilla Public License, version 2.0.\n *\/\n\npackage com.trollworks.gcs.app;\n\nimport com.trollworks.toolkit.utility.Launcher;\n\n\/**\n * This class is to be compiled with Java 1.1 to allow it to be loaded and executed even on very old\n * JVM's.\n *\/\npublic class GCS {\n\tpublic static void main(String[] args) {\n\t\tLauncher.launch(\"1.8\", \"com.trollworks.gcs.app.GCSMain\", args); \/\/$NON-NLS-1$ \/\/$NON-NLS-2$\n\t}\n}\n","subject":"Use the correct class name."} {"old_contents":"package de.slikey.effectlib.effect;\n\nimport de.slikey.effectlib.EffectManager;\nimport de.slikey.effectlib.EffectType;\nimport de.slikey.effectlib.util.RandomUtils;\nimport org.bukkit.Effect;\nimport org.bukkit.Location;\nimport org.bukkit.entity.Entity;\n\npublic class BleedEffect extends de.slikey.effectlib.Effect {\n\n \/**\n * Play the Hurt Effect for the Player\n *\/\n public boolean hurt = true;\n\n \/**\n * Height of the blood spurt\n *\/\n public double height = 1.75;\n\n \/**\n * Color of blood. Default is red (152)\n *\/\n public int color = 152;\n\n public BleedEffect(EffectManager effectManager) {\n super(effectManager);\n type = EffectType.REPEATING;\n period = 4;\n iterations = 25;\n }\n\n @Override\n public void onRun() {\n \/\/ Location to spawn the blood-item.\n Location location = getLocation();\n location.add(0, RandomUtils.random.nextFloat() * height, 0);\n location.getWorld().playEffect(location, Effect.STEP_SOUND, color);\n\n Entity entity = getEntity();\n if (hurt && entity != null) {\n entity.playEffect(org.bukkit.EntityEffect.HURT);\n }\n }\n}\n","new_contents":"package de.slikey.effectlib.effect;\n\nimport de.slikey.effectlib.EffectManager;\nimport de.slikey.effectlib.EffectType;\nimport de.slikey.effectlib.util.RandomUtils;\nimport org.bukkit.Effect;\nimport org.bukkit.Location;\nimport org.bukkit.Material;\nimport org.bukkit.entity.Entity;\n\npublic class BleedEffect extends de.slikey.effectlib.Effect {\n\n \/**\n * Play the Hurt Effect for the Player\n *\/\n public boolean hurt = true;\n\n \/**\n * Height of the blood spurt\n *\/\n public double height = 1.75;\n\n \/**\n * Color of blood. Default is red (152)\n *\/\n public Material material = Material.REDSTONE_BLOCK;\n\n public BleedEffect(EffectManager effectManager) {\n super(effectManager);\n type = EffectType.REPEATING;\n period = 4;\n iterations = 25;\n }\n\n @Override\n public void onRun() {\n \/\/ Location to spawn the blood-item.\n Location location = getLocation();\n location.add(0, RandomUtils.random.nextFloat() * height, 0);\n location.getWorld().playEffect(location, Effect.STEP_SOUND, material);\n\n Entity entity = getEntity();\n if (hurt && entity != null) {\n entity.playEffect(org.bukkit.EntityEffect.HURT);\n }\n }\n}\n","subject":"Change Bleed effect to use a material rather than a mysterious color id"} {"old_contents":"\/\/ ------------------------------------------------------------------------------\n\/\/ Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information.\n\/\/ ------------------------------------------------------------------------------\n\npackage com.microsoft.graph.models.extensions;\n\nimport com.microsoft.graph.concurrency.*;\nimport com.microsoft.graph.core.*;\nimport com.microsoft.graph.models.extensions.*;\nimport com.microsoft.graph.models.generated.*;\nimport com.microsoft.graph.http.*;\nimport com.microsoft.graph.requests.extensions.*;\nimport com.microsoft.graph.requests.generated.*;\nimport com.microsoft.graph.options.*;\nimport com.microsoft.graph.serializer.*;\n\nimport java.util.Arrays;\nimport java.util.EnumSet;\n\n\/\/ This file is available for extending, afterwards please submit a pull request.\n\n\/**\n * The class for the Planner Applied Categories.\n *\/\npublic class PlannerAppliedCategories extends BasePlannerAppliedCategories {\n\n}\n","new_contents":"\/\/ ------------------------------------------------------------------------------\n\/\/ Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information.\n\/\/ ------------------------------------------------------------------------------\n\npackage com.microsoft.graph.models.extensions;\n\nimport com.google.gson.annotations.Expose;\nimport com.google.gson.annotations.SerializedName;\nimport com.microsoft.graph.models.generated.BasePlannerAppliedCategories;\n\n\/\/ This file is available for extending, afterwards please submit a pull request.\n\n\/**\n * The class for the Planner Applied Categories.\n *\/\npublic class PlannerAppliedCategories extends BasePlannerAppliedCategories {\n\t\/**\n\t * The Category1\n\t *\/\n\t@SerializedName(\"category1\")\n\t@Expose\n\tpublic boolean category1;\n\t\n\t\/**\n\t * The Category1\n\t *\/\n\t@SerializedName(\"category2\")\n\t@Expose\n\tpublic boolean category2;\n\t\n\t\/**\n\t * The Category1\n\t *\/\n\t@SerializedName(\"category3\")\n\t@Expose\n\tpublic boolean category3;\n\t\n\t\/**\n\t * The Category1\n\t *\/\n\t@SerializedName(\"category4\")\n\t@Expose\n\tpublic boolean category4;\n\t\n\t\/**\n\t * The Category1\n\t *\/\n\t@SerializedName(\"category5\")\n\t@Expose\n\tpublic boolean category5;\n\t\n\t\/**\n\t * The Category1\n\t *\/\n\t@SerializedName(\"category6\")\n\t@Expose\n\tpublic boolean category6;\n}\n","subject":"Add Planner Applied Categories extension"} {"old_contents":"package crawlers.facebook;\n\nimport org.apache.commons.io.IOUtils;\n\nimport java.io.*;\n\nimport org.jsoup.Connection;\nimport org.jsoup.Jsoup;\nimport org.jsoup.nodes.Document;\nimport play.Logger;\n\nclass FacebookSession {\n private static final String COOKIES_FILENAME = \"\/facebook_cookies\";\n\n private String cookies;\n\n FacebookSession() {\n InputStream secretsStream = getClass().getResourceAsStream(COOKIES_FILENAME);\n\n try {\n cookies = IOUtils.toString(secretsStream, \"utf8\").trim();\n } catch (IOException e) {\n Logger.warn(\"Cannot open Facebook cookies file \" + COOKIES_FILENAME);\n }\n }\n\n Connection getConnection(String uri) {\n Connection c = Jsoup.connect(uri);\n c.header(\"cookie\", cookies);\n c.header(\"user-agent\", \"Mozilla\/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/58.0.3029.110 Safari\/537.36\");\n return c;\n }\n\n Document getDocument(String uri) throws IOException {\n return getConnection(uri).execute().parse();\n }\n}\n","new_contents":"package crawlers.facebook;\n\nimport org.apache.commons.io.IOUtils;\n\nimport java.io.*;\n\nimport org.jsoup.Connection;\nimport org.jsoup.Jsoup;\nimport org.jsoup.nodes.Document;\nimport play.Logger;\n\nclass FacebookSession {\n private static final String COOKIES_FILENAME = \"\/facebook_cookies\";\n\n private String cookies;\n\n FacebookSession() {\n InputStream secretsStream = getClass().getResourceAsStream(COOKIES_FILENAME);\n\n if (secretsStream == null) {\n Logger.warn(\"Cannot find Facebook cookies file \" + COOKIES_FILENAME);\n return;\n }\n\n try {\n cookies = IOUtils.toString(secretsStream, \"utf8\").trim();\n } catch (IOException e) {\n Logger.warn(\"Cannot open Facebook cookies file \" + COOKIES_FILENAME);\n }\n }\n\n Connection getConnection(String uri) {\n Connection c = Jsoup.connect(uri);\n c.header(\"cookie\", cookies);\n c.header(\"user-agent\", \"Mozilla\/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/58.0.3029.110 Safari\/537.36\");\n return c;\n }\n\n Document getDocument(String uri) throws IOException {\n return getConnection(uri).execute().parse();\n }\n}\n","subject":"Fix Facebook crawler crashing app when no cookies file provided"} {"old_contents":"package com.github.cstroe.spendhawk.entity;\n\nimport com.github.cstroe.spendhawk.util.HibernateUtil;\nimport org.hibernate.criterion.Order;\nimport org.hibernate.criterion.Restrictions;\n\nimport java.util.List;\n\n\/**\n * The category for an expense. Categories are at the user level, so that\n * many accounts can use the same categories to categorize their expenditures.\n *\/\npublic class Category {\n private Long id;\n private User user;\n private String name;\n\n public Long getId() {\n return id;\n }\n\n public void setId(Long id) {\n this.id = id;\n }\n\n public User getUser() {\n return user;\n }\n\n public void setUser(User user) {\n this.user = user;\n }\n\n public String getName() {\n return name;\n }\n\n public void setName(String name) {\n this.name = name;\n }\n\n public boolean save() {\n Long id = (Long) HibernateUtil.getSessionFactory().getCurrentSession().save(this);\n return id != null;\n }\n\n @SuppressWarnings(\"unchecked\")\n public static List findAll() {\n return (List) HibernateUtil.getSessionFactory().getCurrentSession()\n .createCriteria(Category.class)\n .addOrder(Order.asc(\"name\"))\n .list();\n }\n\n public static Category findById(Long id) {\n return (Category) HibernateUtil.getSessionFactory().getCurrentSession()\n .createCriteria(Category.class)\n .add(Restrictions.eq(\"id\", id))\n .uniqueResult();\n }\n\n}\n","new_contents":"package com.github.cstroe.spendhawk.entity;\n\nimport com.github.cstroe.spendhawk.util.HibernateUtil;\nimport org.hibernate.criterion.Order;\nimport org.hibernate.criterion.Restrictions;\n\nimport java.util.List;\n\n\/**\n * The category for an expense. Categories are at the user level, so that\n * many accounts can use the same categories to categorize their expenditures.\n *\/\npublic class Category {\n private Long id;\n private User user;\n private String name;\n\n public Long getId() {\n return id;\n }\n\n public void setId(Long id) {\n this.id = id;\n }\n\n public User getUser() {\n return user;\n }\n\n public void setUser(User user) {\n this.user = user;\n }\n\n public String getName() {\n return name;\n }\n\n public void setName(String name) {\n this.name = name;\n }\n\n public boolean save() {\n Long id = (Long) HibernateUtil.getSessionFactory().getCurrentSession().save(this);\n return id != null;\n }\n\n public void delete() {\n HibernateUtil.getSessionFactory().getCurrentSession().delete(this);\n }\n\n @SuppressWarnings(\"unchecked\")\n public static List findAll() {\n return (List) HibernateUtil.getSessionFactory().getCurrentSession()\n .createCriteria(Category.class)\n .addOrder(Order.asc(\"name\"))\n .list();\n }\n\n public static Category findById(Long id) {\n return (Category) HibernateUtil.getSessionFactory().getCurrentSession()\n .createCriteria(Category.class)\n .add(Restrictions.eq(\"id\", id))\n .uniqueResult();\n }\n\n}\n","subject":"Add method to delete a category."} {"old_contents":"package net.darkmorford.btweagles.block;\n\nimport net.darkmorford.btweagles.BetterThanWeagles;\nimport net.minecraft.block.Block;\nimport net.minecraft.block.material.Material;\nimport net.minecraft.client.renderer.block.model.ModelResourceLocation;\nimport net.minecraft.creativetab.CreativeTabs;\nimport net.minecraft.item.Item;\nimport net.minecraftforge.client.model.ModelLoader;\nimport net.minecraftforge.fml.relauncher.Side;\nimport net.minecraftforge.fml.relauncher.SideOnly;\n\npublic class BlockButter extends Block\n{\n\tpublic BlockButter()\n\t{\n\t\tsuper(Material.CLAY);\n\n\t\tsetRegistryName(BetterThanWeagles.MODID, \"butter\");\n\t\tsetUnlocalizedName(\"butter\");\n\t\tsetCreativeTab(BetterThanWeagles.tabBTWeagles);\n\t}\n\n\t@SideOnly(Side.CLIENT)\n\tpublic void initModel()\n\t{\n\t\tModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(this), 0, new ModelResourceLocation(getRegistryName(), \"inventory\"));\n\t}\n}\n","new_contents":"package net.darkmorford.btweagles.block;\n\nimport net.darkmorford.btweagles.BetterThanWeagles;\nimport net.minecraft.block.Block;\nimport net.minecraft.block.material.Material;\nimport net.minecraft.client.renderer.block.model.ModelResourceLocation;\nimport net.minecraft.creativetab.CreativeTabs;\nimport net.minecraft.item.Item;\nimport net.minecraftforge.client.model.ModelLoader;\nimport net.minecraftforge.fml.relauncher.Side;\nimport net.minecraftforge.fml.relauncher.SideOnly;\n\npublic class BlockButter extends Block\n{\n\tpublic BlockButter()\n\t{\n\t\tsuper(Material.CLAY);\n\n\t\tthis.slipperiness = 0.98F;\n\n\t\tsetRegistryName(BetterThanWeagles.MODID, \"butter\");\n\t\tsetUnlocalizedName(\"butter\");\n\t\tsetCreativeTab(BetterThanWeagles.tabBTWeagles);\n\t}\n\n\t@SideOnly(Side.CLIENT)\n\tpublic void initModel()\n\t{\n\t\tModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(this), 0, new ModelResourceLocation(getRegistryName(), \"inventory\"));\n\t}\n}\n","subject":"Make butter blocks slippery like ice."} {"old_contents":"package com.adms.test;\r\n\r\n\r\n\r\npublic class TestApp {\r\n\r\n\tpublic static void main(String[] args) {\r\n\r\n\t\ttry {\r\n\t\t\tSystem.out.println(\"start\");\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"finish\");\r\n\t\t} catch(Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\t}\r\n}\r\n","new_contents":"package com.adms.test;\r\n\r\nimport java.util.Arrays;\r\nimport java.util.Calendar;\r\n\r\nimport com.adms.utils.DateUtil;\r\n\r\n\r\n\r\npublic class TestApp {\r\n\r\n\tpublic static void main(String[] args) {\r\n\r\n\t\ttry {\r\n\t\t\tSystem.out.println(\"start\");\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tCalendar cal = Calendar.getInstance();\r\n\t\t\tSystem.out.println(DateUtil.convDateToString(\"MMM_yyyyMM\", cal.getTime()));\r\n\t\t\t\r\n\t\t\tString[] plan1s = new String[]{\"PLAN 1\", \"600000\"};\r\n\t\t\t\r\n\t\t\tString planVal = \"40000-Plan 1\";\r\n\t\t\t\r\n\t\t\tSystem.out.println(Arrays.binarySearch(plan1s, planVal.toUpperCase()));\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"finish\");\r\n\t\t} catch(Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\t}\r\n}\r\n","subject":"Add method - Create Directory"} {"old_contents":"package de.gernd.simplemon.endpoints;\n\nimport de.gernd.simplemon.endpoints.model.AddSiteToMonitorRequest;\nimport de.gernd.simplemon.endpoints.model.GetMonitoredSitesResponse;\nimport de.gernd.simplemon.service.SimpleMonitoringService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Component;\n\nimport javax.ws.rs.*;\nimport javax.ws.rs.core.Response;\nimport java.util.List;\n\n@Component\n@Path(\"\/monitored-sites\")\n@Produces(\"application\/json\")\n@Consumes(\"application\/json\")\npublic class SimpleMonitoringEndpoint {\n\n @Autowired\n private SimpleMonitoringService monitoringService;\n\n\n \/**\n * Method for retrieving all currently monitored sites\n *\n * @return All currently monitored sites\n *\/\n @Path(\"\/\")\n @GET\n public Response monitor() {\n GetMonitoredSitesResponse response = new GetMonitoredSitesResponse();\n List monitoredSites = monitoringService.getMonitoredSites();\n response.monitoredSites = monitoredSites;\n return Response.ok(monitoredSites).build();\n }\n\n \/**\n * Method for retrieving all currently monitored sites\n *\/\n @Path(\"\/\")\n @POST\n public Response addSite(AddSiteToMonitorRequest addSiteToMonitorRequest){\n monitoringService.startMonitoring(addSiteToMonitorRequest.url);\n return Response.ok().build();\n }\n}\n","new_contents":"package de.gernd.simplemon.endpoints;\n\nimport de.gernd.simplemon.endpoints.model.AddSiteToMonitorRequest;\nimport de.gernd.simplemon.endpoints.model.GetMonitoredSitesResponse;\nimport de.gernd.simplemon.service.SimpleMonitoringService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Component;\n\nimport javax.ws.rs.*;\nimport javax.ws.rs.core.Response;\nimport java.util.List;\n\n@Component\n@Path(\"\/monitored-sites\")\n@Produces(\"application\/json\")\n@Consumes(\"application\/json\")\npublic class SimpleMonitoringEndpoint {\n\n @Autowired\n private SimpleMonitoringService monitoringService;\n\n\n \/**\n * Method for retrieving all currently monitored sites\n *\n * @return All currently monitored sites\n *\/\n @Path(\"\/\")\n @GET\n public Response getMonitoredSites() {\n GetMonitoredSitesResponse response = new GetMonitoredSitesResponse();\n List monitoredSites = monitoringService.getMonitoredSites();\n response.monitoredSites = monitoredSites;\n return Response.ok(monitoredSites).build();\n }\n\n \/**\n * Method for retrieving all currently monitored sites\n *\/\n @Path(\"\/\")\n @POST\n public Response addSite(AddSiteToMonitorRequest addSiteToMonitorRequest){\n monitoringService.startMonitoring(addSiteToMonitorRequest.url);\n return Response.ok().build();\n }\n\n\n}\n","subject":"Fix method name for getting the monitored sites"} {"old_contents":"\/**\n * Copyright 2010 The ForPlay Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License. \n *\/\npackage forplay.core;\n\n\/**\n * Generic platform interface. New platforms are defined as implementations of this interface.\n *\/\npublic interface Platform {\n\n Audio audio();\n\n Graphics graphics();\n \n AssetManager assetManager();\n\n Json json();\n\n Keyboard keyboard();\n\n Log log();\n\n Net net();\n\n Pointer pointer();\n\n \/**\n * Return the mouse if it is supported, or null otherwise.\n * \n * @return the mouse if it is supported, or null otherwise.\n *\/\n Mouse mouse();\n\n Storage storage();\n \n Analytics analytics();\n\n float random();\n\n void run(Game game);\n\n double time();\n\n RegularExpression regularExpression();\n\n void openURL(String url);\n}\n","new_contents":"\/**\n * Copyright 2010 The ForPlay Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License. \n *\/\npackage forplay.core;\n\n\/**\n * Generic platform interface. New platforms are defined as implementations of this interface.\n *\/\npublic interface Platform {\n\n Audio audio();\n\n Graphics graphics();\n \n AssetManager assetManager();\n\n Json json();\n\n Keyboard keyboard();\n\n Log log();\n\n Net net();\n\n Pointer pointer();\n\n Mouse mouse();\n\n Storage storage();\n \n Analytics analytics();\n\n float random();\n\n void run(Game game);\n\n double time();\n\n RegularExpression regularExpression();\n\n void openURL(String url);\n}\n","subject":"Remove useless comment about returning a null mouse. Access mouse through ForPlay.mouse()."} {"old_contents":"package ganymedes01.etfuturum.dispenser;\n\nimport ganymedes01.etfuturum.entities.EntityTippedArrow;\nimport ganymedes01.etfuturum.items.TippedArrow;\nimport net.minecraft.dispenser.BehaviorDefaultDispenseItem;\nimport net.minecraft.dispenser.BehaviorProjectileDispense;\nimport net.minecraft.dispenser.IBlockSource;\nimport net.minecraft.dispenser.IPosition;\nimport net.minecraft.entity.IProjectile;\nimport net.minecraft.item.ItemStack;\nimport net.minecraft.world.World;\n\npublic class DispenserBehaviourTippedArrow extends BehaviorDefaultDispenseItem {\n\n\t@Override\n\tpublic ItemStack dispenseStack(IBlockSource block, ItemStack stack) {\n\t\treturn new BehaviorProjectileDispense() {\n\n\t\t\t@Override\n\t\t\tprotected IProjectile getProjectileEntity(World world, IPosition pos) {\n\t\t\t\tEntityTippedArrow entity = new EntityTippedArrow(world, pos.getX(), pos.getY(), pos.getZ());\n\t\t\t\tentity.setEffect(TippedArrow.getEffect(stack));\n\t\t\t\treturn entity;\n\t\t\t}\n\t\t}.dispense(block, stack);\n\t}\n\n\t@Override\n\tprotected void playDispenseSound(IBlockSource block) {\n\t\tblock.getWorld().playAuxSFX(1002, block.getXInt(), block.getYInt(), block.getZInt(), 0);\n\t}\n}","new_contents":"package ganymedes01.etfuturum.dispenser;\n\nimport ganymedes01.etfuturum.entities.EntityTippedArrow;\nimport ganymedes01.etfuturum.items.TippedArrow;\nimport net.minecraft.dispenser.BehaviorDefaultDispenseItem;\nimport net.minecraft.dispenser.BehaviorProjectileDispense;\nimport net.minecraft.dispenser.IBlockSource;\nimport net.minecraft.dispenser.IPosition;\nimport net.minecraft.entity.IProjectile;\nimport net.minecraft.item.ItemStack;\nimport net.minecraft.world.World;\n\npublic class DispenserBehaviourTippedArrow extends BehaviorDefaultDispenseItem {\n\n\t@Override\n\tpublic ItemStack dispenseStack(IBlockSource block, ItemStack stack) {\n\t\treturn new BehaviorProjectileDispense() {\n\n\t\t\t@Override\n\t\t\tprotected IProjectile getProjectileEntity(World world, IPosition pos) {\n\t\t\t\tEntityTippedArrow entity = new EntityTippedArrow(world, pos.getX(), pos.getY(), pos.getZ());\n\t\t\t\tentity.canBePickedUp = 1;\n\t\t\t\tentity.setEffect(TippedArrow.getEffect(stack));\n\t\t\t\treturn entity;\n\t\t\t}\n\t\t}.dispense(block, stack);\n\t}\n\n\t@Override\n\tprotected void playDispenseSound(IBlockSource block) {\n\t\tblock.getWorld().playAuxSFX(1002, block.getXInt(), block.getYInt(), block.getZInt(), 0);\n\t}\n}","subject":"Fix tipped arrows not being pick-upable after shot out of a dispenser"} {"old_contents":"package com.example.crystalgame;\n\n\nimport com.example.crystalgame.communication.CommunicationService;\n\nimport android.os.Bundle;\nimport android.app.Activity;\nimport android.content.Intent;\nimport android.view.Menu;\n\npublic class MainActivity extends Activity {\n\n\t@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tgetApplicationContext().startService(new Intent(getBaseContext(), CommunicationService.class));\n\t\tsetContentView(R.layout.activity_main);\n\t}\n\t\n\n\t@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\/\/ Inflate the menu; this adds items to the action bar if it is present.\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\treturn true;\n\t}\n\n}\n","new_contents":"package com.example.crystalgame;\n\n\nimport com.example.crystalgame.communication.CommunicationService;\n\nimport android.os.Bundle;\nimport android.app.Activity;\nimport android.content.Intent;\nimport android.util.Log;\nimport android.view.Menu;\n\npublic class MainActivity extends Activity {\n\n\tprivate Intent communicationIntent;\n\t\n\t@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\/\/ Inflate the menu; this adds items to the action bar if it is present.\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\treturn true;\n\t}\n\n\t@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tsetContentView(R.layout.activity_main);\n\t}\n\t\n\tprotected void onStart() {\n\t\tsuper.onStart();\n\n\t\tLog.d(\"CommunicationService\", \"oncreate\");\n\t\tcommunicationIntent = createCommunictionIntent();\n\t\tgetApplicationContext().startService(communicationIntent);\n\t}\n \n \/\/protected void onRestart();\n\n \/\/protected void onResume();\n\n \/\/protected void onPause();\n\n protected void onStop() {\n \tgetApplicationContext().stopService(communicationIntent);\n }\n\n \/\/protected void onDestroy();\n\t\n \n private Intent createCommunictionIntent() {\n \treturn new Intent(getBaseContext(), CommunicationService.class);\n }\n}\n","subject":"Move the service creation to onStart, add onStop service termination"} {"old_contents":"package info.u_team.u_team_core.item.tool;\n\nimport info.u_team.u_team_core.api.registry.IUArrayRegistryType;\nimport net.minecraft.item.Item;\n\npublic class ToolSet implements IUArrayRegistryType {\n\t\n\tprivate final UAxeItem axe;\n\tprivate final UHoeItem hoe;\n\tprivate final UPickaxeItem pickaxe;\n\tprivate final UShovelItem spade;\n\tprivate final USwordItem sword;\n\t\n\tpublic ToolSet(UAxeItem axe, UHoeItem hoe, UPickaxeItem pickaxe, UShovelItem spade, USwordItem sword) {\n\t\tthis.axe = axe;\n\t\tthis.hoe = hoe;\n\t\tthis.pickaxe = pickaxe;\n\t\tthis.spade = spade;\n\t\tthis.sword = sword;\n\t}\n\t\n\t@Override\n\tpublic Item[] getArray() {\n\t\treturn new Item[] { axe, hoe, pickaxe, spade, sword };\n\t}\n\t\n\tpublic UAxeItem getAxe() {\n\t\treturn axe;\n\t}\n\t\n\tpublic UHoeItem getHoe() {\n\t\treturn hoe;\n\t}\n\t\n\tpublic UPickaxeItem getPickaxe() {\n\t\treturn pickaxe;\n\t}\n\t\n\tpublic UShovelItem getSpade() {\n\t\treturn spade;\n\t}\n\t\n\tpublic USwordItem getSword() {\n\t\treturn sword;\n\t}\n\t\n}\n","new_contents":"package info.u_team.u_team_core.item.tool;\n\nimport info.u_team.u_team_core.api.registry.IUArrayRegistryType;\nimport net.minecraft.item.Item;\n\npublic class ToolSet implements IUArrayRegistryType {\n\t\n\tprivate final UAxeItem axe;\n\tprivate final UHoeItem hoe;\n\tprivate final UPickaxeItem pickaxe;\n\tprivate final UShovelItem shovel;\n\tprivate final USwordItem sword;\n\t\n\tpublic ToolSet(UAxeItem axe, UHoeItem hoe, UPickaxeItem pickaxe, UShovelItem shovel, USwordItem sword) {\n\t\tthis.axe = axe;\n\t\tthis.hoe = hoe;\n\t\tthis.pickaxe = pickaxe;\n\t\tthis.shovel = shovel;\n\t\tthis.sword = sword;\n\t}\n\t\n\t@Override\n\tpublic Item[] getArray() {\n\t\treturn new Item[] { axe, hoe, pickaxe, shovel, sword };\n\t}\n\t\n\tpublic UAxeItem getAxe() {\n\t\treturn axe;\n\t}\n\t\n\tpublic UHoeItem getHoe() {\n\t\treturn hoe;\n\t}\n\t\n\tpublic UPickaxeItem getPickaxe() {\n\t\treturn pickaxe;\n\t}\n\t\n\tpublic UShovelItem getShovel() {\n\t\treturn shovel;\n\t}\n\t\n\tpublic USwordItem getSword() {\n\t\treturn sword;\n\t}\n\t\n}\n","subject":"Rename all spade variable names to shovel variable names"} {"old_contents":"package com.boundary.plugin.sdk;\n\npublic class Dashboard {\n\t\n\t\n}\n","new_contents":"\/\/ Copyright 2014 Boundary, Inc.\n\/\/\n\/\/ Licensed under the Apache License, Version 2.0 (the \"License\");\n\/\/ you may not use this file except in compliance with the License.\n\/\/ You may obtain a copy of the License at\n\/\/\n\/\/ http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n\/\/\n\/\/ Unless required by applicable law or agreed to in writing, software\n\/\/ distributed under the License is distributed on an \"AS IS\" BASIS,\n\/\/ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n\/\/ See the License for the specific language governing permissions and\n\/\/ limitations under the License.\n\npackage com.boundary.plugin.sdk;\n\n\/**\n * Data structure the represents a dashboard in the plugin.json<\/code> plugin manifest\n * \n *
\n * \"dashboards\" : [\n        { \"name\": \"Plugin Shell\", \"layout\": \"d-w=3&d-h=2&d-pad=5&d-bg=none&d-g-BOUNDARY_PORT_AVAILABILITY=0-1-1-1&d-g-BOUNDARY_RANDOM_NUMBER=0-0-1-1&d-g-BOUNDARY_PROCESS_COUNT=1-0-1-1&d-g-BOUNDARY_FILE_SPACE_CAPACITY=2-0-1-1&d-g-BOUNDARY_PORT_RESPONSE=1-1-1-1\"},\n        { \"name\": \"CPU Load\", \"layout\":\"d-w=1&d-h=3&d-pad=5&d-bg=none&d-g-BOUNDARY_CPU_LOAD_1_MINUTE=0-0-1-1&d-g-BOUNDARY_CPU_LOAD_5_MINUTE=0-1-1-1&d-g-BOUNDARY_CPU_LOAD_15_MINUTE=0-2-1-1\"}\n    ]\n * <\/pre>\n *\n *\/\npublic class Dashboard {\n\tString name;\n\tString layout;\n}\n","subject":"Add fields; license ; and javadoc"}
{"old_contents":"package info.u_team.u_team_test2;\n\nimport org.apache.logging.log4j.*;\n\nimport info.u_team.u_team_core.construct.ConstructManager;\nimport info.u_team.u_team_core.integration.IntegrationManager;\nimport info.u_team.u_team_core.util.verify.JarSignVerifier;\nimport net.minecraftforge.fml.common.Mod;\n\n@Mod(TestMod2.MODID)\npublic class TestMod2 {\n\t\n\tpublic static final String MODID = \"uteamtest2\";\n\tpublic static final Logger LOGGER = LogManager.getLogger(\"UTeamTest2\");\n\t\n\tpublic TestMod2() {\n\t\tJarSignVerifier.checkSigned(MODID);\n\t\t\n\t\tLOGGER.info(\"-------------------------------------- LOADING TEST MOD 2 -------------------------------------\");\n\t\t\n\t\tConstructManager.constructConstructs(MODID);\n\t\tIntegrationManager.constructIntegrations(MODID);\n\t}\n}\n","new_contents":"package info.u_team.u_team_test2;\n\nimport org.apache.logging.log4j.*;\n\nimport info.u_team.u_team_core.util.annotation.AnnotationManager;\nimport info.u_team.u_team_core.util.verify.JarSignVerifier;\nimport net.minecraftforge.fml.common.Mod;\n\n@Mod(TestMod2.MODID)\npublic class TestMod2 {\n\t\n\tpublic static final String MODID = \"uteamtest2\";\n\tpublic static final Logger LOGGER = LogManager.getLogger(\"UTeamTest2\");\n\t\n\tpublic TestMod2() {\n\t\tJarSignVerifier.checkSigned(MODID);\n\t\t\n\t\tLOGGER.info(\"-------------------------------------- LOADING TEST MOD 2 -------------------------------------\");\n\t\t\n\t\tAnnotationManager.callAnnotations(MODID);\n\t}\n}\n","subject":"Update testmod 2 to use the new method"}
{"old_contents":"package io.jahed.twitchrobot;\n\nimport java.util.List;\n\nimport org.pircbotx.PircBotX;\nimport org.pircbotx.ServerInfo;\n\npublic class TwitchServerInfo extends ServerInfo {\n\n\tpublic TwitchServerInfo(PircBotX bot) {\n\t\tsuper(bot);\n\t}\n\t\n\t@Override\n\tpublic void parse(int code, List parsedLine) {\n\t\t\/\/Library assumes too much.\n\t\tif(code == 4 && parsedLine.size() < 2) {\n\t\t\tSystem.err.println(\"TwitchServerInfo - Code 4 with \" + parsedLine);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tsuper.parse(code, parsedLine);\n\t}\n\n}\n","new_contents":"package io.jahed.twitchrobot;\n\nimport java.util.List;\n\nimport org.pircbotx.PircBotX;\nimport org.pircbotx.ServerInfo;\n\npublic class TwitchServerInfo extends ServerInfo {\n\n\tpublic TwitchServerInfo(PircBotX bot) {\n\t\tsuper(bot);\n\t}\n\t\n\t@Override\n\tpublic void parse(int code, List parsedLine) {\n\t\tif(code == 4 && parsedLine.size() < 2) {\n\t\t\t\/\/Twitch IRC Server has an extra Code 4 response containing user's nick.\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tsuper.parse(code, parsedLine);\n\t}\n\n}\n","subject":"Remove println for extra IRC handlers"}
{"old_contents":"package com.example.rxappfocus;\n\nimport android.app.Application;\nimport android.widget.Toast;\n\nimport com.gramboid.rxappfocus.AppFocusProvider;\n\nimport rx.functions.Action1;\n\npublic class App extends Application {\n\n    private AppFocusProvider focusProvider;\n\n    @Override\n    public void onCreate() {\n        super.onCreate();\n        focusProvider = new AppFocusProvider(this);\n        focusProvider\n                .getAppFocus()\n                .subscribe(new Action1() {\n                    @Override\n                    public void call(Boolean visible) {\n                        Toast.makeText(App.this, visible ? \"App visible\" : \"App hidden\", Toast.LENGTH_SHORT).show();\n                    }\n                });\n    }\n\n    public AppFocusProvider getFocusProvider() {\n        return focusProvider;\n    }\n}\n","new_contents":"package com.example.rxappfocus;\n\nimport android.app.Application;\nimport android.widget.Toast;\n\nimport com.gramboid.rxappfocus.AppFocusProvider;\n\nimport rx.functions.Action1;\n\npublic class App extends Application {\n\n    private AppFocusProvider focusProvider;\n\n    @Override\n    public void onCreate() {\n        super.onCreate();\n        focusProvider = new AppFocusProvider(this);\n\n        \/\/ show a toast every time the app becomes visible or hidden\n        focusProvider.getAppFocus()\n                .subscribe(new Action1() {\n                    @Override\n                    public void call(Boolean visible) {\n                        Toast.makeText(App.this, visible ? \"App visible\" : \"App hidden\", Toast.LENGTH_SHORT).show();\n                    }\n                });\n    }\n\n    public AppFocusProvider getFocusProvider() {\n        return focusProvider;\n    }\n}\n","subject":"Tidy up and add comment"}
{"old_contents":"package edu.northwestern.bioinformatics.studycalendar.domain;\n\nimport javax.persistence.Entity;\nimport javax.persistence.DiscriminatorValue;\nimport javax.persistence.Transient;\n\n\n\/**\n * @author Nataliya Shurupova\n *\/\n\n@Entity\n@DiscriminatorValue(value=\"2\")\npublic class DayOfTheWeek extends Holiday {\n    private String dayOfTheWeek;\n\n    @Transient\n    public String getDisplayName() {\n        return getDayOfTheWeek();\n    }\n\n    @Transient\n    public int getDayOfTheWeekInteger() {\n        return mapDayNameToInteger(getDayOfTheWeek());\n    }\n\n    public String getDayOfTheWeek() {\n        return this.dayOfTheWeek;\n    }\n\n    public void setDayOfTheWeek(String dayOfTheWeek) {\n        this.dayOfTheWeek = dayOfTheWeek;\n    }\n\n    @Override\n    public boolean equals(Object o) {\n        if (this == o) return true;\n        if (o == null || getClass() != o.getClass()) return false;\n\n        DayOfTheWeek that = (DayOfTheWeek) o;\n\n        if (dayOfTheWeek != null ? !dayOfTheWeek.equals(that.dayOfTheWeek) : that.dayOfTheWeek != null)\n            return false;\n\n        return true;\n    }\n\n    @Override\n    public String toString(){\n        StringBuffer sb = new StringBuffer();\n        sb.append(\"Id = \");\n        sb.append(getId());\n        sb.append(\" DayOfTheWeek = \");\n        sb.append(getDayOfTheWeek());\n        sb.append(super.toString());\n        return sb.toString();\n    }\n}\n\n\n","new_contents":"package edu.northwestern.bioinformatics.studycalendar.domain;\n\nimport javax.persistence.Entity;\nimport javax.persistence.DiscriminatorValue;\nimport javax.persistence.Transient;\n\n\n\/**\n * @author Nataliya Shurupova\n *\/\n\n@Entity\n@DiscriminatorValue(value=\"2\")\npublic class DayOfTheWeek extends Holiday {\n    \/\/ TODO: This ought to be the java.util.Calendar constant for the day, or a custom enum\n    private String dayOfTheWeek;\n\n    @Transient\n    public String getDisplayName() {\n        return getDayOfTheWeek();\n    }\n\n    @Transient\n    public int getDayOfTheWeekInteger() {\n        return mapDayNameToInteger(getDayOfTheWeek());\n    }\n\n    public String getDayOfTheWeek() {\n        return this.dayOfTheWeek;\n    }\n\n    public void setDayOfTheWeek(String dayOfTheWeek) {\n        this.dayOfTheWeek = dayOfTheWeek;\n    }\n\n    @Override\n    public boolean equals(Object o) {\n        if (this == o) return true;\n        if (o == null || getClass() != o.getClass()) return false;\n\n        DayOfTheWeek that = (DayOfTheWeek) o;\n\n        if (dayOfTheWeek != null ? !dayOfTheWeek.equals(that.dayOfTheWeek) : that.dayOfTheWeek != null)\n            return false;\n\n        return true;\n    }\n\n    @Override\n    public String toString(){\n        StringBuffer sb = new StringBuffer();\n        sb.append(\"Id = \");\n        sb.append(getId());\n        sb.append(\" DayOfTheWeek = \");\n        sb.append(getDayOfTheWeek());\n        sb.append(super.toString());\n        return sb.toString();\n    }\n}\n\n\n","subject":"Add TODO about using an enum instead of an unconstrained string"}
{"old_contents":"\/* Generated By:JJTree: Do not edit this line. ASTJexlScript.java *\/\n\npackage org.apache.commons.jexl.parser;\n\n\/**\n * Top of the syntax tree - parsed Jexl code.\n *\/\npublic class ASTJexlScript extends SimpleNode {\n  public ASTJexlScript(int id) {\n    super(id);\n  }\n\n  public ASTJexlScript(Parser p, int id) {\n    super(p, id);\n  }\n\n\n  \/** Accept the visitor. **\/\n  public Object jjtAccept(ParserVisitor visitor, Object data) {\n    return visitor.visit(this, data);\n  }\n}\n","new_contents":"\/* Generated By:JJTree: Do not edit this line. ASTJexlScript.java *\/\n\npackage org.apache.commons.jexl.parser;\n\nimport org.apache.commons.jexl.JexlContext;\n\n\/**\n * Top of the syntax tree - parsed Jexl code.\n * @since 1.1\n *\/\npublic class ASTJexlScript extends SimpleNode {\n  public ASTJexlScript(int id) {\n    super(id);\n  }\n\n  public ASTJexlScript(Parser p, int id) {\n    super(p, id);\n  }\n\n\n  \/** Accept the visitor. **\/\n  public Object jjtAccept(ParserVisitor visitor, Object data) {\n    return visitor.visit(this, data);\n  }\n  \n  public Object value(JexlContext jc) throws Exception\n  {\n      SimpleNode child = (SimpleNode)jjtGetChild(0);\n      return child.value(jc);\n  }\n}\n","subject":"Add value(context) method to support scripts"}
{"old_contents":"package com.nulabinc.zxcvbn.matchers;\n\nimport java.util.HashMap;\nimport java.util.List;\nimport java.util.Map;\n\npublic class Dictionary {\n\n    private final String name;\n\n    private final List frequencies;\n\n    private final Map rankedDictionary;\n\n    public Dictionary(String name, List frequencies) {\n        this.name = name;\n        this.frequencies = frequencies;\n        this.rankedDictionary = toRankedDictionary(frequencies);\n    }\n\n    private Map toRankedDictionary(final List frequencies) {\n        Map result = new HashMap<>();\n        int i = 1; \/\/ rank starts at 1, not 0\n        for (String word : frequencies) {\n            result.put(word, i);\n            i++;\n        }\n        return result;\n    }\n\n    public String getName() {\n        return name;\n    }\n\n    public List getFrequencies() {\n        return frequencies;\n    }\n\n    public Map getRankedDictionary() {\n        return rankedDictionary;\n    }\n}","new_contents":"package com.nulabinc.zxcvbn.matchers;\n\nimport java.util.HashMap;\nimport java.util.List;\nimport java.util.Map;\n\npublic class Dictionary {\n\n    private final String name;\n\n    private final List frequencies;\n\n    private final Map rankedDictionary;\n\n    public Dictionary(String name, List frequencies) {\n        this.name = name;\n        this.frequencies = frequencies;\n        this.rankedDictionary = toRankedDictionary(frequencies);\n    }\n\n    private Map toRankedDictionary(final List frequencies) {\n        Map result = new HashMap<>();\n        int i = 1; \/\/ rank starts at 1, not 0\n        for (String word : frequencies) {\n            result.put(word, i);\n            i++;\n        }\n        return result;\n    }\n\n    public String getName() {\n        return name;\n    }\n\n    public List getFrequencies() {\n        return frequencies;\n    }\n\n    public Map getRankedDictionary() {\n        return rankedDictionary;\n    }\n}\n","subject":"Add newline to follow a POSIX rule."}
{"old_contents":"package com.xrtb.exchanges;\n\nimport java.io.InputStream;\nimport com.xrtb.pojo.BidRequest;\n\n\/**\n * A class to handle Epom ad exchange\n * @author Ben M. Faul\n *\n *\/\n\npublic class Epom extends BidRequest {\n\n        public Epom() {\n                super();\n                parseSpecial();\n        }\n        \n        \/**\n         * Make a Epom bid request using a String.\n         * @param in String. The JSON bid request for Epom\n         * @throws Exception on JSON errors.\n         *\/\n        public Epom(String  in) throws Exception  {\n                super(in);\n                parseSpecial();\n    }\n\n        \/**\n         * Make a Epom bid request using an input stream.\n         * @param in InputStream. The contents of a HTTP post.\n         * @throws Exception on JSON errors.\n         *\/\n        public Epom(InputStream in) throws Exception {\n                super(in);\n                parseSpecial();\n        }\n        \n        \/**\n         * Process special Epom stuff, sets the exchange name.\n         *\/\n        @Override\n        public boolean parseSpecial() {\n                exchange = \"epom\";\n                return true;\n        }\n}\n\n\n\n        \n","new_contents":"package com.xrtb.exchanges;\n\nimport java.io.InputStream;\nimport com.xrtb.pojo.BidRequest;\n\n\/**\n * A class to handle Epom ad exchange\n * @author Ben M. Faul\n *\n *\/\n\npublic class Epom extends BidRequest {\n\n        public Epom() {\n                super();\n                parseSpecial();\n        }\n        \n        \/**\n         * Make a Epom bid request using a String.\n         * @param in String. The JSON bid request for Epom\n         * @throws Exception on JSON errors.\n         *\/\n        public Epom(String  in) throws Exception  {\n                super(in);\n                parseSpecial();\n    }\n\n        \/**\n         * Make a Epom bid request using an input stream.\n         * @param in InputStream. The contents of a HTTP post.\n         * @throws Exception on JSON errors.\n         *\/\n        public Epom(InputStream in) throws Exception {\n                super(in);\n                parseSpecial();\n        }\n        \n        \/**\n         * Process special Epom stuff, sets the exchange name.\n         *\/\n        @Override\n        public boolean parseSpecial() {\n                exchange = \"epom\";\n                usesEncodedAdm = false;\n                return true;\n        }\n}\n\n\n\n        \n","subject":"Fix epom to not use encoded adm"}
{"old_contents":"package uk.ac.ebi.biosamples.accession;\n\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.beans.factory.annotation.Qualifier;\nimport org.springframework.jdbc.core.JdbcTemplate;\nimport org.springframework.jdbc.core.RowCallbackHandler;\nimport org.springframework.stereotype.Service;\n\n@Service\npublic class AccessionDao {\n\n\tprivate Logger log = LoggerFactory.getLogger(getClass());\n\n\t@Autowired\n\t@Qualifier(\"accessionJdbcTemplate\")\n    protected JdbcTemplate jdbcTemplate;\n\n\tpublic void doAssayAccessionCallback(RowCallbackHandler rch) {\n\t\tString sql = \"SELECT * FROM SAMPLE_ASSAY\";\n\t\tjdbcTemplate.query(sql, rch);\n\t}\n\n\tpublic void doReferenceAccessionCallback(RowCallbackHandler rch) {\n\t\tString sql = \"SELECT * FROM SAMPLE_REFERENCE\";\n\t\tjdbcTemplate.query(sql, rch);\n\t}\n\n\tpublic void doGroupAccessionCallback(RowCallbackHandler rch) {\n\t\tString sql = \"SELECT * FROM SAMPLE_GROUP\";\n\t\tjdbcTemplate.query(sql, rch);\n\t}\n}\n","new_contents":"package uk.ac.ebi.biosamples.accession;\n\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.beans.factory.annotation.Qualifier;\nimport org.springframework.jdbc.core.JdbcTemplate;\nimport org.springframework.jdbc.core.RowCallbackHandler;\nimport org.springframework.stereotype.Service;\n\n@Service\npublic class AccessionDao {\n\n\tprivate Logger log = LoggerFactory.getLogger(getClass());\n\n\t@Autowired\n\t@Qualifier(\"accessionJdbcTemplate\")\n    protected JdbcTemplate jdbcTemplate;\n\n\tpublic void doAssayAccessionCallback(RowCallbackHandler rch) {\n\t\tString sql = \"SELECT * FROM SAMPLE_ASSAY\";\n\t\tjdbcTemplate.query(sql, rch);\n\t}\n\n\tpublic void doReferenceAccessionCallback(RowCallbackHandler rch) {\n\t\tString sql = \"SELECT * FROM SAMPLE_REFERENCE\";\n\t\tjdbcTemplate.query(sql, rch);\n\t}\n\n\tpublic void doGroupAccessionCallback(RowCallbackHandler rch) {\n\t\tString sql = \"SELECT * FROM SAMPLE_GROUPS\";\n\t\tjdbcTemplate.query(sql, rch);\n\t}\n}\n","subject":"Tweak to fix sql table name"}
{"old_contents":"package controller;\n\nimport java.awt.event.ActionEvent;\nimport java.awt.event.ActionListener;\n\nimport javax.swing.JButton;\n\nimport model.Message;\nimport view.MessageBoard;\n\npublic class MessageBoardController implements ActionListener{\n\tprivate Controller controller;\n\t\n\tpublic MessageBoardController(Controller controller) {\n\t\tthis.controller = controller;\n\t}\n\t\n\t@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\tMessageBoard messageBoard =(MessageBoard)((JButton)e.getSource()).getParent();\n\t\t\/\/System.out.println(\"Send this message: \"+messageBoard.getMessage()+\" to: \"+messageBoard.getUser().getUserName());\n\t\tString mess = messageBoard.getMessage();\n\t\tSystem.out.println(\"in controller \"+mess);\n\t\tMessage messageToServet = new Message(messageBoard.getUser().getUserName(),mess);\n\t\tMessage messageToDoc = new Message(controller.getModel().getAuthUser().getUserName(),mess);\n\t\tmessageToDoc.printMessage(messageBoard.getUser().getDoc());\n\t\tcontroller.getServerHandler().sendMessage(messageToServet);\n\t}\n\n}\n","new_contents":"package controller;\n\nimport java.awt.event.ActionEvent;\nimport java.awt.event.ActionListener;\n\nimport javax.swing.JButton;\n\nimport model.Message;\nimport view.MessageBoard;\n\npublic class MessageBoardController implements ActionListener{\n\tprivate Controller controller;\n\t\n\tpublic MessageBoardController(Controller controller) {\n\t\tthis.controller = controller;\n\t}\n\t\n\t@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\tMessageBoard messageBoard =(MessageBoard)((JButton)e.getSource()).getParent();\n\t\t\/\/System.out.println(\"Send this message: \"+messageBoard.getMessage()+\" to: \"+messageBoard.getUser().getUserName());\n\t\tString mess = messageBoard.getMessage();\n\t\tif(!mess.equals(\"\")){\n\t\t\tSystem.out.println(\"in controller \"+mess);\n\t\t\tMessage messageToServet = new Message(messageBoard.getUser().getUserName(),mess);\n\t\t\tMessage messageToDoc = new Message(controller.getModel().getAuthUser().getUserName(),mess);\n\t\t\tmessageToDoc.printMessage(messageBoard.getUser().getDoc());\n\t\t\tcontroller.getServerHandler().sendMessage(messageToServet);\n\t\t}\n\t}\n\n}\n","subject":"Fix Client Send Empty message"}
{"old_contents":"package bd.basic.nodes;\n\nimport com.oracle.truffle.api.nodes.Node;\n\n\n\/**\n * Dummy Node to work around Truffle's restriction that a node, which is going to\n * be instrumented, needs to have a parent.\n *\/\npublic final class DummyParent extends Node {\n  @Child public Node child;\n\n  public DummyParent(final Node node) {\n    this.child = insert(node);\n  }\n}\n","new_contents":"package bd.basic.nodes;\n\nimport com.oracle.truffle.api.nodes.Node;\n\n\n\/**\n * Dummy Node to work around Truffle's restriction that a node, which is going to\n * be instrumented, needs to have a parent.\n *\/\npublic final class DummyParent extends Node {\n  @Child public Node child;\n\n  public DummyParent(final Node node) {\n    this.child = insert(node);\n  }\n\n  public void notifyInserted() {\n    super.notifyInserted(child);\n  }\n}\n","subject":"Add helper to allow dynamic instrumentation wrappers to be inserted"}
{"old_contents":"package seedu.address.commons.events.ui;\n\nimport seedu.address.commons.events.BaseEvent;\nimport seedu.address.model.person.ReadOnlyPerson;\n\n\/**\n * Represents a selection change in the Person List Panel\n *\/\npublic class PersonPanelSelectionChangedEvent extends BaseEvent {\n\n\n    private final ReadOnlyPerson newSelection;\n\n    public PersonPanelSelectionChangedEvent(ReadOnlyPerson newSelection){\n        this.newSelection = newSelection;\n    }\n\n    @Override\n    public String toString() {\n        return this.getClass().getSimpleName();\n    }\n\n    public ReadOnlyPerson getNewSelection() {\n        return newSelection;\n    }\n}\n","new_contents":"package seedu.address.commons.events.ui;\n\nimport seedu.address.commons.events.BaseEvent;\nimport seedu.address.model.activity.Activity;\nimport seedu.address.model.person.ReadOnlyPerson;\n\n\/**\n * Represents a selection change in the Person List Panel\n *\/\npublic class PersonPanelSelectionChangedEvent extends BaseEvent {\n\n\n    private final Activity newSelection;\n\n    public PersonPanelSelectionChangedEvent(Activity newValue){\n        this.newSelection = newValue;\n    }\n\n    @Override\n    public String toString() {\n        return this.getClass().getSimpleName();\n    }\n\n    public Activity getNewSelection() {\n        return newSelection;\n    }\n}\n","subject":"Update selection event to activity"}
{"old_contents":"package org.zeromq.czmq;\n\npublic class ZFrame implements AutoCloseable {\n\n    long pointer;\n\n    public ZFrame() {\n        pointer = __init();\n    }\n\n    public ZFrame(long address) {\n        pointer = address;\n    }\n\n    public ZFrame(byte[] buf, long size) {\n        pointer = __init(buf, size);\n    }\n    native static long __init();\n\n    native static long __init(byte[] buf, long size);\n\n    native static void __destroy(long pointer);\n\n    @Override\n    public void close() {\n        __destroy(pointer);\n        pointer = 0;\n    }\n}\n","new_contents":"package org.zeromq.czmq;\n\npublic class ZFrame implements AutoCloseable {\n\n    long pointer;\n\n    public ZFrame() {\n        pointer = ZFrame.__init();\n    }\n\n    public ZFrame(long address) {\n        pointer = address;\n    }\n\n    public ZFrame(byte[] buf, long size) {\n        pointer = ZFrame.__init(buf, size);\n    }\n\n    public long size() {\n        return ZFrame.__size(pointer);\n    }\n    native static long __init();\n\n    native static long __init(byte[] buf, long size);\n\n    native static void __destroy(long pointer);\n\n    native static long __size(long pointer);\n\n    @Override\n    public void close() {\n        ZFrame.__destroy(pointer);\n        pointer = 0;\n    }\n}\n","subject":"Call from the static context"}
{"old_contents":"package com.google.sitebricks.options;\n\nimport com.google.common.collect.Lists;\nimport com.google.common.collect.Sets;\nimport com.google.inject.Inject;\nimport com.google.sitebricks.conversion.MvelTypeConverter;\nimport com.google.sitebricks.conversion.TypeConverter;\n\nimport java.lang.reflect.Type;\nimport java.util.Arrays;\nimport java.util.HashSet;\nimport java.util.Set;\n\n\/**\n * Hacky wrapper of MvelTypeConverter to support sets.\n *\n * @author jochen@pedesis.org (Jochen Bekmann)\n *\/\npublic class OptionTypeConverter implements TypeConverter {\n  @Inject\n  MvelTypeConverter converter;\n\n  @Override\n  @SuppressWarnings(\"unchecked\")\n  public  T convert(Object source, Type type) {\n    if (Set.class == type && String.class == source.getClass()) {\n      Set set = Sets.newHashSet();\n      for (String s : ((String) source).split(\",\"))\n        set.add(s.trim());\n      return (T) set;\n    }\n    return converter.convert(source, type);\n  }\n}\n","new_contents":"package com.google.sitebricks.options;\n\nimport java.lang.reflect.Type;\nimport java.util.Set;\n\nimport com.google.common.collect.Sets;\nimport com.google.inject.Inject;\nimport com.google.sitebricks.conversion.MvelTypeConverter;\nimport com.google.sitebricks.conversion.TypeConverter;\n\n\/**\n * Hacky wrapper of MvelTypeConverter to support sets.\n *\n * @author jochen@pedesis.org (Jochen Bekmann)\n *\/\npublic class OptionTypeConverter implements TypeConverter {\n  @Inject\n  MvelTypeConverter converter;\n\n  @Override\n  @SuppressWarnings(\"unchecked\")\n  public  T convert(Object source, Type type) {\n    if (Set.class == type && String.class == source.getClass()) {\n      Set set = Sets.newHashSet();\n      for (String s : ((String) source).split(\",\"))\n        set.add(s.trim());\n      return (T) set;\n    }\n    return (T) converter.convert(source, type);\n  }\n}\n","subject":"Fix compilation issue due to bug in 'old' jdk 'Inference fails for type variable return constraint'"}
{"old_contents":"package de.uni_stuttgart.vis.vowl.owl2vowl.model.nodes.datatypes;\n\nimport de.uni_stuttgart.vis.vowl.owl2vowl.constants.Node_Types;\nimport de.uni_stuttgart.vis.vowl.owl2vowl.constants.Vowl_Lang;\nimport de.uni_stuttgart.vis.vowl.owl2vowl.export.JsonGeneratorVisitor;\n\npublic class RdfsLiteral extends BaseDatatype {\n\n\tpublic RdfsLiteral() {\n\t\tsetType(Node_Types.TYPE_LITERAL);\n\t\tsetID();\n\t\tgetLabels().put(Vowl_Lang.LANG_DEFAULT, \"Literal\");\n\t}\n\n\t@Override\n\tprotected void setID() {\n\t\tid = \"literal\" + counterObjects;\n\t\tcounterObjects++;\n\t}\n\n\t@Override\n\tpublic void accept(JsonGeneratorVisitor visitor) {\n\t\tsuper.accept(visitor);\n\t\tvisitor.visit(this);\n\t}\n}\n","new_contents":"package de.uni_stuttgart.vis.vowl.owl2vowl.model.nodes.datatypes;\n\nimport de.uni_stuttgart.vis.vowl.owl2vowl.constants.Node_Types;\nimport de.uni_stuttgart.vis.vowl.owl2vowl.constants.Standard_Iris;\nimport de.uni_stuttgart.vis.vowl.owl2vowl.constants.Vowl_Lang;\nimport de.uni_stuttgart.vis.vowl.owl2vowl.export.JsonGeneratorVisitor;\n\npublic class RdfsLiteral extends BaseDatatype {\n\n\tpublic RdfsLiteral() {\n\t\tsetType(Node_Types.TYPE_LITERAL);\n\t\tsetID();\n\t\tgetLabels().put(Vowl_Lang.LANG_DEFAULT, \"Literal\");\n\t\tsetIri(Standard_Iris.GENERIC_LITERAL_URI);\n\t}\n\n\t@Override\n\tprotected void setID() {\n\t\tid = \"literal\" + counterObjects;\n\t\tcounterObjects++;\n\t}\n\n\t@Override\n\tpublic void accept(JsonGeneratorVisitor visitor) {\n\t\tsuper.accept(visitor);\n\t\tvisitor.visit(this);\n\t}\n}\n","subject":"Set standard iri for literal."}
{"old_contents":"package com.imcode.configuration;\n\nimport com.imcode.services.GenericService;\nimport imcode.services.IvisServiceFactory;\nimport imcode.services.utils.IvisOAuth2Utils;\nimport org.springframework.core.MethodParameter;\nimport org.springframework.web.bind.support.WebArgumentResolver;\nimport org.springframework.web.context.request.NativeWebRequest;\n\nimport javax.servlet.http.HttpServletRequest;\n\n\/**\n * Created by ruslan on 06.12.16.\n *\/\npublic class IvisServiceArgumentResolver implements WebArgumentResolver {\n\n    @Override\n    public Object resolveArgument(MethodParameter methodParameter, NativeWebRequest webRequest) throws Exception {\n        Class type = methodParameter.getParameterType();\n        Object nativeRequest = webRequest.getNativeRequest();\n        if (!GenericService.class.isAssignableFrom(type) && !(nativeRequest instanceof HttpServletRequest)) {\n            return UNRESOLVED;\n        }\n\n        HttpServletRequest request = (HttpServletRequest) nativeRequest;\n        IvisServiceFactory ivisServiceFactory = IvisOAuth2Utils.getServiceFactory(request);\n\n        return ivisServiceFactory.getService((Class) type);\n\n    }\n\n}\n","new_contents":"package imcode.services.argumentresolver;\n\nimport com.imcode.services.GenericService;\nimport imcode.services.IvisServiceFactory;\nimport imcode.services.utils.IvisOAuth2Utils;\nimport org.springframework.core.MethodParameter;\nimport org.springframework.web.bind.support.WebArgumentResolver;\nimport org.springframework.web.context.request.NativeWebRequest;\n\nimport javax.servlet.http.HttpServletRequest;\n\n\/**\n * Created by ruslan on 06.12.16.\n *\/\npublic class IvisServiceArgumentResolver implements WebArgumentResolver {\n\n    @Override\n    public Object resolveArgument(MethodParameter methodParameter, NativeWebRequest webRequest) throws Exception {\n        Class type = methodParameter.getParameterType();\n        Object nativeRequest = webRequest.getNativeRequest();\n        if (!GenericService.class.isAssignableFrom(type) && !(nativeRequest instanceof HttpServletRequest)) {\n            return UNRESOLVED;\n        }\n\n        HttpServletRequest request = (HttpServletRequest) nativeRequest;\n        IvisServiceFactory ivisServiceFactory = IvisOAuth2Utils.getServiceFactory(request);\n\n        return ivisServiceFactory.getService((Class) type);\n\n    }\n\n}\n","subject":"Fix package name in argument resolver."}
{"old_contents":"package com.google.sitebricks.persist;\n\nimport com.google.inject.AbstractModule;\nimport com.google.inject.Key;\nimport com.google.inject.matcher.Matcher;\n\nimport java.lang.reflect.AnnotatedElement;\n\nimport static com.google.inject.matcher.Matchers.annotatedWith;\nimport static com.google.inject.matcher.Matchers.any;\n\n\/**\n * @author dhanji@gmail.com (Dhanji R. Prasanna)\n *\/\npublic final class PersistAopModule extends AbstractModule {\n  private final AbstractPersistenceModule module;\n\n  public PersistAopModule(AbstractPersistenceModule module) {\n    this.module = module;\n  }\n\n  @Override\n  protected void configure() {\n    Key persisterKey = module.selectorKey(Persister.class);\n    WorkInterceptor workInterceptor = new WorkInterceptor(persisterKey);\n    TransactionInterceptor transactionInterceptor = new TransactionInterceptor(persisterKey);\n    requestInjection(workInterceptor);\n    requestInjection(transactionInterceptor);\n\n    Matcher workMatcher = annotatedWith(Work.class);\n    Matcher txnMatcher = annotatedWith(Transactional.class);\n\n    \/\/ Visible persistence APIs.\n    if (module.selector != null) {\n      workMatcher.and(annotatedWith(module.selector));\n      txnMatcher.and(annotatedWith(module.selector));\n    }\n\n    bindInterceptor(any(), workMatcher, workInterceptor);\n    bindInterceptor(any(), txnMatcher, transactionInterceptor);\n  }\n}\n","new_contents":"package com.google.sitebricks.persist;\n\nimport com.google.inject.AbstractModule;\nimport com.google.inject.Key;\nimport com.google.inject.matcher.Matcher;\n\nimport java.lang.reflect.AnnotatedElement;\n\nimport static com.google.inject.matcher.Matchers.annotatedWith;\nimport static com.google.inject.matcher.Matchers.any;\n\n\/**\n * @author dhanji@gmail.com (Dhanji R. Prasanna)\n *\/\npublic final class PersistAopModule extends AbstractModule {\n  private final AbstractPersistenceModule module;\n\n  public PersistAopModule(AbstractPersistenceModule module) {\n    this.module = module;\n  }\n\n  @Override\n  protected void configure() {\n    Key persisterKey = module.selectorKey(Persister.class);\n    WorkInterceptor workInterceptor = new WorkInterceptor(persisterKey);\n    TransactionInterceptor transactionInterceptor = new TransactionInterceptor(persisterKey);\n    requestInjection(workInterceptor);\n    requestInjection(transactionInterceptor);\n\n    Matcher workMatcher = annotatedWith(Work.class);\n    Matcher txnMatcher = annotatedWith(Transactional.class);\n\n    \/\/ Visible persistence APIs.\n    if (module.selector != null) {\n      workMatcher = workMatcher.and(annotatedWith(module.selector));\n      txnMatcher = txnMatcher.and(annotatedWith(module.selector));\n    }\n\n    bindInterceptor(any(), workMatcher, workInterceptor);\n    bindInterceptor(any(), txnMatcher, transactionInterceptor);\n  }\n}\n","subject":"Fix a bad, silly bug where selectors were not being added to matchers in the Persist AOP module"}
{"old_contents":"\/\/ Copyright (C) 2014 The Android Open Source Project\n\/\/\n\/\/ Licensed under the Apache License, Version 2.0 (the \"License\");\n\/\/ you may not use this file except in compliance with the License.\n\/\/ You may obtain a copy of the License at\n\/\/\n\/\/ http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n\/\/\n\/\/ Unless required by applicable law or agreed to in writing, software\n\/\/ distributed under the License is distributed on an \"AS IS\" BASIS,\n\/\/ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n\/\/ See the License for the specific language governing permissions and\n\/\/ limitations under the License.\n\npackage com.googlesource.gerrit.plugins.reviewers.client;\n\nimport com.google.gwt.core.client.JavaScriptObject;\n\npublic class ChangeReviewersInput extends JavaScriptObject {\n  public static ChangeReviewersInput create() {\n    return (ChangeReviewersInput) createObject();\n  }\n\n  protected ChangeReviewersInput() {\n  }\n\n  final void setAction(Action a) {\n    setActionRaw(a.name());\n  }\n\n  private final native void setActionRaw(String a)\n  \/*-{ if(a)this.action=a; }-*\/;\n\n  final native void setFilter(String f)\n  \/*-{ if(f)this.filter=f; }-*\/;\n\n  final native void setReviewer(String r)\n  \/*-{ if(r)this.reviewer=r; }-*\/;\n}\n","new_contents":"\/\/ Copyright (C) 2014 The Android Open Source Project\n\/\/\n\/\/ Licensed under the Apache License, Version 2.0 (the \"License\");\n\/\/ you may not use this file except in compliance with the License.\n\/\/ You may obtain a copy of the License at\n\/\/\n\/\/ http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n\/\/\n\/\/ Unless required by applicable law or agreed to in writing, software\n\/\/ distributed under the License is distributed on an \"AS IS\" BASIS,\n\/\/ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n\/\/ See the License for the specific language governing permissions and\n\/\/ limitations under the License.\n\npackage com.googlesource.gerrit.plugins.reviewers.client;\n\nimport com.google.gwt.core.client.JavaScriptObject;\n\npublic class ChangeReviewersInput extends JavaScriptObject {\n  public static ChangeReviewersInput create() {\n    return (ChangeReviewersInput) createObject();\n  }\n\n  protected ChangeReviewersInput() {\n  }\n\n  final void setAction(Action a) {\n    setActionRaw(a.name());\n  }\n\n  final native void setActionRaw(String a)\n  \/*-{ if(a)this.action=a; }-*\/;\n\n  final native void setFilter(String f)\n  \/*-{ if(f)this.filter=f; }-*\/;\n\n  final native void setReviewer(String r)\n  \/*-{ if(r)this.reviewer=r; }-*\/;\n}\n","subject":"Remove redundant modifier on native method"}
{"old_contents":"\/*\n * Copyright (c) 2013 Ramon Servadei \n *  \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *    \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\npackage com.fimtra.tcpchannel;\n\nimport com.fimtra.tcpchannel.TcpServer;\nimport com.fimtra.tcpchannel.TcpChannel.FrameEncodingFormatEnum;\n\n\/**\n * Tests the {@link TcpServer} using {@link FrameEncodingFormatEnum#LENGTH_BASED}\n * \n * @author Ramon Servadei\n *\/\npublic class TestTcpServerWithLengthBasedFrameEncodingFormat extends TestTcpServer\n{\n\n    public TestTcpServerWithLengthBasedFrameEncodingFormat()\n    {\n        super();\n        this.frameEncodingFormat = FrameEncodingFormatEnum.LENGTH_BASED;\n    }\n\n}\n","new_contents":"\/*\n * Copyright (c) 2013 Ramon Servadei \n *  \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *    \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\npackage com.fimtra.tcpchannel;\n\nimport com.fimtra.tcpchannel.TcpServer;\nimport com.fimtra.tcpchannel.TcpChannel.FrameEncodingFormatEnum;\n\n\/**\n * Tests the {@link TcpServer} using {@link FrameEncodingFormatEnum#LENGTH_BASED}\n * \n * @author Ramon Servadei\n *\/\npublic class TestTcpServerWithLengthBasedFrameEncodingFormat extends TestTcpServer\n{\n    static\n    {\n        PORT = 14000;\n    }\n\n    public TestTcpServerWithLengthBasedFrameEncodingFormat()\n    {\n        super();\n        this.frameEncodingFormat = FrameEncodingFormatEnum.LENGTH_BASED;\n    }\n\n}\n","subject":"Use dedicated port range for length-based TcpServer tests"}
{"old_contents":"package com.groupon.seleniumgridextras.config;\n\nimport com.google.gson.Gson;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\npublic class HashMapMerger {\n\n  public static Config merge(Config defaultConfig, Config overwriteConfig){\n\n    Map defaultConfigHash   = new HashMap();\n    defaultConfigHash.putAll(convertToHash(convertToString(defaultConfig)));\n\n    Map overwriteConfigHash = convertToHash(convertToString(overwriteConfig));\n    Map finalConfig = overwriteMergeStrategy(defaultConfigHash, overwriteConfigHash);\n\n    String finalConfigString = new Gson().toJson(finalConfig);\n\n    return new Gson().fromJson(finalConfigString, Config.class);\n  }\n\n  private static Map convertToHash(String json){\n    return new Gson().fromJson(json, HashMap.class);\n  }\n\n  private static String convertToString(Config config){\n    return config.toPrettyJsonString();\n  }\n\n  protected static Map overwriteMergeStrategy(Map left, Map right){\n    \/\/As desribed in http:\/\/grepcode.com\/file\/repo1.maven.org\/maven2\/org.codehaus.cargo\/cargo-core-api-module\/0.9\/org\/codehaus\/cargo\/module\/merge\/strategy\/MergeStrategy.java\n    return mergeCurrentLevel(left, right);\n  }\n\n  private static Map mergeCurrentLevel(Map left, Map right){\n\n    for (String key : right.keySet()){\n\n      if (right.get(key) instanceof Map){\n        mergeCurrentLevel((Map)left.get(key), (Map)right.get(key));\n      } else {\n        left.put(key, right.get(key));\n      }\n    }\n    return left;\n  }\n\n}\n","new_contents":"package com.groupon.seleniumgridextras.config;\n\nimport java.util.Map;\n\npublic class HashMapMerger {\n\n  protected static Map overwriteMergeStrategy(Map left, Map right){\n    \/\/As desribed in http:\/\/grepcode.com\/file\/repo1.maven.org\/maven2\/org.codehaus.cargo\/cargo-core-api-module\/0.9\/org\/codehaus\/cargo\/module\/merge\/strategy\/MergeStrategy.java\n    return mergeCurrentLevel(left, right);\n  }\n\n  private static Map mergeCurrentLevel(Map left, Map right){\n\n    for (String key : right.keySet()){\n\n      if (right.get(key) instanceof Map){\n        mergeCurrentLevel((Map)left.get(key), (Map)right.get(key));\n      } else {\n        left.put(key, right.get(key));\n      }\n    }\n    return left;\n  }\n\n}\n","subject":"Delete files that will not be used, simplify the class to bare bones"}
{"old_contents":"package utilities;\n\nimport java.io.ByteArrayOutputStream;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.nio.ByteBuffer;\nimport java.nio.channels.Channels;\nimport java.nio.channels.ReadableByteChannel;\nimport java.nio.channels.WritableByteChannel;\n\npublic class IoUtil {\n\n\tprivate static final int INPUT_STREAM_BUFFER_SIZE = 64;\n\n\tprivate IoUtil() {}\n\n\t\/**\n\t * Read all content from an input stream to a byte array.\n\t * This does not close the input channel after reading. The caller\n\t * is responsible for doing that.\n\t *\/\n\tpublic static byte[] streamToBytes(InputStream in) throws IOException {\n\t    ReadableByteChannel channel = Channels.newChannel(in);\n\t    ByteBuffer byteBuffer = ByteBuffer.allocate(INPUT_STREAM_BUFFER_SIZE);\n\t    ByteArrayOutputStream bout = new ByteArrayOutputStream();\n\t    WritableByteChannel outChannel = Channels.newChannel(bout);\n\t    while (channel.read(byteBuffer) > 0 || byteBuffer.position() > 0) {\n\t        byteBuffer.flip();  \/\/ Make buffer ready for write.\n\t        outChannel.write(byteBuffer);\n\t        byteBuffer.compact(); \/\/ Make buffer ready for reading.\n\t    }\n\t    outChannel.close();\n\t    return bout.toByteArray();\n\t}\n}\n","new_contents":"package utilities;\n\nimport java.io.ByteArrayOutputStream;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.nio.Buffer;\nimport java.nio.ByteBuffer;\nimport java.nio.channels.Channels;\nimport java.nio.channels.ReadableByteChannel;\nimport java.nio.channels.WritableByteChannel;\n\npublic class IoUtil {\n\n\tprivate static final int INPUT_STREAM_BUFFER_SIZE = 64;\n\n\tprivate IoUtil() {}\n\n\t\/**\n\t * Read all content from an input stream to a byte array.\n\t * This does not close the input channel after reading. The caller\n\t * is responsible for doing that.\n\t *\/\n\tpublic static byte[] streamToBytes(InputStream in) throws IOException {\n\t    ReadableByteChannel channel = Channels.newChannel(in);\n\t    ByteBuffer byteBuffer = ByteBuffer.allocate(INPUT_STREAM_BUFFER_SIZE);\n\t    ByteArrayOutputStream bout = new ByteArrayOutputStream();\n\t    WritableByteChannel outChannel = Channels.newChannel(bout);\n\t    while (channel.read(byteBuffer) > 0 || byteBuffer.position() > 0) {\n            \/\/ Casting is necessary here.\n            \/\/ Similar fix in https:\/\/jira.mongodb.org\/browse\/JAVA-2559\n            \/\/ https:\/\/community.blynk.cc\/t\/java-error-on-remote-server-startup\/17957\/7\n\t    \t((Buffer) byteBuffer).flip();  \/\/ Make buffer ready for write.\n\t        outChannel.write(byteBuffer);\n\t        byteBuffer.compact(); \/\/ Make buffer ready for reading.\n\t    }\n\t    outChannel.close();\n\t    return bout.toByteArray();\n\t}\n}\n","subject":"Fix a backward compatibility bug between Java 10 and Java 8."}
{"old_contents":"package clientAPI;\r\n\r\nimport clientAPI.impl.BonusCreditStoreConnector;\r\nimport clientAPI.impl.CryptoStoreConnector;\r\nimport clientAPI.impl.PersonalDataConnector;\r\nimport clientAPI.impl.TicketManagerConnector;\r\nimport clientAPI.impl.WalletConnector;\r\nimport javax.smartcardio.Card;\r\n\r\n\r\npublic class ClientFactory {\r\n\r\n\t\r\n\t\r\n\t\/**\r\n\t * \r\n\t * @return\r\n\t *\/\r\n\tpublic static TicketManager getTicketManager(Card card) {\r\n\t\treturn new TicketManagerConnector(card);\r\n\t}\r\n\r\n\t\/**\r\n\t * \r\n\t * @return\r\n\t *\/\r\n\tpublic static Wallet getWallet(Card card) {\r\n\t\treturn new WalletConnector(card);\r\n\t}\r\n\r\n\t\/**\r\n\t * \r\n\t * @return\r\n\t *\/\r\n\tpublic static BonusCreditStore getBonusCreditStore(Card card) {\r\n\t\treturn new BonusCreditStoreConnector(card);\r\n\t}\r\n\r\n\t\/**\r\n\t * \r\n\t * @return\r\n\t *\/\r\n\tpublic static PersonalData getCustomerData(Card card) {\r\n\t\treturn new PersonalDataConnector(card);\r\n\t}\r\n\r\n\t\/**\r\n\t * \r\n\t * @return\r\n\t *\/\r\n\tpublic static CryptoStore getCryptoStore(Card card) {\r\n\t\treturn new CryptoStoreConnector(card);\r\n\t}\r\n}\r\n","new_contents":"package clientAPI;\r\n\r\nimport clientAPI.impl.BonusCreditStoreConnector;\r\nimport clientAPI.impl.CryptoStoreConnector;\r\nimport clientAPI.impl.PersonalDataConnector;\r\nimport clientAPI.impl.TicketManagerConnector;\r\nimport clientAPI.impl.WalletConnector;\r\nimport javax.smartcardio.Card;\r\n\r\n\r\npublic class ClientFactory {\r\n\r\n\t\r\n\t\r\n\t\/**\r\n\t * \r\n\t * @return\r\n\t *\/\r\n\tpublic static TicketManager getTicketManager(Card card) {\r\n\t\treturn new TicketManagerConnector(card);\r\n\t}\r\n\r\n\t\/**\r\n\t * \r\n\t * @return\r\n\t *\/\r\n\tpublic static Wallet getWallet(Card card) {\r\n\t\treturn new WalletConnector(card);\r\n\t}\r\n\r\n\t\/**\r\n\t * \r\n\t * @return\r\n\t *\/\r\n\tpublic static BonusCreditStore getBonusCreditStore(Card card) {\r\n\t\treturn new BonusCreditStoreConnector(card);\r\n\t}\r\n\r\n\t\/**\r\n\t * \r\n\t * @return\r\n\t *\/\r\n\tpublic static PersonalData getPersonalData(Card card) {\r\n\t\treturn new PersonalDataConnector(card);\r\n\t}\r\n\r\n\t\/**\r\n\t * \r\n\t * @return\r\n\t *\/\r\n\tpublic static CryptoStore getCryptoStore(Card card) {\r\n\t\treturn new CryptoStoreConnector(card);\r\n\t}\r\n}\r\n","subject":"Rename method for getting PersonalData instance"}
{"old_contents":"package com.gh4a.loader;\n\nimport java.util.HashMap;\n\nimport android.content.Context;\nimport android.support.v4.content.AsyncTaskLoader;\nimport android.util.Log;\n\nimport com.bugsense.trace.BugSenseHandler;\nimport com.gh4a.Constants;\nimport com.gh4a.Constants.LoaderResult;\n\npublic abstract class BaseLoader extends AsyncTaskLoader> {\n\n    public BaseLoader(Context context) {\n        super(context);\n    }\n\n    @Override\n    public HashMap loadInBackground() {\n        HashMap result = new HashMap();\n        try {\n            doLoadInBackground(result);\n            return result;\n        } catch (Exception e) {\n            result.put(LoaderResult.ERROR, true);\n            result.put(LoaderResult.ERROR_MSG, e.getMessage());\n            if (\"Received authentication challenge is null\".equalsIgnoreCase(e.getMessage())) {\n                result.put(LoaderResult.AUTH_ERROR, true);\n            }\n            Log.e(Constants.LOG_TAG, e.getMessage(), e);\n            return result;\n        }\n    }\n    \n    public abstract void doLoadInBackground(HashMap result) throws Exception;\n\n}\n","new_contents":"package com.gh4a.loader;\n\nimport java.util.HashMap;\n\nimport android.content.Context;\nimport android.support.v4.content.AsyncTaskLoader;\nimport android.util.Log;\n\nimport com.gh4a.Constants;\nimport com.gh4a.Constants.LoaderResult;\n\npublic abstract class BaseLoader extends AsyncTaskLoader> {\n\n    public BaseLoader(Context context) {\n        super(context);\n    }\n\n    @Override\n    public HashMap loadInBackground() {\n        HashMap result = new HashMap();\n        try {\n            doLoadInBackground(result);\n            return result;\n        } catch (Exception e) {\n            result.put(LoaderResult.ERROR, true);\n            result.put(LoaderResult.ERROR_MSG, e.getMessage());\n            if (\"Received authentication challenge is null\".equalsIgnoreCase(e.getMessage())\n                    || \"No authentication challenges found\".equalsIgnoreCase(e.getMessage())) {\n                result.put(LoaderResult.AUTH_ERROR, true);\n            }\n            Log.e(Constants.LOG_TAG, e.getMessage(), e);\n            return result;\n        }\n    }\n    \n    public abstract void doLoadInBackground(HashMap result) throws Exception;\n\n}\n","subject":"Handle auth error on JB"}
{"old_contents":"package io.pivotal.portfolio.config;\n\nimport org.springframework.cloud.client.loadbalancer.reactive.LoadBalancerExchangeFilterFunction;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.security.oauth2.client.registration.ClientRegistrationRepository;\nimport org.springframework.security.oauth2.client.web.OAuth2AuthorizedClientRepository;\nimport org.springframework.security.oauth2.client.web.reactive.function.client.ServletOAuth2AuthorizedClientExchangeFilterFunction;\nimport org.springframework.web.reactive.function.client.WebClient;\n\n@Configuration\npublic class BeanConfiguration {\n\n\n    @Bean\n    public WebClient webClient(LoadBalancerExchangeFilterFunction eff) {\n        return WebClient.builder()\n                .filter(eff)\n                .build();\n    }\n\n}\n","new_contents":"package io.pivotal.portfolio.config;\n\nimport org.springframework.cloud.client.loadbalancer.reactive.LoadBalancerExchangeFilterFunction;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.security.oauth2.client.registration.ClientRegistrationRepository;\nimport org.springframework.security.oauth2.client.web.OAuth2AuthorizedClientRepository;\nimport org.springframework.security.oauth2.client.web.reactive.function.client.ServletOAuth2AuthorizedClientExchangeFilterFunction;\nimport org.springframework.web.reactive.function.client.WebClient;\n\n@Configuration\npublic class BeanConfiguration {\n\n\n    @Bean\n    public WebClient webClient(WebClient.Builder webClientBuilder, LoadBalancerExchangeFilterFunction eff) {\n        return  webClientBuilder\n                .filter(eff)\n                .build();\n    }\n\n}\n","subject":"Fix definition of web client builder"}
{"old_contents":"package com.uwetrottmann.thetvdb;\n\nimport org.junit.BeforeClass;\n\npublic abstract class BaseTestCase {\n\n    \/\/ Do NOT use this token in your application, for testing purposes only!\n    private static final String JSON_WEB_TOKEN = \"\";\n\n    private static final boolean DEBUG = true;\n\n    private static final TheTvdb theTvdb = new TheTvdb();\n\n    @BeforeClass\n    public static void setUpOnce() {\n        theTvdb.setJsonWebToken(JSON_WEB_TOKEN);\n        theTvdb.setIsDebug(DEBUG);\n    }\n\n    protected final TheTvdb getTheTvdb() {\n        return theTvdb;\n    }\n\n}\n","new_contents":"package com.uwetrottmann.thetvdb;\n\nimport org.junit.BeforeClass;\n\npublic abstract class BaseTestCase {\n\n    \/\/ Do NOT use this token in your application, for testing purposes only!\n    private static final String JSON_WEB_TOKEN = \"\";\n\n    private static final boolean DEBUG = true;\n\n    private static final TheTvdb theTvdb = new TheTvdb();\n\n    @BeforeClass\n    public static void setUpOnce() {\n        if (JSON_WEB_TOKEN.length() == 0) {\n            System.err.println(\"No valid JSON Web Token is set. API methods other than \/login will fail.\");\n        }\n        theTvdb.setJsonWebToken(JSON_WEB_TOKEN);\n        theTvdb.setIsDebug(DEBUG);\n    }\n\n    protected final TheTvdb getTheTvdb() {\n        return theTvdb;\n    }\n\n}\n","subject":"Add warning if no JSON web token is set."}
{"old_contents":"package com.adaptionsoft.games.uglytrivia;\n\nimport org.junit.Before;\nimport org.junit.Ignore;\nimport org.junit.Test;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.core.Is.is;\nimport static org.mockito.Mockito.mock;\n\npublic class PlayersTest {\n\n    public static final String PLAYER_ONE = \"Thomas\";\n    public static final String PLAYER_TWO = \"Peter\";\n    public static final String ANY_PLAYER = \"Erik\";\n\n    \/\/ TODO minor duplication in all Player tests for creating the Players instance.\n    private PlayerUi ui = mock(PlayerUi.class);\n    private Players players = new Players(ui);\n\n    @Before\n    public void addPlayers() {\n        players.add(PLAYER_ONE);\n        players.add(PLAYER_TWO);\n    }\n\n    @Test\n    public void shouldAddOnePlayer() {\n        assertThat(players.size(), is(2));\n\n        players.add(TestPlayer.named(ANY_PLAYER));\n\n        assertThat(players.size(), is(3));\n    }\n\n    @Test(expected = IllegalAccessException.class)\n    @Ignore(\"not implemented\")\n    public void shouldFailForMoreThanSixPlayers() {\n        players.add(ANY_PLAYER);\n        players.add(ANY_PLAYER);\n        players.add(ANY_PLAYER);\n        players.add(ANY_PLAYER);\n        players.add(\"one too many\");\n    }\n}\n","new_contents":"package com.adaptionsoft.games.uglytrivia;\n\nimport org.junit.Before;\nimport org.junit.Ignore;\nimport org.junit.Test;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.core.Is.is;\nimport static org.mockito.Mockito.mock;\n\npublic class PlayersTest {\n\n    private static final String PLAYER_ONE = \"Thomas\";\n    private static final String PLAYER_TWO = \"Peter\";\n    private static final String ANY_PLAYER = \"Erik\";\n\n    \/\/ TODO minor duplication in all Player tests for creating the Players instance.\n    private PlayerUi ui = mock(PlayerUi.class);\n    private Players players = new Players(ui);\n\n    @Before\n    public void addPlayers() {\n        players.add(PLAYER_ONE);\n        players.add(PLAYER_TWO);\n    }\n\n    @Test\n    public void shouldAddOnePlayer() {\n        assertThat(players.size(), is(2));\n\n        players.add(TestPlayer.named(ANY_PLAYER));\n\n        assertThat(players.size(), is(3));\n    }\n\n    @Test(expected = IllegalAccessException.class)\n    @Ignore(\"not implemented\")\n    public void shouldFailForMoreThanSixPlayers() {\n        players.add(ANY_PLAYER);\n        players.add(ANY_PLAYER);\n        players.add(ANY_PLAYER);\n        players.add(ANY_PLAYER);\n        players.add(\"one too many\");\n    }\n}\n","subject":"Reduce visibility (as proposed by inspection)."}
{"old_contents":"package nl.tudelft.ewi.dea.jaxrs.api;\n\nimport javax.ws.rs.GET;\nimport javax.ws.rs.Path;\n\nimport com.google.inject.servlet.RequestScoped;\n\n@RequestScoped\n@Path(\"api\/exception\")\npublic class ExceptionAASResource {\n\n\t@GET\n\tpublic void throwException() {\n\t\tthrow new RuntimeException(\"Your Exception-As-A-Service is served!\");\n\t}\n\n}\n","new_contents":"package nl.tudelft.ewi.dea.jaxrs.api;\n\nimport javax.ws.rs.GET;\nimport javax.ws.rs.Path;\nimport javax.ws.rs.core.Response;\n\nimport com.google.inject.servlet.RequestScoped;\n\n@RequestScoped\n@Path(\"api\/exception\")\npublic class ExceptionAASResource {\n\n\t@GET\n\tpublic Response throwException() {\n\t\tthrow new RuntimeException(\"Your Exception-As-A-Service is served!\");\n\t}\n\n}\n","subject":"Return Response instead of void as per the spec."}
{"old_contents":"\/*\n * This file is part of SpongeAPI, licensed under the MIT License (MIT).\n *\n * Copyright (c) SpongePowered \n * Copyright (c) contributors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n *\/\npackage org.spongepowered.api.event;\n\n\/**\n * Represents a handler accepting events of a specified type.\n *\n * @param  The type of the event\n *\/\npublic interface EventHandler {\n\n    \/**\n     * Called when a event registered to this handler is called.\n     *\n     * @param event The called event\n     *\/\n    void handle(T event);\n\n}\n","new_contents":"\/*\n * This file is part of SpongeAPI, licensed under the MIT License (MIT).\n *\n * Copyright (c) SpongePowered \n * Copyright (c) contributors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n *\/\npackage org.spongepowered.api.event;\n\n\/**\n * Represents a handler accepting events of a specified type.\n *\n * @param  The type of the event\n *\/\npublic interface EventHandler {\n\n    \/**\n     * Called when a event registered to this handler is called.\n     *\n     * @param event The called event\n     * @throws Exception If an error occurs\n     *\/\n    void handle(T event) throws Exception;\n\n}\n","subject":"Allow dynamic event handlers to throw checked exceptions"}
{"old_contents":"package roycurtis.signshopexport.json;\n\nimport com.google.gson.ExclusionStrategy;\nimport com.google.gson.FieldAttributes;\n\n\/** Exclusions class for blacklisting objects and fields in Gson *\/\npublic class Exclusions implements ExclusionStrategy\n{\n    @Override\n    public boolean shouldSkipField(FieldAttributes f)\n    {\n        String name = f.getName();\n\n        return\n            \/\/ Ignore dynamic CraftBukkit handle field\n            name.equalsIgnoreCase(\"handle\")\n            \/\/ Ignore book page contents\n            || name.equalsIgnoreCase(\"pages\")\n            \/\/ Ignore unsupported tags\n            || name.equalsIgnoreCase(\"unhandledTags\")\n            \/\/ Ignore redundant data object\n            || name.equalsIgnoreCase(\"data\")\n            \/\/ Ignore hide flags\n            || name.equalsIgnoreCase(\"hideFlag\")\n            \/\/ Ignore repair costs\n            || name.equalsIgnoreCase(\"repairCost\")\n            \/\/ Ignore skull profiles\n            || name.equalsIgnoreCase(\"profile\")\n            \/\/ Ignore shield patterns\n            || name.equalsIgnoreCase(\"blockEntityTag\");\n    }\n\n    @Override\n    public boolean shouldSkipClass(Class clazz)\n    {\n        String name = clazz.getSimpleName();\n\n        if ( name.equalsIgnoreCase(\"ItemStack\") )\n        if ( clazz.getTypeName().startsWith(\"net.minecraft.server\") )\n            return true;\n\n        return name.equalsIgnoreCase(\"ChatComponentText\");\n    }\n}","new_contents":"package roycurtis.signshopexport.json;\n\nimport com.google.gson.ExclusionStrategy;\nimport com.google.gson.FieldAttributes;\n\n\/** Exclusions class for blacklisting objects and fields in Gson *\/\npublic class Exclusions implements ExclusionStrategy\n{\n    @Override\n    public boolean shouldSkipField(FieldAttributes f)\n    {\n        String name = f.getName();\n\n        return\n            \/\/ Ignore dynamic CraftBukkit handle field\n            name.equalsIgnoreCase(\"handle\")\n            \/\/ Ignore book page contents\n            || name.equalsIgnoreCase(\"pages\")\n            \/\/ Ignore unsupported tags\n            || name.equalsIgnoreCase(\"unhandledTags\")\n            \/\/ Ignore redundant data object\n            || name.equalsIgnoreCase(\"data\")\n            \/\/ Ignore hide flags\n            || name.equalsIgnoreCase(\"hideFlag\")\n            \/\/ Ignore repair costs\n            || name.equalsIgnoreCase(\"repairCost\")\n            \/\/ Ignore skull profiles\n            || name.equalsIgnoreCase(\"profile\")\n            \/\/ Ignore shield patterns\n            || name.equalsIgnoreCase(\"blockEntityTag\")\n            \/\/ Ignore 1.11 unbreakable tag\n            || name.equalsIgnoreCase(\"unbreakable\");\n    }\n\n    @Override\n    public boolean shouldSkipClass(Class clazz)\n    {\n        String name = clazz.getSimpleName();\n\n        if ( name.equalsIgnoreCase(\"ItemStack\") )\n        if ( clazz.getTypeName().startsWith(\"net.minecraft.server\") )\n            return true;\n\n        return name.equalsIgnoreCase(\"ChatComponentText\");\n    }\n}","subject":"Exclude 1.11's \"unbreakable\" common tag"}
{"old_contents":"package openperipheral.addons.glasses;\n\nimport net.minecraft.client.renderer.texture.IIconRegister;\nimport net.minecraft.entity.player.EntityPlayer;\nimport net.minecraft.item.Item;\nimport net.minecraft.item.ItemStack;\nimport net.minecraft.world.World;\nimport openperipheral.addons.OpenPeripheralAddons;\nimport openperipheral.addons.api.ITerminalItem;\nimport cpw.mods.fml.common.FMLCommonHandler;\n\npublic class ItemKeyboard extends Item {\n\n\tpublic ItemKeyboard() {\n\t\tsetCreativeTab(OpenPeripheralAddons.tabOpenPeripheralAddons);\n\t\tsetMaxStackSize(1);\n\t}\n\n\t@Override\n\tpublic void registerIcons(IIconRegister register) {\n\t\titemIcon = register.registerIcon(\"openperipheraladdons:keyboard\");\n\t}\n\n\t@Override\n\tpublic ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {\n\t\tif (world.isRemote) {\n\t\t\tItemStack helmet = TerminalUtils.getHeadSlot(player);\n\t\t\tif (helmet != null) {\n\t\t\t\tItem item = helmet.getItem();\n\t\t\t\tif (item instanceof ITerminalItem) {\n\t\t\t\t\tlong guid = ((ITerminalItem)item).getTerminalGuid(helmet);\n\t\t\t\t\tFMLCommonHandler.instance().showGuiScreen(new GuiCapture(guid));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn stack;\n\t}\n\n}\n","new_contents":"package openperipheral.addons.glasses;\n\nimport net.minecraft.client.renderer.texture.IIconRegister;\nimport net.minecraft.entity.player.EntityPlayer;\nimport net.minecraft.item.Item;\nimport net.minecraft.item.ItemStack;\nimport net.minecraft.world.World;\nimport openperipheral.addons.OpenPeripheralAddons;\nimport openperipheral.addons.api.ITerminalItem;\nimport cpw.mods.fml.common.FMLCommonHandler;\n\npublic class ItemKeyboard extends Item {\n\n\tpublic ItemKeyboard() {\n\t\tsetCreativeTab(OpenPeripheralAddons.tabOpenPeripheralAddons);\n\t\tsetMaxStackSize(1);\n\t}\n\n\t@Override\n\tpublic void registerIcons(IIconRegister register) {\n\t\titemIcon = register.registerIcon(\"openperipheraladdons:keyboard\");\n\t}\n\n\t@Override\n\tpublic ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {\n\t\tif (world.isRemote) {\n\t\t\tItemStack helmet = TerminalUtils.getHeadSlot(player);\n\t\t\tif (helmet != null) {\n\t\t\t\tItem item = helmet.getItem();\n\t\t\t\tif (item instanceof ITerminalItem) {\n\t\t\t\t\tLong guid = ((ITerminalItem)item).getTerminalGuid(helmet);\n\t\t\t\t\tif (guid != null) FMLCommonHandler.instance().showGuiScreen(new GuiCapture(guid));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn stack;\n\t}\n\n}\n","subject":"Fix NPE when using keyboard"}
{"old_contents":"package com.reactlibrary.linkedinsdk;\n\n\nimport com.facebook.react.ReactPackage;\nimport com.facebook.react.bridge.JavaScriptModule;\nimport com.facebook.react.bridge.NativeModule;\nimport com.facebook.react.bridge.ReactApplicationContext;\nimport com.facebook.react.uimanager.ViewManager;\nimport java.util.Arrays;\nimport java.util.Collections;\nimport java.util.List;\n\n\npublic class RNLinkedInSessionManagerPackage implements ReactPackage {\n    @Override\n    public List createNativeModules(ReactApplicationContext reactContext) {\n      return Arrays.asList(new RNLinkedInSessionManagerModule(reactContext));\n    }\n\n    @Override\n    public List> createJSModules() {\n      return Collections.emptyList();\n    }\n\n    @Override\n    public List createViewManagers(ReactApplicationContext reactContext) {\n      return Collections.emptyList();\n    }\n}\n","new_contents":"package com.reactlibrary.linkedinsdk;\n\n\nimport com.facebook.react.ReactPackage;\nimport com.facebook.react.bridge.JavaScriptModule;\nimport com.facebook.react.bridge.NativeModule;\nimport com.facebook.react.bridge.ReactApplicationContext;\nimport com.facebook.react.uimanager.ViewManager;\nimport java.util.Arrays;\nimport java.util.Collections;\nimport java.util.List;\n\n\npublic class RNLinkedInSessionManagerPackage implements ReactPackage {\n    @Override\n    public List createNativeModules(ReactApplicationContext reactContext) {\n      return Arrays.asList(new RNLinkedInSessionManagerModule(reactContext));\n    }\n\n    \/\/ Deprecated RN 0.47\n    public List> createJSModules() {\n      return Collections.emptyList();\n    }\n\n    @Override\n    public List createViewManagers(ReactApplicationContext reactContext) {\n      return Collections.emptyList();\n    }\n}\n","subject":"Handle Android RN 0.47 breaking change"}
{"old_contents":"package de.linkvt.bachelor.features.annotations;\n\nimport de.linkvt.bachelor.features.Feature;\nimport de.linkvt.bachelor.features.FeatureCategory;\n\nimport org.semanticweb.owlapi.model.OWLAnnotation;\nimport org.semanticweb.owlapi.model.OWLAxiom;\nimport org.semanticweb.owlapi.model.OWLObjectProperty;\nimport org.springframework.stereotype.Component;\n\n@Component\npublic class OwlDeprecatedPropertyFeature extends Feature {\n  @Override\n  public void addToOntology() {\n    OWLObjectProperty property = featurePool.getExclusiveProperty(\"::DeprecatedProperty\");\n    addToGenericDomainAndNewRange(property, featurePool.getExclusiveClass(\":DeprecatedPropertyRange\"));\n\n    OWLAnnotation annotation = factory.getOWLAnnotation(factory.getOWLDeprecated(), factory.getOWLLiteral(true));\n    OWLAxiom deprecatedAxiom = factory.getOWLAnnotationAssertionAxiom(property.getIRI(), annotation);\n    addAxiomToOntology(deprecatedAxiom);\n  }\n\n  @Override\n  public String getName() {\n    return \"owl:DeprecatedProperty\";\n  }\n\n  @Override\n  public String getToken() {\n    return \"deprecatedprop\";\n  }\n\n  @Override\n  public FeatureCategory getCategory() {\n    return FeatureCategory.ANNOTATIONS;\n  }\n}\n","new_contents":"package de.linkvt.bachelor.features.annotations;\n\nimport de.linkvt.bachelor.features.Feature;\nimport de.linkvt.bachelor.features.FeatureCategory;\n\nimport org.semanticweb.owlapi.model.OWLAnnotation;\nimport org.semanticweb.owlapi.model.OWLAxiom;\nimport org.semanticweb.owlapi.model.OWLObjectProperty;\nimport org.springframework.stereotype.Component;\n\n@Component\npublic class OwlDeprecatedPropertyFeature extends Feature {\n  @Override\n  public void addToOntology() {\n    OWLObjectProperty property = featurePool.getExclusiveProperty(\":DeprecatedProperty\");\n    addToGenericDomainAndNewRange(property, featurePool.getExclusiveClass(\":DeprecatedPropertyRange\"));\n\n    OWLAnnotation annotation = factory.getOWLAnnotation(factory.getOWLDeprecated(), factory.getOWLLiteral(true));\n    OWLAxiom deprecatedAxiom = factory.getOWLAnnotationAssertionAxiom(property.getIRI(), annotation);\n    addAxiomToOntology(deprecatedAxiom);\n  }\n\n  @Override\n  public String getName() {\n    return \"owl:DeprecatedProperty\";\n  }\n\n  @Override\n  public String getToken() {\n    return \"deprecatedprop\";\n  }\n\n  @Override\n  public FeatureCategory getCategory() {\n    return FeatureCategory.ANNOTATIONS;\n  }\n}\n","subject":"Fix prefix of deprecated property"}
{"old_contents":"package edu.northwestern.bioinformatics.studycalendar.dao;\n\nimport edu.northwestern.bioinformatics.studycalendar.domain.PlannedActivity;\nimport org.springframework.transaction.annotation.Transactional;\n\nimport java.util.List;\n\n\/**\n * @author Rhett Sutphin\n *\/\n@Transactional (readOnly=true)\npublic class PlannedActivityDao extends StudyCalendarMutableDomainObjectDao {\n    @Override\n    public Class domainClass() {\n        return PlannedActivity.class;\n    }\n\n    @Transactional(readOnly=false)\n    public void delete(PlannedActivity event) {\n        getHibernateTemplate().delete(event);\n    }\n\n    public List getPlannedActivitiesForAcivity(Integer activityId) {\n\n        return (List) getHibernateTemplate().find(\"select pa from PlannedActivity as pa where pa.activity.id=?\",activityId);\n    }\n\n   \n}\n","new_contents":"package edu.northwestern.bioinformatics.studycalendar.dao;\n\nimport edu.northwestern.bioinformatics.studycalendar.domain.PlannedActivity;\nimport org.springframework.transaction.annotation.Transactional;\n\nimport java.util.List;\n\n\/**\n * @author Rhett Sutphin\n *\/\n@Transactional (readOnly=true)\npublic class PlannedActivityDao extends StudyCalendarMutableDomainObjectDao {\n    @Override\n    public Class domainClass() {\n        return PlannedActivity.class;\n    }\n\n    \/**\n    * Deletes a planned activity\n    *\n    * @param  event the planned activity to delete\n    *\/\n    @Transactional(readOnly=false)\n    public void delete(PlannedActivity event) {\n        getHibernateTemplate().delete(event);\n    }\n\n    \/**\n    * Finds all planned activities for a activity id\n    *\n    * @param  activityId the activity id to search with\n    * @return      a list of planned activities with the activity id passed in\n    *\/\n    public List getPlannedActivitiesForAcivity(Integer activityId) {\n        return (List) getHibernateTemplate().find(\"select pa from PlannedActivity as pa where pa.activity.id=?\",activityId);\n    }\n}\n","subject":"Add javadoc to planned activity dao."}
{"old_contents":"\/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership.  The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License.  You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n *\/\npackage org.apache.commons.compress.archivers;\n\n\/**\n * Exception thrown by ArchiveStreamFactory if a format is\n * requested\/detected that doesn't support streaming.\n * @since 1.8\n *\/\npublic class StreamingNotSupportedException extends ArchiveException {\n    private final String format;\n\n    \/**\n     * Creates a new StreamingNotSupportedException.\n     * @param format the format that has been requested\/detected.\n     *\/\n    public StreamingNotSupportedException(String format) {\n        super(\"The \" + format + \" doesn't support streaming.\");\n        this.format = format;\n    }\n\n    \/**\n     * Returns the format that has been requested\/detected.\n     * @return the format that has been requested\/detected.\n     *\/\n    public String getFormat() {\n        return format;\n    }\n    \n}\n","new_contents":"\/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements.  See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership.  The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License.  You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n *\/\npackage org.apache.commons.compress.archivers;\n\n\/**\n * Exception thrown by ArchiveStreamFactory if a format is\n * requested\/detected that doesn't support streaming.\n * @since 1.8\n *\/\npublic class StreamingNotSupportedException extends ArchiveException {\n    \n    private static final long serialVersionUID = 1L;\n    \n    private final String format;\n\n    \/**\n     * Creates a new StreamingNotSupportedException.\n     * @param format the format that has been requested\/detected.\n     *\/\n    public StreamingNotSupportedException(String format) {\n        super(\"The \" + format + \" doesn't support streaming.\");\n        this.format = format;\n    }\n\n    \/**\n     * Returns the format that has been requested\/detected.\n     * @return the format that has been requested\/detected.\n     *\/\n    public String getFormat() {\n        return format;\n    }\n    \n}\n","subject":"Add missing serial version ID (default)."}
{"old_contents":"package com.snowble.android.widget.verticalstepper;\n\nimport android.content.res.Resources;\nimport android.util.TypedValue;\n\nclass ThemeUtils {\n    public static int getResolvedAttributeData(Resources.Theme theme, int attr, int defaultData) {\n        TypedValue value = new TypedValue();\n        theme.resolveAttribute(attr, value, false);\n        int resolvedAttributeData;\n        if (value.type != TypedValue.TYPE_NULL) {\n            resolvedAttributeData = value.data;\n        } else {\n            resolvedAttributeData = defaultData;\n        }\n        return resolvedAttributeData;\n    }\n}\n","new_contents":"package com.snowble.android.widget.verticalstepper;\n\nimport android.content.res.Resources;\nimport android.util.TypedValue;\n\nclass ThemeUtils {\n    static int getResolvedAttributeData(Resources.Theme theme, int attr, int defaultData) {\n        TypedValue value = new TypedValue();\n        theme.resolveAttribute(attr, value, false);\n        int resolvedAttributeData;\n        if (value.type != TypedValue.TYPE_NULL) {\n            resolvedAttributeData = value.data;\n        } else {\n            resolvedAttributeData = defaultData;\n        }\n        return resolvedAttributeData;\n    }\n}\n","subject":"Reduce visibility one more time"}
{"old_contents":"package referencelibrary;\n\nimport org.junit.Before;\nimport org.junit.Test;\nimport referencelibrary.data.StubDao;\nimport referencelibrary.reference.BookReference;\nimport referencelibrary.reference.Reference;\n\nimport java.util.List;\n\nimport static org.junit.Assert.*;\nimport referencelibrary.util.FileUtil;\n\n\/**\n * Created by petri on 18.4.2016.\n *\/\npublic class AppTest {\n    private App app;\n\n    @Before\n    public void setUp() {\n        app = new App(new StubDao());\n    }\n\n    @Test\n    public void newReference() {\n        app.newReference(new BookReference(\"REF1\"));\n        List reflist = app.listReferences();\n        assertEquals(2, reflist.size());\n        assertEquals(\"REF1\", reflist.get(1).getReferenceName());\n    }\n\n    @Test\n    public void listReferences() {\n        List reflist = app.listReferences();\n        assertEquals(\"REF\", reflist.get(0).getReferenceName());\n    }\n\n    @Test\n    public void generateBixTexFile() {\n        String filename = \"test_bibtex.bib\";\n        app.generateBixTexFile(filename);\n        String result = FileUtil.Read(filename);\n        assertEquals(\"@Book{REF,\\n}\\n\\n\", result);\n    }\n\n}","new_contents":"package referencelibrary;\n\nimport java.io.File;\nimport org.junit.Before;\nimport org.junit.Test;\nimport referencelibrary.data.StubDao;\nimport referencelibrary.reference.BookReference;\nimport referencelibrary.reference.Reference;\n\nimport java.util.List;\nimport org.junit.After;\n\nimport static org.junit.Assert.*;\nimport referencelibrary.util.FileUtil;\n\n\/**\n * Created by petri on 18.4.2016.\n *\/\npublic class AppTest {\n    private final String filename = \"test_bibtex.bib\";\n    private App app;\n\n    @Before\n    public void setUp() {\n        app = new App(new StubDao());\n        File testFile = new File(filename);\n        testFile.delete();\n    }\n\n    @After\n    public void tearDown() {\n        File testFile = new File(filename);\n        testFile.delete();\n    }\n\n    @Test\n    public void newReference() {\n        app.newReference(new BookReference(\"REF1\"));\n        List reflist = app.listReferences();\n        assertEquals(2, reflist.size());\n        assertEquals(\"REF1\", reflist.get(1).getReferenceName());\n    }\n\n    @Test\n    public void listReferences() {\n        List reflist = app.listReferences();\n        assertEquals(\"REF\", reflist.get(0).getReferenceName());\n    }\n\n    @Test\n    public void generateBixTexFile() {\n        app.generateBixTexFile(filename);\n        String result = FileUtil.Read(filename);\n        assertEquals(\"@Book{REF,\\n}\\n\\n\", result);\n    }\n\n}","subject":"Make BookReference test cleanup test file"}
{"old_contents":"package com.uwetrottmann.trakt.v2.entities;\n\npublic class Images {\n\n    public MoreImageSizes poster;\n    public MoreImageSizes fanart;\n    \/** A {@link com.uwetrottmann.trakt.v2.entities.Person} has headshots. *\/\n    public MoreImageSizes headshot;\n    public ImageSizes banner;\n    public ImageSizes logo;\n    public ImageSizes clearart;\n    public ImageSizes thumb;\n    public ImageSizes screenshot;\n    public ImageSizes avatar;\n\n}\n","new_contents":"package com.uwetrottmann.trakt.v2.entities;\n\npublic class Images {\n\n    public MoreImageSizes poster;\n    public MoreImageSizes fanart;\n    public MoreImageSizes screenshot;\n    \/** A {@link com.uwetrottmann.trakt.v2.entities.Person} has headshots. *\/\n    public MoreImageSizes headshot;\n    public ImageSizes banner;\n    public ImageSizes logo;\n    public ImageSizes clearart;\n    public ImageSizes thumb;\n    public ImageSizes avatar;\n\n}\n","subject":"Add additional image sizes for screenshots."}
{"old_contents":"package com.uwetrottmann.trakt.v2.entities;\n\nimport com.uwetrottmann.trakt.v2.enums.Rating;\n\npublic class Season {\n\n    public Integer number;\n    public SeasonIds ids;\n\n    public Rating rating;\n    public Integer episode_count;\n    public Images images;\n\n}\n","new_contents":"package com.uwetrottmann.trakt.v2.entities;\n\npublic class Season {\n\n    public Integer number;\n    public SeasonIds ids;\n\n    public Double rating;\n    public Integer episode_count;\n    public Images images;\n\n}\n","subject":"Make season rating a global rating, so double type."}
{"old_contents":"package nom.bdezonia.zorbage.type.algebra;\n\nimport nom.bdezonia.zorbage.function.Function1;\n\n\/**\n * \n * @author Barry DeZonia\n *\n *\/\npublic interface EvenOdd {\n\tFunction1 isEven();\n\tFunction1 isOdd();\n}\n","new_contents":"\/*\n * Zorbage: an algebraic data hierarchy for use in numeric processing.\n *\n * Copyright (C) 2016-2019 Barry DeZonia\n * \n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n * \n * 1. Redistributions of source code must retain the above copyright notice,\n *    this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n *    this list of conditions and the following disclaimer in the documentation\n *    and\/or other materials provided with the distribution.\n * \n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n *\/\npackage nom.bdezonia.zorbage.type.algebra;\n\nimport nom.bdezonia.zorbage.function.Function1;\n\n\/**\n * \n * @author Barry DeZonia\n *\n *\/\npublic interface EvenOdd {\n\tFunction1 isEven();\n\tFunction1 isOdd();\n}\n","subject":"Add license header to file that needs it"}
{"old_contents":"package commands;\n\npublic class RegexConstants\n{\n    public static final String CHANNEL = \"[\\\\w-_]+\";\n\n    private RegexConstants(){}\n\n    public static final String SPACES = \"\\\\s+\";\n    public static final String CHANGE_ID = \"\\\\d+\";\n    public static final String PROJECT = \"[^@]\\\\W*\";\n\n    public static final String USER_ALIAS = \"@\\\\S*\";\n    public static final String ANYTHING_ELSE = \".*\";\n    public static final String COMMENT = ANYTHING_ELSE;\n\n}\n","new_contents":"package commands;\n\npublic class RegexConstants\n{\n    public static final String CHANNEL = \"[\\\\w-_]+\";\n\n    private RegexConstants(){}\n\n    public static final String SPACES = \"\\\\s+\";\n    public static final String CHANGE_ID = \"\\\\d+\";\n    public static final String PROJECT = \"[^@][\\\\w|-]+\";\n\n    public static final String USER_ALIAS = \"@\\\\S*\";\n    public static final String ANYTHING_ELSE = \".*\";\n    public static final String COMMENT = ANYTHING_ELSE;\n\n}\n","subject":"Fix parsing of project name"}
{"old_contents":"package com.elmakers.mine.bukkit.api.block;\n\nimport java.util.List;\n\nimport org.bukkit.Location;\nimport org.bukkit.block.Block;\nimport org.bukkit.entity.Entity;\n\nimport com.elmakers.mine.bukkit.api.magic.Mage;\n\npublic interface UndoList extends BlockList, Comparable {\n    public void commit();\n    public void undo();\n    public void undo(boolean undoEntityChanges);\n\n    public void setScheduleUndo(int ttl);\n    public int getScheduledUndo();\n    public boolean bypass();\n    public long getCreatedTime();\n    public long getModifiedTime();\n    public long getScheduledTime();\n    public boolean isScheduled();\n\n    public void prune();\n\n    public void add(Entity entity);\n    public void remove(Entity entity);\n    public void modify(Entity entity);\n    public void add(Runnable runnable);\n\n    public void convert(Entity entity, Block block);\n    public void fall(Entity entity, Block block);\n    public void explode(Entity entity, List explodedBlocks);\n    public void cancelExplosion(Entity entity);\n\n    public boolean contains(Location location, int threshold);\n\n    public String getName();\n    public Mage getOwner();\n}\n","new_contents":"package com.elmakers.mine.bukkit.api.block;\n\nimport java.util.List;\n\nimport com.elmakers.mine.bukkit.api.entity.EntityData;\nimport org.bukkit.Location;\nimport org.bukkit.block.Block;\nimport org.bukkit.entity.Entity;\n\nimport com.elmakers.mine.bukkit.api.magic.Mage;\n\npublic interface UndoList extends BlockList, Comparable {\n    public void commit();\n    public void undo();\n    public void undo(boolean undoEntityChanges);\n\n    public void setScheduleUndo(int ttl);\n    public int getScheduledUndo();\n    public boolean bypass();\n    public long getCreatedTime();\n    public long getModifiedTime();\n    public long getScheduledTime();\n    public boolean isScheduled();\n\n    public void prune();\n\n    public void add(Entity entity);\n    public void remove(Entity entity);\n    public EntityData modify(Entity entity);\n    public void add(Runnable runnable);\n\n    public void convert(Entity entity, Block block);\n    public void fall(Entity entity, Block block);\n    public void explode(Entity entity, List explodedBlocks);\n    public void cancelExplosion(Entity entity);\n\n    public boolean contains(Location location, int threshold);\n\n    public String getName();\n    public Mage getOwner();\n}\n","subject":"Return the EntityData on entity undo"}
{"old_contents":"\/* (c) 2014 LinkedIn Corp. All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use\n * this file except in compliance with the License. You may obtain a copy of the\n * License at  http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software distributed\n * under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, either express or implied.\n *\/\n\npackage com.linkedin.uif.fork;\n\nimport org.apache.avro.Schema;\n\n\/**\n * A wrapper class for {@link org.apache.avro.Schema} that is also {@link Copyable}.\n *\n * @author ynli\n *\/\npublic class CopyableSchema implements Copyable {\n\n    private final Schema schema;\n\n    public CopyableSchema(Schema schema) {\n        this.schema = schema;\n    }\n\n    @Override\n    public Schema copy() throws CopyNotSupportedException {\n        return new Schema.Parser().parse(this.schema.toString());\n    }\n}\n","new_contents":"\/* (c) 2014 LinkedIn Corp. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use\n * this file except in compliance with the License. You may obtain a copy of the\n * License at  http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed\n * under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, either express or implied.\n *\/\n\npackage com.linkedin.uif.fork;\n\nimport org.apache.avro.Schema;\n\n\n\/**\n * A wrapper class for {@link org.apache.avro.Schema} that is also {@link Copyable}.\n *\n * @author ynli\n *\/\npublic class CopyableSchema implements Copyable {\n\n  private final Schema schema;\n\n  public CopyableSchema(Schema schema) {\n    this.schema = schema;\n  }\n\n  @Override\n  public Schema copy()\n      throws CopyNotSupportedException {\n    return new Schema.Parser().setValidate(false).parse(this.schema.toString());\n  }\n}\n","subject":"Set validation to false when copying a schema"}
{"old_contents":"package fabzo.kraken;\n\nimport fabzo.kraken.components.DockerComponent;\nimport fabzo.kraken.handler.docker.DockerConfiguration;\nimport fabzo.kraken.handler.docker.DockerLifecycleHandler;\nimport fabzo.kraken.wait.MySQLWait;\nimport org.junit.Test;\n\nimport java.time.Duration;\n\npublic class WaitTest {\n\n    @Test\n    public void testDatabaseWait() {\n        final Environment environment = Kraken.createEnvironment(new EnvironmentModule() {\n            @Override\n            public void configure() {\n                register(DockerLifecycleHandler.withConfig(\n                        DockerConfiguration.create()\n                                .withDockerSocket(DockerConfiguration.DOCKER_HOST_UNIX)));\n\n                register(DockerComponent.create()\n                        .withName(\"mariadb\")\n                        .withImage(\"fabzo\/mariadb-docker\", \"delivery\")\n                        .withForcePull()\n                        .withFollowLogs()\n                        .withPortBinding(\"db\", 3306)\n                        .withEnv(\"MYSQL_DATABASE\", \"delivery\")\n                        .withEnv(\"MYSQL_ALLOW_EMPTY_PASSWORD\", \"yes\")\n                        .withWait(new MySQLWait(\"delivery\",\"db\", Duration.ofSeconds(60))));\n\n            }\n        });\n\n        try {\n            environment.start();\n        } catch (final Exception e) {\n            e.printStackTrace();\n        } finally {\n            environment.stop();\n        }\n    }\n}\n","new_contents":"package fabzo.kraken;\n\nimport fabzo.kraken.components.DockerComponent;\nimport fabzo.kraken.handler.docker.DockerConfiguration;\nimport fabzo.kraken.handler.docker.DockerLifecycleHandler;\nimport fabzo.kraken.wait.MySQLWait;\nimport org.junit.Test;\n\nimport java.time.Duration;\n\npublic class WaitTest {\n\n    @Test\n    public void testDatabaseWait() {\n        final Environment environment = Kraken.createEnvironment(new EnvironmentModule() {\n            @Override\n            public void configure() {\n                register(DockerLifecycleHandler.withConfig(\n                        DockerConfiguration.create()\n                                .withDockerSocket(DockerConfiguration.DOCKER_HOST_UNIX)));\n\n                register(DockerComponent.create()\n                        .withName(\"mariadb\")\n                        .withImage(\"fabzo\/mariadb-docker\", \"testdb\")\n                        .withForcePull()\n                        .withFollowLogs()\n                        .withPortBinding(\"db\", 3306)\n                        .withEnv(\"MYSQL_DATABASE\", \"testdb\")\n                        .withEnv(\"MYSQL_ALLOW_EMPTY_PASSWORD\", \"yes\")\n                        .withWait(new MySQLWait(\"testdb\",\"db\", Duration.ofSeconds(60))));\n\n            }\n        });\n\n        try {\n            environment.start();\n        } catch (final Exception e) {\n            e.printStackTrace();\n        } finally {\n            environment.stop();\n        }\n    }\n}\n","subject":"Use generic test db name"}
{"old_contents":"public class Codec {\n  private Map urlMapper = new HashMap<>();\n  private Random rand = new Random();\n  private byte[] stringArray = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\".getBytes();\n\n  \/\/ Encodes a URL to a shortened URL.\n  public String encode(String longUrl) {\n    String shortened = getShortUrl(longUrl);\n    urlMapper.put(shortened, longUrl);\n    return shortened;\n  }\n\n  \/\/ Decodes a shortened URL to its original URL.\n  public String decode(String shortUrl) {\n    return urlMapper.get(shortUrl);\n  }\n}\n\n","new_contents":"public class Codec {\n    private Map urlMapper = new HashMap<>();\n    private Random rand = new Random();\n    private byte[] stringArray = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\".getBytes();\n\n    private String getShortUrl() {\n      byte[] s = new byte[6];\n      for (int i = 0; i < 6; i++) {\n        int n = rand.nextInt(62);\n        s[i] = stringArray[n];\n      }\n      return \"http:\/\/tinyurl.com\/\" + new String(s);\n    }\n\n    \/\/ Encodes a URL to a shortened URL.\n    public String encode(String longUrl) {\n        String shortened = null;\n        int count = 0;\n        while (count < 10) {\n            shortened = getShortUrl();\n            if (urlMapper.get(shortened) == null) {\n                urlMapper.put(shortened, longUrl);\n                break;\n            }\n            count++;\n        }\n        return shortened;\n    }\n\n    \/\/ Decodes a shortened URL to its original URL.\n    public String decode(String shortUrl) {\n        return urlMapper.get(shortUrl);\n    }\n}\n\n","subject":"Update java solution for 'Encode and Decode TinyURL'"}
{"old_contents":"\/*\n * Copyright (C) 2009 Google Inc.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not\n * use this file except in compliance with the License. You may obtain a copy of\n * the License at\n * \n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\n * License for the specific language governing permissions and limitations under\n * the License.\n *\/\n\npackage com.android.inputmethod.latin;\n\nimport android.app.backup.BackupHelperAgent;\nimport android.app.backup.SharedPreferencesBackupHelper;\n\n\/**\n * Backs up the Latin IME shared preferences.\n *\/\npublic class LatinIMEBackupAgent extends BackupHelperAgent {\n\n    public void onCreate() {\n        addHelper(\"shared_pref\", new SharedPreferencesBackupHelper(this,\n                getPackageName() + \"_preferences\"));\n    }\n}\n","new_contents":"\/*\n * Copyright (C) 2009 Google Inc.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not\n * use this file except in compliance with the License. You may obtain a copy of\n * the License at\n * \n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\n * License for the specific language governing permissions and limitations under\n * the License.\n *\/\n\npackage com.android.inputmethod.latin;\n\nimport android.app.backup.BackupAgentHelper;\nimport android.app.backup.SharedPreferencesBackupHelper;\n\n\/**\n * Backs up the Latin IME shared preferences.\n *\/\npublic class LatinIMEBackupAgent extends BackupAgentHelper {\n\n    public void onCreate() {\n        addHelper(\"shared_pref\", new SharedPreferencesBackupHelper(this,\n                getPackageName() + \"_preferences\"));\n    }\n}\n","subject":"Fix build breakage due to api change"}
{"old_contents":"package com.twu.biblioteca;\n\nimport org.junit.Test;\n\nimport static org.junit.Assert.assertEquals;\n\/**\n * Created by watsonarw on 16\/04\/15.\n *\/\npublic class LibraryTest {\n\n\n    @Test\n    public void testSingleBookLibrary() {\n        Library library = new Library();\n        library.addBook(\"The Hobbit\", \"J.R.R. Tolkien\", 1937);\n        assertEquals(\"The Hobbit - J.R.R. Tolkien, 1937\\n\",library.getBookList());\n    }\n\n\n    @Test\n    public void testMultiBookLibrary() {\n        Library library = new Library();\n        library.addBook(\"The Hobbit\", \"J.R.R. Tolkien\", 1937);\n        library.addBook(\"Catcher in the Rye\", \"J.D. Salinger\", 1951);\n        assertEquals(\"The Hobbit - J.R.R. Tolkien, 1937\\nCatcher in the Rye - J.D. Salinger, 1951\\n\",library.getBookList());\n    }\n}\n","new_contents":"package com.twu.biblioteca;\n\nimport org.junit.Test;\n\nimport static org.junit.Assert.assertEquals;\n\/**\n * Created by watsonarw on 16\/04\/15.\n *\/\npublic class LibraryTest {\n\n\n    @Test\n    public void testSingleBookLibrary() {\n        Library library = new Library();\n        library.addBook(\"The Hobbit\", \"J.R.R. Tolkien\", 1937);\n        assertEquals(\" 1 | The Hobbit - J.R.R. Tolkien, 1937\\n\",library.getBookList());\n    }\n\n\n    @Test\n    public void testMultiBookLibrary() {\n        Library library = new Library();\n        library.addBook(\"The Hobbit\", \"J.R.R. Tolkien\", 1937);\n        library.addBook(\"Catcher in the Rye\", \"J.D. Salinger\", 1951);\n        assertEquals(\" 1 | The Hobbit - J.R.R. Tolkien, 1937\\n 2 | Catcher in the Rye - J.D. Salinger, 1951\\n\",library.getBookList());\n    }\n}\n","subject":"Update Expected Library test responses for numbering books"}
{"old_contents":"\/**\n * Copyright (c) 2016 Dr. Chris Senior.\n * See LICENSE.txt for licensing terms\n *\/\npackage com.asteroid.duck.osgi.example.album;\n\n\/**\n * Interface to a service that provides information about Underworld albums\n *\/\npublic interface AlbumInfoService {\n\n}\n","new_contents":"\/**\n * Copyright (c) 2016 Dr. Chris Senior.\n * See LICENSE.txt for licensing terms\n *\/\npackage com.asteroid.duck.osgi.example.album;\n\nimport java.util.List;\n\n\/**\n * Interface to a service that provides information about Underworld albums\n *\/\npublic interface AlbumInfoService {\n    List getAlbums();\n    List getTracks();\n}\n","subject":"Add API for album info service"}
{"old_contents":"\/*\n * Copyright (C) 2011 Benoit GUEROUT  and Yves AMSELLEM \n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\n\npackage org.jongo.bson;\n\nimport com.mongodb.DBObject;\nimport com.mongodb.LazyDBObject;\nimport org.bson.LazyBSONCallback;\n\nclass RelaxedLazyDBObject extends LazyDBObject implements BsonDocument {\n\n    public RelaxedLazyDBObject(byte[] data, LazyBSONCallback cbk) {\n        super(data, cbk);\n    }\n\n    public byte[] toByteArray() {\n        return _input.array();\n    }\n\n    public DBObject toDBObject() {\n        return this;\n    }\n\n    public int getSize() {\n        return getBSONSize();\n    }\n}\n","new_contents":"\/*\n * Copyright (C) 2011 Benoit GUEROUT  and Yves AMSELLEM \n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\n\npackage org.jongo.bson;\n\nimport com.mongodb.DBObject;\nimport com.mongodb.LazyDBObject;\nimport org.bson.LazyBSONCallback;\n\nclass RelaxedLazyDBObject extends LazyDBObject implements BsonDocument {\n\n    public RelaxedLazyDBObject(byte[] data, LazyBSONCallback cbk) {\n        super(data, cbk);\n    }\n\n    public byte[] toByteArray() {\n        return getBytes();\n    }\n\n    public DBObject toDBObject() {\n        return this;\n    }\n\n    public int getSize() {\n        return getBSONSize();\n    }\n}\n","subject":"Remove the use of a protected deprecated field"}
{"old_contents":"\/**\n * Created by Nathan_Zeplowitz on 4\/14\/15.\n *\/\npublic class GuessingGame {\n}\n","new_contents":"\/**\n * Created by Nathan_Zeplowitz on 4\/14\/15.\n *\/\npublic class GuessingGame {\n    public static void main(String[] args) {\n        RandomNumber randomNumber = new RandomNumber();\n        GameHelper helper = new GameHelper();\n        boolean guessCorrect = false;\n\n        while(!guessCorrect){\n            String userGuess = helper.getUserInput(\"Guess a Number Between 1 and 100:\");\n            String result = randomNumber.checkGuess(userGuess);\n\n            if (result.equals(\"Correct\")) {\n                guessCorrect = true;\n                System.out.println(\"Your guess was correct. You Win!\");\n                break;\n            }\n\n            System.out.println(result);\n\n        }\n    }\n\n}\n","subject":"Add Main Game With Checks for User Guesses"}
{"old_contents":"\/**\n * Created by Nathan_Zeplowitz on 4\/14\/15.\n *\/\npublic class RandomNumber {\n    private int number;\n\n    public RandomNumber(){\n        this.number = (int) (Math.random() * 100);\n    }\n\n    public int getNumber() {\n        return number;\n    }\n}\n","new_contents":"\/**\n * Created by Nathan_Zeplowitz on 4\/14\/15.\n *\/\npublic class RandomNumber {\n    private int number;\n\n    public RandomNumber(){\n        this.number = (int) (Math.random() * 100);\n    }\n\n    public int getNumber() {\n        return number;\n    }\n\n    public String checkGuess(String userGuess) {\n        int guess = Integer.parseInt(userGuess);\n\n        if (guess == getNumber()) {\n            return \"Correct\";\n        } else if (guess < getNumber()) {\n            return \"Your guess was too low.\";\n        } else {\n            return \"Your guess was too high.\";\n        }\n    }\n}\n","subject":"Add CheckGuess Method to Random Number"}
{"old_contents":"package de.sormuras.bach.util;\n\nimport java.util.Map;\nimport java.util.NoSuchElementException;\nimport java.util.ServiceLoader;\nimport java.util.TreeMap;\nimport java.util.function.Consumer;\nimport java.util.spi.ToolProvider;\n\n\/** Tool registry. *\/\npublic class Tools {\n\n  final Map map;\n\n  public Tools() {\n    this.map = new TreeMap<>();\n    ServiceLoader.load(ToolProvider.class).stream()\n        .map(ServiceLoader.Provider::get)\n        .forEach(provider -> map.putIfAbsent(provider.name(), provider));\n  }\n\n  public ToolProvider get(String name) {\n    var tool = map.get(name);\n    if (tool == null) {\n      throw new NoSuchElementException(\"No such tool: \" + name);\n    }\n    return tool;\n  }\n\n  public void forEach(Consumer action) {\n    map.values().forEach(action);\n  }\n}\n","new_contents":"package de.sormuras.bach.util;\n\nimport java.util.Map;\nimport java.util.NoSuchElementException;\nimport java.util.ServiceLoader;\nimport java.util.TreeMap;\nimport java.util.function.Consumer;\nimport java.util.spi.ToolProvider;\n\n\/** Tool registry. *\/\npublic class Tools {\n\n  final Map map;\n\n  public Tools() {\n    this.map = new TreeMap<>();\n    ServiceLoader.load(ToolProvider.class, ClassLoader.getSystemClassLoader()).stream()\n        .map(ServiceLoader.Provider::get)\n        .forEach(provider -> map.putIfAbsent(provider.name(), provider));\n  }\n\n  public ToolProvider get(String name) {\n    var tool = map.get(name);\n    if (tool == null) {\n      throw new NoSuchElementException(\"No such tool: \" + name);\n    }\n    return tool;\n  }\n\n  public void forEach(Consumer action) {\n    map.values().forEach(action);\n  }\n}\n","subject":"Use system (application) class loader to load tool providers"}
{"old_contents":"\/*\n * Copyright 2013-2015 the original author or authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\n\npackage org.cloudfoundry.operations;\n\nimport org.junit.Test;\n\nimport static org.cloudfoundry.operations.ValidationResult.Status.VALID;\nimport static org.junit.Assert.assertEquals;\n\npublic final class ListRoutesRequestTest {\n\n    @Test\n    public void isValid() {\n        ValidationResult result = ListRoutesRequest.builder()\n                .level(ListRoutesRequest.Level.Organization)\n                .build()\n                .isValid();\n\n        assertEquals(VALID, result.getStatus());\n    }\n\n}\n","new_contents":"\/*\n * Copyright 2013-2015 the original author or authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\n\npackage org.cloudfoundry.operations;\n\nimport org.junit.Test;\n\nimport static org.cloudfoundry.operations.ValidationResult.Status.VALID;\nimport static org.junit.Assert.assertEquals;\n\npublic final class ListRoutesRequestTest {\n\n    @Test\n    public void isValid() {\n        ValidationResult result = ListRoutesRequest.builder()\n                .level(ListRoutesRequest.Level.Organization)\n                .build()\n                .isValid();\n\n        assertEquals(VALID, result.getStatus());\n    }\n\n    @Test\n    public void isValidNoLevel() {\n        ValidationResult result = ListRoutesRequest.builder()\n                .build()\n                .isValid();\n\n        assertEquals(VALID, result.getStatus());\n    }\n\n}\n","subject":"Add test for level being omitted on Routes operation."}
{"old_contents":"\/* Copyright 1998, 2005 The Apache Software Foundation or its licensors, as applicable\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *     http:\/\/www.apache.org\/licenses\/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n *\/\r\n\r\npackage java.util.jar;\r\n\r\n\r\nimport java.util.zip.ZipException;\r\n\r\n\/**\r\n * This runtime exception is thrown when a problem occurrs while reading a JAR\r\n * file.\r\n * \r\n *\/\r\npublic class JarException extends ZipException {\r\n\r\n\t\/**\r\n\t * Constructs a new instance of this class with its walkback filled in.\r\n\t *\/\r\n\tpublic JarException() {\r\n\t\tsuper();\r\n\t}\r\n\r\n\t\/**\r\n\t * Constructs a new instance of this class with its walkback and message\r\n\t * filled in.\r\n\t * \r\n\t * @param detailMessage\r\n\t *            String The detail message for the exception.\r\n\t *\/\r\n\tpublic JarException(String detailMessage) {\r\n\t\tsuper(detailMessage);\r\n\t}\r\n}\r\n","new_contents":"\/* Copyright 1998, 2005 The Apache Software Foundation or its licensors, as applicable\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *     http:\/\/www.apache.org\/licenses\/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n *\/\r\n\r\npackage java.util.jar;\r\n\r\nimport java.util.zip.ZipException;\r\n\r\n\/**\r\n * This runtime exception is thrown when a problem occurrs while reading a JAR\r\n * file.\r\n *\/\r\npublic class JarException extends ZipException {\r\n\r\n    private static final long serialVersionUID = 7159778400963954473L;\r\n\r\n    \/**\r\n     * Constructs a new instance of this class with its walkback filled in.\r\n     *\/\r\n    public JarException() {\r\n        super();\r\n    }\r\n\r\n    \/**\r\n     * Constructs a new instance of this class with its walkback and message\r\n     * filled in.\r\n     * \r\n     * @param detailMessage\r\n     *            String The detail message for the exception.\r\n     *\/\r\n    public JarException(String detailMessage) {\r\n        super(detailMessage);\r\n    }\r\n}\r\n","subject":"Add constant SUID and minor reformatting"}
{"old_contents":"package org.multibit.hd.core.dto;\n\n\/**\n * 

Enum to provide the following to various UI models:<\/p>\n *